summaryrefslogtreecommitdiffstats
path: root/src/ex_docmd.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-03-27 16:56:21 +0100
committerBram Moolenaar <Bram@vim.org>2022-03-27 16:56:21 +0100
commit1501b63f8dedbd15ee5bfd9a177e558ffdf0673a (patch)
tree6abd9ce1bc52fa61e39614a2e47b8f819d753946 /src/ex_docmd.c
parent501f978288008c2e4e8761858af2e27b14223afd (diff)
patch 8.2.4636: not using Visual rangev8.2.4636
Problem: Not using Visual range. Solution: Put the command pointer back to the range.
Diffstat (limited to 'src/ex_docmd.c')
-rw-r--r--src/ex_docmd.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 9b3504f76e..ab2aa60b8e 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -3092,15 +3092,21 @@ parse_command_modifiers(
break;
}
- if (has_visual_range && eap->cmd > cmd_start)
- {
- // Move the '<,'> range to after the modifiers and insert a colon.
- // Since the modifiers have been parsed put the colon on top of the
- // space: "'<,'>mod cmd" -> "mod:'<,'>cmd
- // Put eap->cmd after the colon.
- mch_memmove(cmd_start - 5, cmd_start, eap->cmd - cmd_start);
- eap->cmd -= 5;
- mch_memmove(eap->cmd - 1, ":'<,'>", 6);
+ if (has_visual_range)
+ {
+ if (eap->cmd > cmd_start)
+ {
+ // Move the '<,'> range to after the modifiers and insert a colon.
+ // Since the modifiers have been parsed put the colon on top of the
+ // space: "'<,'>mod cmd" -> "mod:'<,'>cmd
+ // Put eap->cmd after the colon.
+ mch_memmove(cmd_start - 5, cmd_start, eap->cmd - cmd_start);
+ eap->cmd -= 5;
+ mch_memmove(eap->cmd - 1, ":'<,'>", 6);
+ }
+ else
+ // no modifiers, move the pointer back
+ eap->cmd -= 5;
}
return OK;