mirror of
https://github.com/neovim/neovim.git
synced 2025-10-02 16:08:36 +00:00
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:
@@ -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;
|
||||
|
@@ -78,6 +78,9 @@ func Test_Ex_substitute()
|
||||
call WaitForAssert({-> assert_match(' 1 foo foo', term_getline(buf, 5))},
|
||||
\ 1000)
|
||||
call WaitForAssert({-> assert_match(' ^^^', term_getline(buf, 6))}, 1000)
|
||||
call term_sendkeys(buf, "N\<CR>")
|
||||
call term_wait(buf)
|
||||
call WaitForAssert({-> assert_match(' ^^^', term_getline(buf, 6))}, 1000)
|
||||
call term_sendkeys(buf, "n\<CR>")
|
||||
call WaitForAssert({-> assert_match(' ^^^', term_getline(buf, 6))},
|
||||
\ 1000)
|
||||
|
Reference in New Issue
Block a user