Xuyuanp / scrollbar.nvim

scrollbar for neovim
Apache License 2.0
269 stars 10 forks source link

Change suggested autocommand #5

Closed rcarriga closed 4 years ago

rcarriga commented 4 years ago

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 4 years ago

Thanks for your suggestion!

Can you send a pr?

mawkler commented 4 years ago

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 4 years ago

Perhaps this should be updated in :help scrollbar-config as well?