diff options
author | Florian Larysch <fl@n621.de> | 2017-12-05 21:18:30 +0100 |
---|---|---|
committer | Florian Larysch <fl@n621.de> | 2017-12-05 21:40:37 +0100 |
commit | 54087d80f3603165c0bdeab9f14c9aba2ddb6c67 (patch) | |
tree | de0938ee25cdd8330cc480eac24e09dee9ae96eb | |
parent | 90dd2b1473cf19a6467838dbae078eea4bdc3c61 (diff) | |
download | rneovim-54087d80f3603165c0bdeab9f14c9aba2ddb6c67.tar.gz rneovim-54087d80f3603165c0bdeab9f14c9aba2ddb6c67.tar.bz2 rneovim-54087d80f3603165c0bdeab9f14c9aba2ddb6c67.zip |
tui: always hide cursor when flushing
The previous commit ensures that we can never flush the buffer in a
state where toggling cursor visibility can corrupt other escape codes.
Thus, we can remove the workaround added as part of e838452, simplyfing
the code and hiding the cursor on more occasions.
-rw-r--r-- | src/nvim/tui/tui.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index d07eb9a923..61d3bde450 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -297,7 +297,7 @@ static void terminfo_stop(UI *ui) unibi_out_ext(ui, data->unibi_ext.disable_bracketed_paste); // Disable focus reporting unibi_out_ext(ui, data->unibi_ext.disable_focus_reporting); - flush_buf(ui, true); + flush_buf(ui); uv_tty_reset_mode(); uv_close((uv_handle_t *)&data->output_handle, NULL); uv_run(&data->write_loop, UV_RUN_DEFAULT); @@ -1061,7 +1061,7 @@ static void tui_flush(UI *ui) cursor_goto(ui, saved_row, saved_col); - flush_buf(ui, true); + flush_buf(ui); } #ifdef UNIX @@ -1230,7 +1230,7 @@ retry: \ unibi_format(vars, vars + 26, str, data->params, out, ui, NULL, NULL); \ if (data->overflow) { \ data->bufpos = orig_pos; \ - flush_buf(ui, true); \ + flush_buf(ui); \ goto retry; \ } \ data->cork = false; \ @@ -1261,7 +1261,7 @@ static void out(void *ctx, const char *str, size_t len) data->overflow = true; return; } else { - flush_buf(ui, true); + flush_buf(ui); } } @@ -1679,7 +1679,7 @@ static void augment_terminfo(TUIData *data, const char *term, "\x1b[?1002l\x1b[?1006l"); } -static void flush_buf(UI *ui, bool toggle_cursor) +static void flush_buf(UI *ui) { uv_write_t req; uv_buf_t bufs[3]; @@ -1690,7 +1690,7 @@ static void flush_buf(UI *ui, bool toggle_cursor) return; } - if (toggle_cursor && !data->is_invisible) { + if (!data->is_invisible) { // cursor is visible. Write a "cursor invisible" command before writing the // buffer. bufp->base = data->invis; @@ -1705,7 +1705,7 @@ static void flush_buf(UI *ui, bool toggle_cursor) bufp++; } - if (toggle_cursor && !data->busy && data->is_invisible) { + if (!data->busy && data->is_invisible) { // not busy and the cursor is invisible. Write a "cursor normal" command // after writing the buffer. bufp->base = data->norm; |