Closed delphinus closed 4 years ago
I pushed a fixed. please take a look.
Thx! I found no error occurs on show()
. The scrollbar still disappears after <C-w>o
, but it shows again when CursorMoved
.
I wrote a workaround on my config.
function! s:only_and_show() abort
only
silent! lua require('scrollbar').show()
endfunction
map <C-w>o :silent call <SID>only_and_show()<CR>
With this, <C-w>o
does not remove the scrollbar (:only
still removes it).
Great tricks.
When I type
<C-w>o
to close all windows other than the focused one, the scrollbar disappears and Neovim shows an error withshow()
.This is because
b:scrollbar_state.winnr
indicates a floating window that is already closed by<C-w>o
.I can show the scrollbar again by codes above, but it is annoying a bit. So,
<C-w>o
pressed?show()
clearb:scrollbar_state
ifwinnr
indicates an invalid ID?