[vim] 74/139: patch 7.4.1758 Problem: Triggering CursorHoldI when in CTRL-X mode causes problems. Solution: Do not trigger CursorHoldI in CTRL-X mode. Add "!" flag to feedkeys() (test with that didn't work though).

James McCoy jamessan at debian.org
Fri May 6 04:00:05 UTC 2016


This is an automated email from the git hooks/post-receive script.

jamessan pushed a commit to branch debian/sid
in repository vim.

commit 245c41070c7f37d52be43cce0cb140bd3ade6c7e
Author: Bram Moolenaar <Bram at vim.org>
Date:   Wed Apr 20 17:37:41 2016 +0200

    patch 7.4.1758
    Problem:    Triggering CursorHoldI when in CTRL-X mode causes problems.
    Solution:   Do not trigger CursorHoldI in CTRL-X mode. Add "!" flag to
                feedkeys() (test with that didn't work though).
---
 src/edit.c    | 7 ++++++-
 src/eval.c    | 8 ++++++--
 src/version.c | 2 ++
 3 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/src/edit.c b/src/edit.c
index c813d1f..73ed472 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -1526,7 +1526,12 @@ normalchar:
 
 #ifdef FEAT_AUTOCMD
 	/* If typed something may trigger CursorHoldI again. */
-	if (c != K_CURSORHOLD)
+	if (c != K_CURSORHOLD
+# ifdef FEAT_COMPL_FUNC
+	    /* but not in CTRL-X mode, a script can't restore the state */
+	    && ctrl_x_mode == 0
+# endif
+	       )
 	    did_cursorhold = FALSE;
 #endif
 
diff --git a/src/eval.c b/src/eval.c
index 28cc2f1..53a651a 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -11547,6 +11547,7 @@ f_feedkeys(typval_T *argvars, typval_T *rettv UNUSED)
     char_u	nbuf[NUMBUFLEN];
     int		typed = FALSE;
     int		execute = FALSE;
+    int		dangerous = FALSE;
     char_u	*keys_esc;
 
     /* This is not allowed in the sandbox.  If the commands would still be
@@ -11569,6 +11570,7 @@ f_feedkeys(typval_T *argvars, typval_T *rettv UNUSED)
 		case 't': typed = TRUE; break;
 		case 'i': insert = TRUE; break;
 		case 'x': execute = TRUE; break;
+		case '!': dangerous = TRUE; break;
 	    }
 	}
     }
@@ -11592,9 +11594,11 @@ f_feedkeys(typval_T *argvars, typval_T *rettv UNUSED)
 		/* Avoid a 1 second delay when the keys start Insert mode. */
 		msg_scroll = FALSE;
 
-		++ex_normal_busy;
+		if (!dangerous)
+		    ++ex_normal_busy;
 		exec_normal(TRUE);
-		--ex_normal_busy;
+		if (!dangerous)
+		    --ex_normal_busy;
 		msg_scroll |= save_msg_scroll;
 	    }
 	}
diff --git a/src/version.c b/src/version.c
index 6308789..0993f66 100644
--- a/src/version.c
+++ b/src/version.c
@@ -749,6 +749,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1758,
+/**/
     1757,
 /**/
     1756,

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-vim/vim.git



More information about the pkg-vim-maintainers mailing list