aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2019-12-30 16:27:26 -0500
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2019-12-30 16:30:58 -0500
commit0e7baed2195fec8e99df69112e464791c02b2555 (patch)
tree4196fe22b717da82e68675d38e7e19e750018d8f
parent6e6544d645f9a9c151a2e027e23d8f79ecd8f7c9 (diff)
downloadrneovim-0e7baed2195fec8e99df69112e464791c02b2555.tar.gz
rneovim-0e7baed2195fec8e99df69112e464791c02b2555.tar.bz2
rneovim-0e7baed2195fec8e99df69112e464791c02b2555.zip
vim-patch:8.1.1741: cleared/added match highlighting not updated in other window
Problem: Cleared/added match highlighting not updated in other window. (Andi Massimino) Solution: Mark the right window for refresh. https://github.com/vim/vim/commit/4ef18dcc2e3a6a9aea2dc90bbdb742c3c9231394
-rw-r--r--src/nvim/testdir/test_match.vim45
-rw-r--r--src/nvim/window.c4
2 files changed, 39 insertions, 10 deletions
diff --git a/src/nvim/testdir/test_match.vim b/src/nvim/testdir/test_match.vim
index 921c3e3c55..c134cfb1c0 100644
--- a/src/nvim/testdir/test_match.vim
+++ b/src/nvim/testdir/test_match.vim
@@ -250,25 +250,54 @@ func Test_matchaddpos_using_negative_priority()
set hlsearch&
endfunc
-func Test_matchdelete_other_window()
- if !CanRunVimInTerminal()
- throw 'Skipped: cannot make screendumps'
- endif
-
+func OtherWindowCommon()
let lines =<< trim END
call setline(1, 'Hello Vim world')
let mid = matchadd('Error', 'world', 1)
let winid = win_getid()
new
END
- call writefile(lines, 'XscriptMatchDelete')
- let buf = RunVimInTerminal('-S XscriptMatchDelete', #{rows: 12})
+ call writefile(lines, 'XscriptMatchCommon')
+ let buf = RunVimInTerminal('-S XscriptMatchCommon', #{rows: 12})
call term_wait(buf)
+ return buf
+endfunc
+
+func Test_matchdelete_other_window()
+ if !CanRunVimInTerminal()
+ throw 'Skipped: cannot make screendumps'
+ endif
+ let buf = OtherWindowCommon()
call term_sendkeys(buf, ":call matchdelete(mid, winid)\<CR>")
call VerifyScreenDump(buf, 'Test_matchdelete_1', {})
call StopVimInTerminal(buf)
- call delete('XscriptMatchDelete')
+ call delete('XscriptMatchCommon')
+endfunc
+
+func Test_matchclear_other_window()
+ if !CanRunVimInTerminal()
+ throw 'Skipped: cannot make screendumps'
+ endif
+ let buf = OtherWindowCommon()
+ call term_sendkeys(buf, ":call clearmatches(winid)\<CR>")
+ call VerifyScreenDump(buf, 'Test_matchclear_1', {})
+
+ call StopVimInTerminal(buf)
+ call delete('XscriptMatchCommon')
+endfunc
+
+func Test_matchadd_other_window()
+ if !CanRunVimInTerminal()
+ throw 'Skipped: cannot make screendumps'
+ endif
+ let buf = OtherWindowCommon()
+ call term_sendkeys(buf, ":call matchadd('Search', 'Hello', 1, -1, #{window: winid})\<CR>")
+ call term_sendkeys(buf, ":\<CR>")
+ call VerifyScreenDump(buf, 'Test_matchadd_1', {})
+
+ call StopVimInTerminal(buf)
+ call delete('XscriptMatchCommon')
endfunc
diff --git a/src/nvim/window.c b/src/nvim/window.c
index 5d4332c75a..79d7a8acba 100644
--- a/src/nvim/window.c
+++ b/src/nvim/window.c
@@ -6622,7 +6622,7 @@ int match_add(win_T *wp, const char *const grp, const char *const pat,
prev->next = m;
m->next = cur;
- redraw_later(rtype);
+ redraw_win_later(wp, rtype);
return id;
fail:
@@ -6698,7 +6698,7 @@ void clear_matches(win_T *wp)
xfree(wp->w_match_head);
wp->w_match_head = m;
}
- redraw_later(SOME_VALID);
+ redraw_win_later(wp, SOME_VALID);
}
/*