Skip to content

Commit 6a15c23

Browse files
authored
Merge pull request #31 from KSR-Yasuda/feature/KeepMatchHighlightInWinMove
Keep `match` highlight in window move
2 parents de2ab89 + b751080 commit 6a15c23

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

autoload/winresizer.vim

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,21 @@ endfun
6161
fun! winresizer#swapWindow(to)
6262
let curNum = winnr()
6363
let curBuf = bufnr( "%" )
64+
if has('patch-8.1.2018')
65+
let curMatch = getmatches(curNum)
66+
endif
6467
exe a:to . "wincmd w"
65-
let toBuf = bufnr( "%" )
68+
let toBuf = bufnr( "%" )
69+
if has('patch-8.1.2018')
70+
let toMatch = getmatches(a:to)
71+
endif
6672
exe 'hide buf' curBuf
6773
exe curNum . "wincmd w"
6874
exe 'hide buf' toBuf
75+
if has('patch-8.1.2018')
76+
call setmatches(curMatch, a:to)
77+
call setmatches(toMatch, curNum)
78+
endif
6979
exe a:to ."wincmd w"
7080
endfun
7181

0 commit comments

Comments
 (0)