mirror of
https://github.com/neovim/neovim.git
synced 2026-08-20 22:31:11 +00:00
fix(ui2): retain substitute confirmation highlight with nohlsearch #41067
Problem: ui2 clears the substitute confirmation match when it updates its prompt buffer with hlsearch disabled. Solution: Only invalidate the match highlight when the current buffer changes.
This commit is contained in:
@@ -142,8 +142,10 @@ void changed(buf_T *buf)
|
||||
}
|
||||
buf_inc_changedtick(buf);
|
||||
|
||||
// If a pattern is highlighted, the position may now be invalid.
|
||||
Search.hl_match = false;
|
||||
// A match highlight can only be invalidated by changes to the current buffer.
|
||||
if (buf == curbuf) {
|
||||
Search.hl_match = false;
|
||||
}
|
||||
}
|
||||
|
||||
/// Internal part of changed(), no user interaction.
|
||||
|
||||
@@ -201,6 +201,24 @@ describe('cmdline2', function()
|
||||
screen:expect_unchanged(true)
|
||||
end)
|
||||
|
||||
it('keeps the confirmation match highlighted with nohlsearch #41039', function()
|
||||
exec('call setline(1, "test test") | set nohlsearch')
|
||||
feed('/te<CR>')
|
||||
screen:expect([[
|
||||
test ^test |
|
||||
{1:~ }|*12
|
||||
/te |
|
||||
]])
|
||||
|
||||
feed(':%s/te/t/gc<CR>')
|
||||
screen:expect([[
|
||||
{2:te}st test |
|
||||
{1:~ }|*11
|
||||
{6:replace with t? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll}|
|
||||
{6: up(^E)/down(^Y)}^ |
|
||||
]])
|
||||
end)
|
||||
|
||||
it('dialog position is adjusted for toggled non-pum wildmenu', function()
|
||||
exec([[
|
||||
set wildmode=list:full,full wildoptions-=pum
|
||||
|
||||
Reference in New Issue
Block a user