changeset 28564:9a2fb96475ed v8.2.4806

patch 8.2.4806: a mapping using <LeftDrag> does not start Select mode Commit: https://github.com/vim/vim/commit/53ef5731480d8b5aa74137a09b3b164b436ed76b Author: Bram Moolenaar <Bram@vim.org> Date: Fri Apr 22 21:20:26 2022 +0100 patch 8.2.4806: a mapping using <LeftDrag> does not start Select mode 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)
author Bram Moolenaar <Bram@vim.org>
date Fri, 22 Apr 2022 22:30:02 +0200
parents 0e4c2e79baac
children 7d76c24fbb4d
files src/normal.c src/version.c
diffstat 2 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/normal.c
+++ b/src/normal.c
@@ -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;
 }
 
 /*
--- a/src/version.c
+++ b/src/version.c
@@ -747,6 +747,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    4806,
+/**/
     4805,
 /**/
     4804,