SignifyRefresh: use window ID instead of number

`win_getid()` and `win_gotoid()` were introduced in 7.4.1557.

Older versions will continue using the less accurate window number instead.
This commit is contained in:
Marco Hinz 2016-12-09 15:17:34 +01:00
parent fa5053105f
commit fab2a9d878

View File

@ -24,9 +24,19 @@ endfunction
" Function: #refresh_windows {{{1
function! sy#util#refresh_windows() abort
let winnr = winnr()
if exists('*win_getid')
let winid = win_getid()
else
let winnr = winnr()
endif
windo if exists('b:sy') | call sy#start() | endif
execute winnr .'wincmd w'
if exists('winid')
call win_gotoid(winid)
else
execute winnr .'wincmd w'
endif
endfunction
" Function: #hunk_text_object {{{1