]> granicus.if.org Git - vim/commitdiff
patch 8.2.4636: not using Visual range v8.2.4636
authorBram Moolenaar <Bram@vim.org>
Sun, 27 Mar 2022 15:56:21 +0000 (16:56 +0100)
committerBram Moolenaar <Bram@vim.org>
Sun, 27 Mar 2022 15:56:21 +0000 (16:56 +0100)
Problem:    Not using Visual range.
Solution:   Put the command pointer back to the range.

src/ex_docmd.c
src/version.c

index 9b3504f76e72c9d25aaccc81e69d4f83905e708c..ab2aa60b8ebd9d0065d3d6e2ad6907bc28bbfd6e 100644 (file)
@@ -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;
index 2ab46bb5396b3cb82f1dac65d9a0a800c3991af3..c4caa536193f7d109bd1ab7973a97fd557b11000 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    4636,
 /**/
     4635,
 /**/