aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nvim/tui/input.c4
-rw-r--r--src/nvim/tui/tui.c60
2 files changed, 32 insertions, 32 deletions
diff --git a/src/nvim/tui/input.c b/src/nvim/tui/input.c
index 214474ff51..840e472a1c 100644
--- a/src/nvim/tui/input.c
+++ b/src/nvim/tui/input.c
@@ -442,12 +442,12 @@ static void tk_getkeys(TermInput *input, bool force)
forward_modified_utf8(input, &key);
} else if (key.type == TERMKEY_TYPE_MOUSE) {
forward_mouse_event(input, &key);
+ } else if (key.type == TERMKEY_TYPE_MODEREPORT) {
+ handle_modereport(input, &key);
} else if (key.type == TERMKEY_TYPE_UNKNOWN_CSI) {
handle_unknown_csi(input, &key);
} else if (key.type == TERMKEY_TYPE_OSC || key.type == TERMKEY_TYPE_DCS) {
handle_term_response(input, &key);
- } else if (key.type == TERMKEY_TYPE_MODEREPORT) {
- handle_modereport(input, &key);
}
}
diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c
index 1edcde5341..96054cf5cb 100644
--- a/src/nvim/tui/tui.c
+++ b/src/nvim/tui/tui.c
@@ -189,36 +189,6 @@ void tui_start(TUIData **tui_p, int *width, int *height, char **term, bool *rgb)
*rgb = tui->rgb;
}
-void tui_set_key_encoding(TUIData *tui)
- FUNC_ATTR_NONNULL_ALL
-{
- switch (tui->input.key_encoding) {
- case kKeyEncodingKitty:
- out(tui, S_LEN("\x1b[>1u"));
- break;
- case kKeyEncodingXterm:
- out(tui, S_LEN("\x1b[>4;2m"));
- break;
- case kKeyEncodingLegacy:
- break;
- }
-}
-
-static void tui_reset_key_encoding(TUIData *tui)
- FUNC_ATTR_NONNULL_ALL
-{
- switch (tui->input.key_encoding) {
- case kKeyEncodingKitty:
- out(tui, S_LEN("\x1b[<1u"));
- break;
- case kKeyEncodingXterm:
- out(tui, S_LEN("\x1b[>4;0m"));
- break;
- case kKeyEncodingLegacy:
- break;
- }
-}
-
/// Request the terminal's mode (DECRQM).
///
/// @see handle_modereport
@@ -270,6 +240,36 @@ static void tui_query_kitty_keyboard(TUIData *tui)
out(tui, S_LEN("\x1b[?u\x1b[c"));
}
+void tui_set_key_encoding(TUIData *tui)
+ FUNC_ATTR_NONNULL_ALL
+{
+ switch (tui->input.key_encoding) {
+ case kKeyEncodingKitty:
+ out(tui, S_LEN("\x1b[>1u"));
+ break;
+ case kKeyEncodingXterm:
+ out(tui, S_LEN("\x1b[>4;2m"));
+ break;
+ case kKeyEncodingLegacy:
+ break;
+ }
+}
+
+static void tui_reset_key_encoding(TUIData *tui)
+ FUNC_ATTR_NONNULL_ALL
+{
+ switch (tui->input.key_encoding) {
+ case kKeyEncodingKitty:
+ out(tui, S_LEN("\x1b[<1u"));
+ break;
+ case kKeyEncodingXterm:
+ out(tui, S_LEN("\x1b[>4;0m"));
+ break;
+ case kKeyEncodingLegacy:
+ break;
+ }
+}
+
/// Enable the alternate screen and emit other control sequences to start the TUI.
///
/// This is also called when the TUI is resumed after being suspended. We reinitialize all state