sQu1rr / nerd-treeview

Vim-like NERD Tree behaviour for Atom.io Tree View
https://atom.io/packages/nerd-treeview
MIT License
19 stars 5 forks source link

make sure that $tree is instance of jQuery #16

Closed markovicdenis closed 7 years ago

sQu1rr commented 7 years ago

Thanks mate will test and merge later this week. How come it worked before - or has it never worked?

dcalhoun commented 7 years ago

@sQu1rr this PR is to fix #15. It seems like the Atom's 1.16.0 release may have introduced a change that causes this error. Specifically, maybe it's wrapped up in...

Lots of progress in our ongoing effort to remove jQuery from bundled packages.

Now that 1.16.0 is an official release, nerd-treeview is all but unusable at the moment. Nearly every movement key throws an error. ☹️

sQu1rr commented 7 years ago

OK I will look into it in my free time. thanks for the PR i'll try not to delay merging it for too long

jondot commented 7 years ago

For gg and G (scroll to top and bottom) another fix is needed in jumpLine:

    jumpLine: (num) ->
        return if not treeView = @getTreeView()

        $elements = $(treeView.element).find('li:visible')
        #                       ^---- here
        if not num
            num = if @num then @num else $elements.size()
            num = $elements.size() if num > $elements.size()

        $entry = $elements.eq(num - 1)
        treeView.selectEntry($entry[0])
        scrollIfInvisible($entry, treeView)

        @clearPrefix()