From fab2a9d878596d14150814f1e95549992ad94e29 Mon Sep 17 00:00:00 2001 From: Marco Hinz Date: Fri, 9 Dec 2016 15:17:34 +0100 Subject: [PATCH] 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. --- autoload/sy/util.vim | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/autoload/sy/util.vim b/autoload/sy/util.vim index 466dcf1..76eca1a 100644 --- a/autoload/sy/util.vim +++ b/autoload/sy/util.vim @@ -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