vim-patch:8.2.2425: cursor on invalid line with range and :substitute

Problem:    Cursor on invalid line with range and :substitute.
Solution:   Do not move the cursor when skipping commands. (closes vim/vim#3434)
df2c2988bb

Cherry-pick Test_for_invalid() from patch v8.1.0736.
This commit is contained in:
Jan Edmund Lazo
2021-01-28 23:48:52 -05:00
parent c77b679ecd
commit 1376994f15
2 changed files with 14 additions and 0 deletions

View File

@@ -3126,6 +3126,9 @@ static bool sub_joining_lines(exarg_T *eap, char_u *pat, char_u *sub,
|| *cmd == 'l'
|| *cmd == 'p'
|| *cmd == '#')))) {
if (eap->skip) {
return true;
}
curwin->w_cursor.lnum = eap->line1;
if (*cmd == 'l') {
eap->flags = EXFLAG_LIST;