Change suggested autocommand
rcarriga opened this issue · 3 comments
rcarriga commented
Awesome work, this is a really cool plugin!
I just have a small suggestion for the README. Using BufEnter
and BufLeave
events means that when using the split
and vsplit
commands without any arguments, the bar doesn't update as the same buffer is used but in the new window. Replacing these with the WinEnter
and WinLeave
events fixes the issue.
Like I said just a minor thing, otherwise thanks a million!
Xuyuanp commented
Thanks for your suggestion!
Can you send a pr?
mawkler commented
Also, all the autocmd
events can be combined into the same lines which drastically reduces the number of lines in :h scrollbar-config
like so:
augroup your_config_scrollbar_nvim
autocmd!
autocmd WinEnter,FocusGained,CursorMoved,VimResized * silent! lua require('scrollbar').show()
autocmd WinLeave,FocusLost * silent! lua require('scrollbar').clear()
augroup end
mawkler commented
Perhaps this should be updated in :help scrollbar-config
as well?