aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-04-29 17:13:28 +0800
committerGitHub <noreply@github.com>2022-04-29 17:13:28 +0800
commit35a7b0f9b991e884eae81aa7393f9701b7b7b85e (patch)
tree127035623b99f2088be616fd316e162ede23e973 /src/nvim/os
parentc671822d4da5f8b772fff7acc3eae16df714e68f (diff)
parent3601cef1377937f01347b20a8c6c303f5f429f51 (diff)
downloadrneovim-35a7b0f9b991e884eae81aa7393f9701b7b7b85e.tar.gz
rneovim-35a7b0f9b991e884eae81aa7393f9701b7b7b85e.tar.bz2
rneovim-35a7b0f9b991e884eae81aa7393f9701b7b7b85e.zip
Merge pull request #17932 from zeertzjq/vim-8.1.2145
vim-patch:8.1.{2145,2159,2165,2167,2333,2346,2350},8.2.{0839,0851,0855,0867,0916,0919,2084,2728,3595,4504,4819,4824,4827,4828,4829,4833,4837}
Diffstat (limited to 'src/nvim/os')
-rw-r--r--src/nvim/os/input.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/nvim/os/input.c b/src/nvim/os/input.c
index 745b888b5e..f68a1c08c8 100644
--- a/src/nvim/os/input.c
+++ b/src/nvim/os/input.c
@@ -238,9 +238,9 @@ size_t input_enqueue(String keys)
// but since the keys are UTF-8, so the first byte cannot be
// K_SPECIAL(0x80).
uint8_t buf[19] = { 0 };
+ // Do not simplify the keys here. Simplification will be done later.
unsigned int new_size
- = trans_special((const uint8_t **)&ptr, (size_t)(end - ptr), buf, true,
- false);
+ = trans_special((const uint8_t **)&ptr, (size_t)(end - ptr), buf, FSK_KEYCODE, NULL);
if (new_size) {
new_size = handle_mouse_event(&ptr, buf, new_size);
@@ -488,7 +488,12 @@ static void process_interrupts(void)
size_t consume_count = 0;
RBUFFER_EACH_REVERSE(input_buffer, c, i) {
- if ((uint8_t)c == Ctrl_C) {
+ if ((uint8_t)c == Ctrl_C
+ || ((uint8_t)c == 'C' && i >= 3
+ && (uint8_t)(*rbuffer_get(input_buffer, i - 3)) == K_SPECIAL
+ && (uint8_t)(*rbuffer_get(input_buffer, i - 2)) == KS_MODIFIER
+ && (uint8_t)(*rbuffer_get(input_buffer, i - 1)) == MOD_MASK_CTRL)) {
+ *rbuffer_get(input_buffer, i) = Ctrl_C;
got_int = true;
consume_count = i;
break;