1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-02 23:00:04 +08:00

fix(scrollbar): add WinScrolled event if supported

This commit is contained in:
wsdjeg 2022-04-16 23:44:04 +08:00
parent a276b8c1ab
commit a4084690f5

View File

@ -170,9 +170,10 @@ function! SpaceVim#layers#ui#config() abort
" this options only support neovim now.
augroup spacevim_layer_ui
autocmd!
let events = join(filter( ['BufEnter', 'CursorMoved', 'VimResized', 'FocusGained', 'CursorHold', 'WinScrolled' ], 'exists("##" . v:val)'), ',')
if s:enable_scrollbar && has('nvim')
autocmd BufEnter,CursorMoved,VimResized,FocusGained,CursorHold
\ * call SpaceVim#plugins#scrollbar#show()
exe printf('autocmd %s * call SpaceVim#plugins#scrollbar#show()',
\ events)
autocmd BufLeave,FocusLost,QuitPre
\ * call SpaceVim#plugins#scrollbar#clear()
" why this autocmd is needed?