Skip to content

Commit 0c0ef48

Browse files
janlazobrammool
andauthored
vim-patch:8.1.1136: decoding of mouse click escape sequence is not tested (neovim#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. vim/vim@905dd90 Co-authored-by: Bram Moolenaar <[email protected]>
1 parent 4edeaaa commit 0c0ef48

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/nvim/api/vim.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ void nvim_feedkeys(String keys, String mode, Boolean escape_ks)
332332
if (!dangerous) {
333333
ex_normal_busy++;
334334
}
335-
exec_normal(true);
335+
exec_normal(true, lowlevel);
336336
if (!dangerous) {
337337
ex_normal_busy--;
338338
}

src/nvim/ex_docmd.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7072,21 +7072,26 @@ void exec_normal_cmd(char *cmd, int remap, bool silent)
70727072
{
70737073
// Stuff the argument into the typeahead buffer.
70747074
ins_typebuf(cmd, remap, 0, true, silent);
7075-
exec_normal(false);
7075+
exec_normal(false, false);
70767076
}
70777077

70787078
/// Execute normal_cmd() until there is no typeahead left.
70797079
///
70807080
/// @param was_typed whether or not something was typed
7081-
void exec_normal(bool was_typed)
7081+
/// @param use_vpeekc true to use vpeekc() to check for available chars
7082+
void exec_normal(bool was_typed, bool use_vpeekc)
70827083
{
70837084
oparg_T oa;
7085+
int c;
70847086

7087+
// When calling vpeekc() from feedkeys() it will return Ctrl_C when there
7088+
// is nothing to get, so also check for Ctrl_C.
70857089
clear_oparg(&oa);
70867090
finish_op = false;
70877091
while ((!stuff_empty()
70887092
|| ((was_typed || !typebuf_typed())
7089-
&& typebuf.tb_len > 0))
7093+
&& typebuf.tb_len > 0)
7094+
|| (use_vpeekc && (c = vpeekc()) != NUL && c != Ctrl_C))
70907095
&& !got_int) {
70917096
update_topline_cursor();
70927097
normal_cmd(&oa, true); // execute a Normal mode cmd

0 commit comments

Comments
 (0)