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

pref(scrollbar): set eventignore=all when update scrollbar

This commit is contained in:
wsdjeg 2022-04-19 23:01:33 +08:00
parent 2c29bd6462
commit e9b5a524a6

View File

@ -107,15 +107,19 @@ function! s:create_scrollbar_buffer(size, lines) abort
endfunction endfunction
function! SpaceVim#plugins#scrollbar#show() abort function! SpaceVim#plugins#scrollbar#show() abort
let saved_ei = &eventignore
let &ei = 'all'
let [winnr, bufnr, winid] = [winnr(), bufnr(), win_getid()] let [winnr, bufnr, winid] = [winnr(), bufnr(), win_getid()]
if s:WIN.is_float(winid) if s:WIN.is_float(winid)
call SpaceVim#plugins#scrollbar#clear() call SpaceVim#plugins#scrollbar#clear()
let &ei = saved_ei
return return
endif endif
let excluded_filetypes = s:get('excluded_filetypes') let excluded_filetypes = s:get('excluded_filetypes')
if &filetype == '' || index(excluded_filetypes, &filetype) !=# -1 if &filetype == '' || index(excluded_filetypes, &filetype) !=# -1
call SpaceVim#plugins#scrollbar#clear() call SpaceVim#plugins#scrollbar#clear()
let &ei = saved_ei
return return
endif endif
@ -123,6 +127,7 @@ function! SpaceVim#plugins#scrollbar#show() abort
let height = winheight(winnr) let height = winheight(winnr)
if total <= height if total <= height
call SpaceVim#plugins#scrollbar#clear() call SpaceVim#plugins#scrollbar#clear()
let &ei = saved_ei
return return
endif endif
@ -161,6 +166,7 @@ function! SpaceVim#plugins#scrollbar#show() abort
call setwinvar(win_id2win(s:scrollbar_winid), '&winhighlight', 'Normal:ScrollbarWinHighlight') call setwinvar(win_id2win(s:scrollbar_winid), '&winhighlight', 'Normal:ScrollbarWinHighlight')
endif endif
endif endif
let &ei = saved_ei
endfunction endfunction
" the first argument is buffer number " the first argument is buffer number