Closed jordwalke closed 7 years ago
Here is a quickfix for this error which works for me.. Add $tree = $($tree) to 12th line of ".atom/packages/nerd-treeview/lib/nerd-treeview.coffee"
$ = jQuery = require 'jquery'
# influenced by https://github.com/customd/jquery-visible
visible = ($e, $tree) ->
top = $e.offset().top
bottom = top + $e.height()
treeTop = $tree.offset().top
treeBottom = treeTop + $tree.height()
return top >= treeTop and bottom <= treeBottom
scrollIfInvisible = ($e, $tree) ->
$tree = $($tree)
if not visible($e, $tree)
$e[0]?.scrollIntoView($e.offset().top < $tree.offset().top)
...
@markovicdenis would you be willing to open a PR with your fix, please?
@dcalhoun This what I'm doing seems like a hack, but it seems to fix the error. In the latest version you actually have to add $tree = $($tree.element)
..
Anyways, submitted a PR with some checks to make sure that $tree is not already an jQuery object in "scrollIfInvisible" function
Glad to see a fix. Atom is getting Faster, and VMP is as well so this plugin is of renewed interest.
Open the tree view. Use j/k.
Atom: 1.16.0-beta0 x64 Electron: 1.3.13 OS: Mac OS X 10.12.2 Thrown From: nerd-treeview package 0.4.3
Stack Trace
Uncaught TypeError: $tree.offset is not a function
Commands
Non-Core Packages