]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.2.4806: a mapping using <LeftDrag> does not start Select mode v8.2.4806
authorBram Moolenaar <Bram@vim.org>
Fri, 22 Apr 2022 20:20:26 +0000 (21:20 +0100)
committerBram Moolenaar <Bram@vim.org>
Fri, 22 Apr 2022 20:20:26 +0000 (21:20 +0100)
Problem:    A mapping using <LeftDrag> does not start Select mode.
Solution:   When checking for starting select mode with the mouse also do this
            when there is typeahead. (closes #10249)

src/normal.c
src/version.c

index 563492551372cefdba5aec58232a83cd0fd84958..e44b51320a382cf3b4a3be378dfeede075a2a8a5 100644 (file)
@@ -5527,12 +5527,13 @@ start_selection(void)
 
 /*
  * Start Select mode, if "c" is in 'selectmode' and not in a mapping or menu.
+ * When "c" is 'o' (checking for "mouse") then also when mapped.
  */
     void
 may_start_select(int c)
 {
-    VIsual_select = (stuff_empty() && typebuf_typed()
-                   && (vim_strchr(p_slm, c) != NULL));
+    VIsual_select = (c == 'o' || (stuff_empty() && typebuf_typed()))
+                   && vim_strchr(p_slm, c) != NULL;
 }
 
 /*
index 28ac75e9833266fa03b6fd2273daf1e97984334d..6df25dae0028c19be0433d681b450429cf27dce1 100644 (file)
@@ -746,6 +746,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    4806,
 /**/
     4805,
 /**/