diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2023-11-29 21:52:58 +0000 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2023-11-29 21:52:58 +0000 |
commit | 931bffbda3668ddc609fc1da8f9eb576b170aa52 (patch) | |
tree | d8c1843a95da5ea0bb4acc09f7e37843d9995c86 /src/nvim/tui/input.h | |
parent | 142d9041391780ac15b89886a54015fdc5c73995 (diff) | |
parent | 4a8bf24ac690004aedf5540fa440e788459e5e34 (diff) | |
download | rneovim-userreg.tar.gz rneovim-userreg.tar.bz2 rneovim-userreg.zip |
Merge remote-tracking branch 'upstream/master' into userreguserreg
Diffstat (limited to 'src/nvim/tui/input.h')
-rw-r--r-- | src/nvim/tui/input.h | 40 |
1 files changed, 17 insertions, 23 deletions
diff --git a/src/nvim/tui/input.h b/src/nvim/tui/input.h index 5df108b107..2743a5e286 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 <stdbool.h> #include <stdint.h> @@ -10,48 +9,43 @@ #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_defs.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 waiting; bool ttimeout; - int8_t waiting_for_bg_response; - int8_t waiting_for_csiu_response; - ExtkeysType extkeys_type; - long ttimeoutlen; + + 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 TimeWatcher timer_handle; Loop *loop; Stream read_stream; RBuffer *key_buffer; - uv_mutex_t key_buffer_mutex; - uv_cond_t key_buffer_cond; TUIData *tui_data; } TermInput; -#ifdef INCLUDE_GENERATED_DECLARATIONS -# include "tui/input.h.generated.h" -#endif - -#ifdef UNIT_TESTING typedef enum { kIncomplete = -1, kNotApplicable = 0, kComplete = 1, } HandleState; -HandleState ut_handle_background_color(TermInput *input); +#ifdef INCLUDE_GENERATED_DECLARATIONS +# include "tui/input.h.generated.h" #endif - -#endif // NVIM_TUI_INPUT_H |