-
-
Notifications
You must be signed in to change notification settings - Fork 51
Description
Repeatable steps:
-
Create a mapping of
noremap <silent> <Leader>f :Fern . -drawer -reveal=% -toggle -width=35<CR><C-w>=(thanks @bluz71) -
Set up something to test with
mkdir -p /tmp/testfern \
&& touch /tmp/testfern/foo \
&& touch /tmp/testfern/bar
-
cd /tmp/testfern && vim . -
In Vim
:e foo -
Use custom mapping to toggle fern open
-
Notice how
foois selected -
Use custom mapping to toggle fern closed
-
Use custom mapping to toggle fern open
-
Notice how
foois no longer selected, instead the first item in the tree is which is thetestferndirectory
There's other potentially related issues too, like if you semi-randomly start clicking foo and bar to open them in a single pane and toggle the draw a few times, sometimes the wrong file will be revealed. I can't reproduce this exactly, but it happens often. This is different than the repeatable steps because in this case it reveals and highlights the wrong file, not the root item in the tree. This is more easily tested by adding the contents "foo" and "bar" to each file so you can see the foo file being open but the bar item is revealed.