vim-patch:8.2.2732: prompt for s///c in Ex mode can be wrong

Problem:    Prompt for s///c in Ex mode can be wrong.
Solution:   Position the cursor before showing the prompt. (closes vim/vim#8073)
e5b0b98a90
This commit is contained in:
zeertzjq
2022-07-12 12:37:23 +08:00
parent d079995fb8
commit 1abdb3224b
3 changed files with 40 additions and 22 deletions

View File

@@ -3874,6 +3874,7 @@ static int do_sub(exarg_T *eap, proftime_T timeout, long cmdpreview_ns, handle_T
curwin->w_cursor.col = 0;
}
getvcol(curwin, &curwin->w_cursor, NULL, NULL, &ec);
curwin->w_cursor.col = regmatch.startpos[0].col;
if (subflags.do_number || curwin->w_p_nu) {
int numw = number_width(curwin) + 1;
sc += numw;