From 286777c3335d9a4d2c30bfda23ba507fead02aee Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Tue, 21 Feb 2023 08:01:16 +0800 Subject: refactor(tui/input.c): remove unused multithreading code (#22342) --- src/nvim/tui/input.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'src/nvim/tui/input.h') diff --git a/src/nvim/tui/input.h b/src/nvim/tui/input.h index d33cea6383..da565fbb6f 100644 --- a/src/nvim/tui/input.h +++ b/src/nvim/tui/input.h @@ -23,7 +23,6 @@ typedef struct term_input { int in_fd; // Phases: -1=all 0=disabled 1=first-chunk 2=continue 3=last-chunk int8_t paste; - bool waiting; bool ttimeout; int8_t waiting_for_bg_response; int8_t waiting_for_csiu_response; @@ -35,8 +34,6 @@ typedef struct term_input { Loop *loop; Stream read_stream; RBuffer *key_buffer; - uv_mutex_t key_buffer_mutex; - uv_cond_t key_buffer_cond; TUIData *tui_data; } TermInput; -- cgit From af7d317f3ff31d5ac5d8724b5057a422e1451b54 Mon Sep 17 00:00:00 2001 From: dundargoc Date: Tue, 26 Sep 2023 22:36:08 +0200 Subject: refactor: remove long long is 32-bits even on 64-bit windows which makes the type suboptimal for a codebase meant to be cross-platform. --- src/nvim/tui/input.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/tui/input.h') diff --git a/src/nvim/tui/input.h b/src/nvim/tui/input.h index da565fbb6f..5c0181362b 100644 --- a/src/nvim/tui/input.h +++ b/src/nvim/tui/input.h @@ -27,7 +27,7 @@ typedef struct term_input { int8_t waiting_for_bg_response; int8_t waiting_for_csiu_response; ExtkeysType extkeys_type; - long ttimeoutlen; + OptInt ttimeoutlen; TermKey *tk; TermKey_Terminfo_Getstr_Hook *tk_ti_hook_fn; ///< libtermkey terminfo hook TimeWatcher timer_handle; -- cgit From cf8b2c0e74fd5e723b0c15c2ce84e6900fd322d3 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 30 Sep 2023 12:05:28 +0800 Subject: build(iwyu): add a few more _defs.h mappings (#25435) --- src/nvim/tui/input.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/nvim/tui/input.h') diff --git a/src/nvim/tui/input.h b/src/nvim/tui/input.h index 5c0181362b..f631860e74 100644 --- a/src/nvim/tui/input.h +++ b/src/nvim/tui/input.h @@ -12,6 +12,7 @@ #include "nvim/rbuffer.h" #include "nvim/tui/input_defs.h" #include "nvim/tui/tui.h" +#include "nvim/types.h" typedef enum { kExtkeysNone, -- cgit From 4f8941c1a5f1ef6caa410feeb52e343db22763ce Mon Sep 17 00:00:00 2001 From: dundargoc Date: Fri, 10 Nov 2023 12:23:42 +0100 Subject: refactor: replace manual header guards with #pragma once It is less error-prone than manually defining header guards. Pretty much all compilers support it even if it's not part of the C standard. --- src/nvim/tui/input.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/nvim/tui/input.h') diff --git a/src/nvim/tui/input.h b/src/nvim/tui/input.h index f631860e74..8b4d1ba74b 100644 --- a/src/nvim/tui/input.h +++ b/src/nvim/tui/input.h @@ -1,5 +1,4 @@ -#ifndef NVIM_TUI_INPUT_H -#define NVIM_TUI_INPUT_H +#pragma once #include #include @@ -47,5 +46,3 @@ typedef enum { #ifdef INCLUDE_GENERATED_DECLARATIONS # include "tui/input.h.generated.h" #endif - -#endif // NVIM_TUI_INPUT_H -- cgit From ab102f188e86bdbfce1d4de2ef633092a906e8fe Mon Sep 17 00:00:00 2001 From: Gregory Anders Date: Mon, 6 Nov 2023 15:46:44 -0600 Subject: refactor: move background color detection into Lua --- src/nvim/tui/input.h | 1 - 1 file changed, 1 deletion(-) (limited to 'src/nvim/tui/input.h') diff --git a/src/nvim/tui/input.h b/src/nvim/tui/input.h index 8b4d1ba74b..01514269be 100644 --- a/src/nvim/tui/input.h +++ b/src/nvim/tui/input.h @@ -24,7 +24,6 @@ typedef struct term_input { // Phases: -1=all 0=disabled 1=first-chunk 2=continue 3=last-chunk int8_t paste; bool ttimeout; - int8_t waiting_for_bg_response; int8_t waiting_for_csiu_response; ExtkeysType extkeys_type; OptInt ttimeoutlen; -- cgit From 89dd939c154d11a7bbb41ac5defb87b13ca10b60 Mon Sep 17 00:00:00 2001 From: Gregory Anders Date: Wed, 1 Nov 2023 08:24:35 -0500 Subject: refactor(tui): refactor Kitty keyboard query implementation Refactor our implementation of querying for Kitty keyboard protocol support: - Remove usage of the "extkeys" term. This is not standard or really used elsewhere. Use "key encoding" instead - Replace usages of "CSIu" with "Kitty". "Kitty keyboard protocol" is vastly more common than "CSIu" now - Replace the countdown response counter with a simple boolean flag. We don't actually need a countdown counter because we request the primary device attributes along with the Kitty keyboard query, so we will always receive a "terminating event", making a countdown/timer unnecessary - Move the CSI response handling into a dedicated function - Bypass Unibilium for sending key encoding escape sequences. These sequences are not part of terminfo and do not have any parameters, so there's no reason to go through Unibilium --- src/nvim/tui/input.h | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'src/nvim/tui/input.h') diff --git a/src/nvim/tui/input.h b/src/nvim/tui/input.h index 01514269be..2d72d1978c 100644 --- a/src/nvim/tui/input.h +++ b/src/nvim/tui/input.h @@ -14,18 +14,22 @@ #include "nvim/types.h" typedef enum { - kExtkeysNone, - kExtkeysCSIu, - kExtkeysXterm, -} ExtkeysType; + kKeyEncodingLegacy, ///< Legacy key encoding + kKeyEncodingKitty, ///< Kitty keyboard protocol encoding + kKeyEncodingXterm, ///< Xterm's modifyOtherKeys encoding (XTMODKEYS) +} KeyEncoding; -typedef struct term_input { +typedef struct { int in_fd; // Phases: -1=all 0=disabled 1=first-chunk 2=continue 3=last-chunk int8_t paste; bool ttimeout; - int8_t waiting_for_csiu_response; - ExtkeysType extkeys_type; + + bool waiting_for_kkp_response; ///< True if we are expecting to receive a response to a query for + ///< Kitty keyboard protocol support + + KeyEncoding key_encoding; ///< The key encoding used by the terminal emulator + OptInt ttimeoutlen; TermKey *tk; TermKey_Terminfo_Getstr_Hook *tk_ti_hook_fn; ///< libtermkey terminfo hook -- cgit From 09541d514dd18bf86f673d3784d406236fcbdad8 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 27 Nov 2023 09:51:26 +0800 Subject: build(IWYU): replace public-to-public mappings with pragmas (#26237) --- src/nvim/tui/input.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/tui/input.h') diff --git a/src/nvim/tui/input.h b/src/nvim/tui/input.h index 2d72d1978c..2474e1b9b4 100644 --- a/src/nvim/tui/input.h +++ b/src/nvim/tui/input.h @@ -9,7 +9,7 @@ #include "nvim/event/stream.h" #include "nvim/event/time.h" #include "nvim/rbuffer.h" -#include "nvim/tui/input_defs.h" +#include "nvim/tui/input_defs.h" // IWYU pragma: export #include "nvim/tui/tui.h" #include "nvim/types.h" -- cgit From 6c14ae6bfaf51415b555e9a6b85d1d280976358d Mon Sep 17 00:00:00 2001 From: dundargoc Date: Mon, 27 Nov 2023 20:27:32 +0100 Subject: refactor: rename types.h to types_defs.h --- src/nvim/tui/input.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/tui/input.h') diff --git a/src/nvim/tui/input.h b/src/nvim/tui/input.h index 2474e1b9b4..2743a5e286 100644 --- a/src/nvim/tui/input.h +++ b/src/nvim/tui/input.h @@ -11,7 +11,7 @@ #include "nvim/rbuffer.h" #include "nvim/tui/input_defs.h" // IWYU pragma: export #include "nvim/tui/tui.h" -#include "nvim/types.h" +#include "nvim/types_defs.h" typedef enum { kKeyEncodingLegacy, ///< Legacy key encoding -- cgit