lambdalisue / vim-fern

🌿 General purpose asynchronous tree viewer written in Pure Vim script
MIT License
1.29k stars 49 forks source link

Having user defined Sort function breaks ? mapping #202

Closed habamax closed 4 years ago

habamax commented 4 years ago

I press ? to get available mappings and it errors with:

image

If I remove/rename function Sort everything works.

lambdalisue commented 4 years ago

Wow... I didn't know that the function local variable conflicts with the global variable...... Thanks for the report. I'll consider ways to avoid that.

lambdalisue commented 4 years ago

Prob. #205 fix the issue. Please try @habamax

habamax commented 4 years ago

@lambdalisue thx, it works now

habamax commented 4 years ago

But I think there is another issue appeared:

image

  1. I have toggled fern drawer
  2. call a command that closes all windows and loads set of new buffers
" Open vim configs
command! Init :silent only
            \<bar>:exe printf("e %s/vimrc", fnamemodify($MYVIMRC, ":p:h"))
            \<bar>:exe printf("bo vs %s/plugin/mappings.vim", fnamemodify($MYVIMRC, ":p:h"))
            \<bar>:exe printf("bo vs %s/plugin/pack_list.vim", fnamemodify($MYVIMRC, ":p:h"))
            \<bar>:exe printf("bo vs %s/plugin/pack_setup.vim", fnamemodify($MYVIMRC, ":p:h"))
            \<bar>:exe printf("bo vs %s/after/plugin/setup.vim", fnamemodify($MYVIMRC, ":p:h"))
            \<bar>:1wincmd w
  1. Try to change windows with C-w w

PS, and it is actually even simpler: just toggle fern drawer with:

 nnoremap <F8> :Fern . -drawer -toggle -reveal=%<CR>

image

lambdalisue commented 4 years ago

Ah sorry. I've noticed that bug. I've applied nonrelated changes as well on that PR by mistake. I'll fix that before the merge 👍

habamax commented 4 years ago

Thx!