mirror of
https://github.com/neovim/neovim.git
synced 2024-09-17 20:58:20 -04:00
fix(inccommand): update topline after moving cursor (#27341)
This commit is contained in:
parent
18e62c1bdb
commit
35ffe58ea4
@ -4592,9 +4592,6 @@ static int show_sub(exarg_T *eap, pos_T old_cusr, PreviewLines *preview_lines, i
|
||||
// disable file info message
|
||||
set_string_option_direct(kOptShortmess, "F", 0, SID_NONE);
|
||||
|
||||
// Update the topline to ensure that main window is on the correct line
|
||||
update_topline(curwin);
|
||||
|
||||
// Place cursor on nearest matching line, to undo do_sub() cursor placement.
|
||||
for (size_t i = 0; i < lines.subresults.size; i++) {
|
||||
SubResult curres = lines.subresults.items[i];
|
||||
@ -4605,6 +4602,9 @@ static int show_sub(exarg_T *eap, pos_T old_cusr, PreviewLines *preview_lines, i
|
||||
} // Else: All matches are above, do_sub() already placed cursor.
|
||||
}
|
||||
|
||||
// Update the topline to ensure that main window is on the correct line
|
||||
update_topline(curwin);
|
||||
|
||||
// Width of the "| lnum|..." column which displays the line numbers.
|
||||
int col_width = 0;
|
||||
// Use preview window only when inccommand=split and range is not just the current line
|
||||
|
@ -1064,11 +1064,11 @@ describe(':substitute, inccommand=split', function()
|
||||
|
||||
feed(':%s/tw/X')
|
||||
screen:expect([[
|
||||
Inc substitution on |
|
||||
BBo lines |
|
||||
Inc substitution on |
|
||||
{12:X}o lines |
|
||||
Inc substitution on |
|
||||
{12:X}o lines |
|
||||
{11:[No Name] [+] }|
|
||||
|1001| {12:X}o lines |
|
||||
|1003| {12:X}o lines |
|
||||
|
Loading…
Reference in New Issue
Block a user