Closed nickjj closed 4 years ago
Confirmed with Vim. It does not happen on Neovim.
" vim -u ~/.vim/vimrc.min
if has('vim_starting')
set nocompatible
endif
nnoremap ; :
nnoremap : ;
set packpath=
set runtimepath+=~/.config/nvim/pack/minpac/start/fern.vim
filetype plugin indent on
syntax on
:e foo
:Fern . -drawer -toggle -reveal=%
:q
:Fern . -drawer -toggle -reveal=%
I fixed this issue but maybe the current correct behavior is not what you want. In that case, create a new issue as a feature request with a little more clear description of the ideal behavior @nickjj
Hi,
The ideal behavior would be following steps 1-9 and no matter the previous state of the draw, whenever the draw becomes visible the file you have actively focused in Vim would end up being revealed / highlighted in the draw. If the draw remains open (such as not toggling), then focusing a different file / buffer in Vim would always reveal that file in the draw upon calling Fern with reveal.
I'm coming at this from the perspective of editing a file in Vim and wanting to end up in a situation where that file is now focused and revealed in the draw by hitting 1 hot key. What happens next isn't important, but typically it involves operating on the file for my most common use cases (such as renaming it, etc.) but sometimes I just want to reveal it so I can see it in the tree.
I've close this while the corresponding bug has fixed.
It sounds you've to need "force reveal mode" or whatever. It would be nice to create a new issue as a feature request. Additionally, it sounds once feature explained here (https://github.com/lambdalisue/fern.vim/issues/114) would be implemented, it may help
Thanks, if it's all the same to you, can we use #114 as that?
Or feel free to open another issue and copy / paste my previous response.
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
cd /tmp/testfern && vim .
In Vim
:e foo
Use custom mapping to toggle fern open
Notice how
foo
is selectedUse custom mapping to toggle fern closed
Use custom mapping to toggle fern open
Notice how
foo
is no longer selected, instead the first item in the tree is which is thetestfern
directoryThere'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.