commit 0c0ef489f95f16ce45f4a59c50f166d22f6d8ee4
parent 4edeaaa6e2c1454a6e2ceeca515727954333c2a6
Author: Jan Edmund Lazo <jan.lazo@mail.utoronto.ca>
Date: Sat, 30 Aug 2025 01:39:43 -0400
vim-patch:8.1.1136: decoding of mouse click escape sequence is not tested (#35551)
Problem: Decoding of mouse click escape sequence is not tested.
Solution: Add a test for xterm and SGR using low-level input. Make
low-level input execution with feedkeys() work.
https://github.com/vim/vim/commit/905dd905debfde403b2a18178ccc1f8e118f4f2b
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat:
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c
@@ -332,7 +332,7 @@ void nvim_feedkeys(String keys, String mode, Boolean escape_ks)
if (!dangerous) {
ex_normal_busy++;
}
- exec_normal(true);
+ exec_normal(true, lowlevel);
if (!dangerous) {
ex_normal_busy--;
}
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
@@ -7072,21 +7072,26 @@ void exec_normal_cmd(char *cmd, int remap, bool silent)
{
// Stuff the argument into the typeahead buffer.
ins_typebuf(cmd, remap, 0, true, silent);
- exec_normal(false);
+ exec_normal(false, false);
}
/// Execute normal_cmd() until there is no typeahead left.
///
/// @param was_typed whether or not something was typed
-void exec_normal(bool was_typed)
+/// @param use_vpeekc true to use vpeekc() to check for available chars
+void exec_normal(bool was_typed, bool use_vpeekc)
{
oparg_T oa;
+ int c;
+ // When calling vpeekc() from feedkeys() it will return Ctrl_C when there
+ // is nothing to get, so also check for Ctrl_C.
clear_oparg(&oa);
finish_op = false;
while ((!stuff_empty()
|| ((was_typed || !typebuf_typed())
- && typebuf.tb_len > 0))
+ && typebuf.tb_len > 0)
+ || (use_vpeekc && (c = vpeekc()) != NUL && c != Ctrl_C))
&& !got_int) {
update_topline_cursor();
normal_cmd(&oa, true); // execute a Normal mode cmd