aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os/input.c
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2024-05-24 19:18:11 +0000
committerJosh Rahm <joshuarahm@gmail.com>2024-05-24 19:18:11 +0000
commitff7ed8f586589d620a806c3758fac4a47a8e7e15 (patch)
tree729bbcb92231538fa61dab6c3d890b025484b7f5 /src/nvim/os/input.c
parent376914f419eb08fdf4c1a63a77e1f035898a0f10 (diff)
parent28c04948a1c887a1cc0cb64de79fa32631700466 (diff)
downloadrneovim-ff7ed8f586589d620a806c3758fac4a47a8e7e15.tar.gz
rneovim-ff7ed8f586589d620a806c3758fac4a47a8e7e15.tar.bz2
rneovim-ff7ed8f586589d620a806c3758fac4a47a8e7e15.zip
Merge remote-tracking branch 'upstream/master' into mix_20240309
Diffstat (limited to 'src/nvim/os/input.c')
-rw-r--r--src/nvim/os/input.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/nvim/os/input.c b/src/nvim/os/input.c
index fab360c9af..60b5b48745 100644
--- a/src/nvim/os/input.c
+++ b/src/nvim/os/input.c
@@ -247,6 +247,13 @@ bool os_isatty(int fd)
return uv_guess_handle(fd) == UV_TTY;
}
+void input_enqueue_raw(String keys)
+{
+ if (keys.size > 0) {
+ rbuffer_write(input_buffer, keys.data, keys.size);
+ }
+}
+
size_t input_enqueue(String keys)
{
const char *ptr = keys.data;
@@ -255,9 +262,9 @@ size_t input_enqueue(String keys)
while (rbuffer_space(input_buffer) >= 19 && ptr < end) {
// A "<x>" form occupies at least 1 characters, and produces up
// to 19 characters (1 + 5 * 3 for the char and 3 for a modifier).
- // In the case of K_SPECIAL(0x80), 3 bytes are escaped and needed,
+ // In the case of K_SPECIAL (0x80), 3 bytes are escaped and needed,
// but since the keys are UTF-8, so the first byte cannot be
- // K_SPECIAL(0x80).
+ // K_SPECIAL (0x80).
uint8_t buf[19] = { 0 };
// Do not simplify the keys here. Simplification will be done later.
unsigned new_size
@@ -351,8 +358,7 @@ static uint8_t check_multiclick(int code, int grid, int row, int col)
return modifiers;
}
-// Mouse event handling code(Extract row/col if available and detect multiple
-// clicks)
+/// Mouse event handling code (extract row/col if available and detect multiple clicks)
static unsigned handle_mouse_event(const char **ptr, uint8_t *buf, unsigned bufsize)
{
int mouse_code = 0;