diff options
Diffstat (limited to 'src/nvim/tui')
-rw-r--r-- | src/nvim/tui/input.c | 12 | ||||
-rw-r--r-- | src/nvim/tui/tui.c | 22 |
2 files changed, 18 insertions, 16 deletions
diff --git a/src/nvim/tui/input.c b/src/nvim/tui/input.c index b41e4d2fba..99eb230a88 100644 --- a/src/nvim/tui/input.c +++ b/src/nvim/tui/input.c @@ -224,9 +224,9 @@ static void tk_getkeys(TermInput *input, bool force) while ((result = tk_getkey(input->tk, &key, force)) == TERMKEY_RES_KEY) { if (key.type == TERMKEY_TYPE_UNICODE && !key.modifiers) { forward_simple_utf8(input, &key); - } else if (key.type == TERMKEY_TYPE_UNICODE || - key.type == TERMKEY_TYPE_FUNCTION || - key.type == TERMKEY_TYPE_KEYSYM) { + } else if (key.type == TERMKEY_TYPE_UNICODE + || key.type == TERMKEY_TYPE_FUNCTION + || key.type == TERMKEY_TYPE_KEYSYM) { forward_modified_utf8(input, &key); } else if (key.type == TERMKEY_TYPE_MOUSE) { forward_mouse_event(input, &key); @@ -282,9 +282,9 @@ static bool handle_focus_event(TermInput *input) static bool handle_bracketed_paste(TermInput *input) { - if (rbuffer_size(input->read_stream.buffer) > 5 && - (!rbuffer_cmp(input->read_stream.buffer, "\x1b[200~", 6) || - !rbuffer_cmp(input->read_stream.buffer, "\x1b[201~", 6))) { + if (rbuffer_size(input->read_stream.buffer) > 5 + && (!rbuffer_cmp(input->read_stream.buffer, "\x1b[200~", 6) + || !rbuffer_cmp(input->read_stream.buffer, "\x1b[201~", 6))) { bool enable = *rbuffer_get(input->read_stream.buffer, 4) == '0'; // Advance past the sequence rbuffer_consumed(input->read_stream.buffer, 6); diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 7f7d138358..202c5666a1 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -81,7 +81,7 @@ UI *tui_start(void) { UI *ui = xcalloc(1, sizeof(UI)); ui->stop = tui_stop; - ui->rgb = os_getenv("NVIM_TUI_ENABLE_TRUE_COLOR") != NULL; + ui->rgb = p_tgc; ui->resize = tui_resize; ui->clear = tui_clear; ui->eol_clear = tui_eol_clear; @@ -628,8 +628,8 @@ static void tui_suspend(UI *ui) static void tui_set_title(UI *ui, char *title) { TUIData *data = ui->data; - if (!(title && unibi_get_str(data->ut, unibi_to_status_line) && - unibi_get_str(data->ut, unibi_from_status_line))) { + if (!(title && unibi_get_str(data->ut, unibi_to_status_line) + && unibi_get_str(data->ut, unibi_from_status_line))) { return; } unibi_out(ui, unibi_to_status_line); @@ -694,8 +694,8 @@ static void update_size(UI *ui) } // 2 - try from a system call(ioctl/TIOCGWINSZ on unix) - if (data->out_isatty && - !uv_tty_get_winsize(&data->output_handle.tty, &width, &height)) { + if (data->out_isatty + && !uv_tty_get_winsize(&data->output_handle.tty, &width, &height)) { goto end; } @@ -845,7 +845,7 @@ static void fix_terminfo(TUIData *data) if ((term_prog && !strcmp(term_prog, "Konsole")) || os_getenv("KONSOLE_DBUS_SESSION") != NULL) { // Konsole uses a proprietary escape code to set the cursor shape - // and does not suppport DECSCUSR. + // and does not support DECSCUSR. data->unibi_ext.enter_insert_mode = (int)unibi_add_ext_str(ut, NULL, TMUX_WRAP("\x1b]50;CursorShape=1;BlinkingCursorEnabled=1\x07")); data->unibi_ext.enter_replace_mode = (int)unibi_add_ext_str(ut, NULL, @@ -854,13 +854,15 @@ static void fix_terminfo(TUIData *data) TMUX_WRAP("\x1b]50;CursorShape=0;BlinkingCursorEnabled=0\x07")); } else if (!vte_version || atoi(vte_version) >= 3900) { // Assume that the terminal supports DECSCUSR unless it is an - // old VTE based terminal + // old VTE based terminal. This should not get wrapped for tmux, + // which will handle it via its Ss/Se terminfo extension - usually + // according to its terminal-overrides. data->unibi_ext.enter_insert_mode = (int)unibi_add_ext_str(ut, NULL, - TMUX_WRAP("\x1b[5 q")); + "\x1b[5 q"); data->unibi_ext.enter_replace_mode = (int)unibi_add_ext_str(ut, NULL, - TMUX_WRAP("\x1b[3 q")); + "\x1b[3 q"); data->unibi_ext.exit_insert_mode = (int)unibi_add_ext_str(ut, NULL, - TMUX_WRAP("\x1b[2 q")); + "\x1b[2 q"); } end: |