aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/tui/input.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/tui/input.c')
-rw-r--r--src/nvim/tui/input.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/nvim/tui/input.c b/src/nvim/tui/input.c
index a5d021943b..7af28561c2 100644
--- a/src/nvim/tui/input.c
+++ b/src/nvim/tui/input.c
@@ -128,8 +128,6 @@ void tinput_init(TermInput *input, Loop *loop)
input->in_fd = STDIN_FILENO;
input->waiting_for_bg_response = 0;
input->extkeys_type = kExtkeysNone;
- // The main thread is waiting for the UI thread to call CONTINUE, so it can
- // safely access global variables.
input->ttimeout = (bool)p_ttimeout;
input->ttimeoutlen = p_ttm;
input->key_buffer = rbuffer_new(KEY_BUFFER_SIZE);
@@ -372,9 +370,10 @@ static void forward_mouse_event(TermInput *input, TermKeyKey *key)
if (ev == TERMKEY_MOUSE_UNKNOWN && !(key->code.mouse[0] & 0x20)) {
int code = key->code.mouse[0] & ~0x3c;
+ // https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Other-buttons
if (code == 66 || code == 67) {
ev = TERMKEY_MOUSE_PRESS;
- button = code - 60;
+ button = code + 4 - 64;
}
}