From df2c2988bbaecd28b0fbec8d64327b1bbb005e19 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 28 Jan 2021 20:18:08 +0100 Subject: 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 #3434) --- src/ex_cmds.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/ex_cmds.c') diff --git a/src/ex_cmds.c b/src/ex_cmds.c index 545e06dbd..12219e7ba 100644 --- a/src/ex_cmds.c +++ b/src/ex_cmds.c @@ -3747,6 +3747,8 @@ ex_substitute(exarg_T *eap) { linenr_T joined_lines_count; + if (eap->skip) + return; curwin->w_cursor.lnum = eap->line1; if (*cmd == 'l') eap->flags = EXFLAG_LIST; -- cgit v1.2.1