diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2024-03-28 07:39:36 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-28 07:39:36 +0800 |
| commit | 4ee9e58056a9d17ce921d8cc6dfd6d3305a40f69 (patch) | |
| tree | ba48366c55a17d1a3fd97f79ec738dedae64ed30 /src/nvim/tui/input.c | |
| parent | 7168000b53eb2da9a910ba038c3aa93822d3f196 (diff) | |
| download | rneovim-4ee9e58056a9d17ce921d8cc6dfd6d3305a40f69.tar.gz rneovim-4ee9e58056a9d17ce921d8cc6dfd6d3305a40f69.tar.bz2 rneovim-4ee9e58056a9d17ce921d8cc6dfd6d3305a40f69.zip | |
feat(tui): query extended underline support using DECRQSS (#28052)
Diffstat (limited to 'src/nvim/tui/input.c')
| -rw-r--r-- | src/nvim/tui/input.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/nvim/tui/input.c b/src/nvim/tui/input.c index 840e472a1c..f1594dfcb9 100644 --- a/src/nvim/tui/input.c +++ b/src/nvim/tui/input.c @@ -553,6 +553,13 @@ static void handle_term_response(TermInput *input, const TermKeyKey *key) if (termkey_interpret_string(input->tk, key, &str) == TERMKEY_RES_KEY) { assert(str != NULL); + // Handle DECRQSS SGR response for the query from tui_query_extended_underline(). + // Some terminals include "0" in the attribute list unconditionally; others don't. + if (key->type == TERMKEY_TYPE_DCS + && (strnequal(str, S_LEN("1$r4:3m")) || strnequal(str, S_LEN("1$r0;4:3m")))) { + tui_enable_extended_underline(input->tui_data); + } + // Send an event to nvim core. This will update the v:termresponse variable // and fire the TermResponse event MAXSIZE_TEMP_ARRAY(args, 2); |