aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/getchar.c2
-rw-r--r--src/nvim/highlight_group.c2
-rw-r--r--src/nvim/lua/executor.c2
-rw-r--r--src/nvim/os/input.c4
4 files changed, 6 insertions, 4 deletions
diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c
index 2a5b8b00d4..0a848c4676 100644
--- a/src/nvim/getchar.c
+++ b/src/nvim/getchar.c
@@ -1122,6 +1122,8 @@ static void gotchars(const uint8_t *chars, size_t len)
pending--;
}
+ // When receiving a special key sequence, store it until we have all
+ // the bytes and we can decide what to do with it.
if ((pending == 0 || in_mbyte) && c == K_SPECIAL) {
pending += 2;
if (!in_mbyte) {
diff --git a/src/nvim/highlight_group.c b/src/nvim/highlight_group.c
index f4800deb90..ca8c2999e1 100644
--- a/src/nvim/highlight_group.c
+++ b/src/nvim/highlight_group.c
@@ -1914,7 +1914,7 @@ static void set_hl_attr(int idx)
at_en.cterm_bg_color = (int16_t)sgp->sg_cterm_bg;
at_en.rgb_ae_attr = (int16_t)sgp->sg_gui;
// FIXME(tarruda): The "unset value" for rgb is -1, but since hlgroup is
- // initialized with 0(by garray functions), check for sg_rgb_{f,b}g_name
+ // initialized with 0 (by garray functions), check for sg_rgb_{f,b}g_name
// before setting attr_entry->{f,g}g_color to a other than -1
at_en.rgb_fg_color = sgp->sg_rgb_fg_idx != kColorIdxNone ? sgp->sg_rgb_fg : -1;
at_en.rgb_bg_color = sgp->sg_rgb_bg_idx != kColorIdxNone ? sgp->sg_rgb_bg : -1;
diff --git a/src/nvim/lua/executor.c b/src/nvim/lua/executor.c
index d5d35c5295..9e4b698b69 100644
--- a/src/nvim/lua/executor.c
+++ b/src/nvim/lua/executor.c
@@ -2066,7 +2066,7 @@ char *nlua_register_table_as_callable(const typval_T *const arg)
void nlua_execute_on_key(int c)
{
- char buf[NUMBUFLEN];
+ char buf[MB_MAXBYTES * 3 + 4];
size_t buf_len = special_to_buf(c, mod_mask, false, buf);
lua_State *const lstate = global_lstate;
diff --git a/src/nvim/os/input.c b/src/nvim/os/input.c
index baa99fca65..5218e50df6 100644
--- a/src/nvim/os/input.c
+++ b/src/nvim/os/input.c
@@ -255,9 +255,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