From 7da7ff7c5c79dd36e053f5b5e86046838445bb8e Mon Sep 17 00:00:00 2001 From: Shougo Matsushita Date: Tue, 22 Nov 2016 06:52:51 +0900 Subject: vim-patch:7.4.1758, 7.4.1759, 7.4.1692 #5640 vim-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). https://github.com/vim/vim/commit/245c41070c7f37d52be43cce0cb140bd3ade6c7e vim-patch:7.4.1759 Problem: When using feedkeys() in a timer the inserted characters are not used right away. Solution: Break the wait loop when characters have been added to typebuf. use this for testing CursorHoldI. https://github.com/vim/vim/commit/40b1b5443c88fab77f1f7c6f9e801f7ffdb7e0a8 vim-patch:7.4.1692 Problem: feedkeys('i', 'x') gets stuck, waits for a character to be typed. Solution: Behave like ":normal". (Yasuhiro Matsumoto) --- src/nvim/api/vim.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/nvim/api') diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c index 491375bd73..e59e955aed 100644 --- a/src/nvim/api/vim.c +++ b/src/nvim/api/vim.c @@ -61,6 +61,7 @@ void nvim_feedkeys(String keys, String mode, Boolean escape_csi) bool insert = false; bool typed = false; bool execute = false; + bool dangerous = false; for (size_t i = 0; i < mode.size; ++i) { switch (mode.data[i]) { @@ -69,6 +70,7 @@ void nvim_feedkeys(String keys, String mode, Boolean escape_csi) case 't': typed = true; break; case 'i': insert = true; break; case 'x': execute = true; break; + case '!': dangerous = true; break; } } @@ -99,7 +101,13 @@ void nvim_feedkeys(String keys, String mode, Boolean escape_csi) /* Avoid a 1 second delay when the keys start Insert mode. */ msg_scroll = false; + if (!dangerous) { + ex_normal_busy++; + } exec_normal(true); + if (!dangerous) { + ex_normal_busy--; + } msg_scroll |= save_msg_scroll; } } -- cgit