1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-02 22:20:06 +08:00

fix(scrollbar): fix position of scrollbar

This commit is contained in:
wsdjeg 2022-04-21 13:14:45 +08:00
parent 0b3f505e4d
commit a98061caad

View File

@ -131,13 +131,13 @@ function! SpaceVim#plugins#scrollbar#show() abort
return
endif
let pos = getpos('.')
let curr_line = pos[1]
" the position should be based on first line of current screen.
let curr_line = line('w0')
let bar_size = s:fix_size(height * height / total)
let width = winwidth(winnr)
let col = width - s:get('width') - s:get('right_offset')
let row = (height - bar_size) * (curr_line * 1.0 / total)
let row = (height - bar_size) * (curr_line * 1.0 / (total - height))
let opts = {
\ 'style' : 'minimal',
@ -176,4 +176,3 @@ function! SpaceVim#plugins#scrollbar#clear(...) abort
call s:FLOAT.win_close(s:scrollbar_winid, 1)
endif
endfunction