diff options
Diffstat (limited to 'src/nvim/terminal.c')
-rw-r--r-- | src/nvim/terminal.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/nvim/terminal.c b/src/nvim/terminal.c index b5a3cffe2f..2b05a8047e 100644 --- a/src/nvim/terminal.c +++ b/src/nvim/terminal.c @@ -307,7 +307,8 @@ void terminal_open(Terminal **termpp, buf_T *buf, TerminalOptions opts) // Set up screen term->vts = vterm_obtain_screen(term->vt); vterm_screen_enable_altscreen(term->vts, true); - vterm_screen_enable_reflow(term->vts, true); + // TODO(clason): reenable when https://github.com/neovim/neovim/issues/23762 is fixed + // vterm_screen_enable_reflow(term->vts, true); // delete empty lines at the end of the buffer vterm_screen_set_callbacks(term->vts, &vterm_screen_callbacks, term); vterm_screen_set_unrecognised_fallbacks(term->vts, &vterm_fallbacks, term); @@ -542,6 +543,9 @@ bool terminal_enter(void) } else { curwin->w_p_cul = false; } + if (curwin->w_p_cuc) { + redraw_later(curwin, UPD_SOME_VALID); + } curwin->w_p_cuc = false; curwin->w_p_so = 0; curwin->w_p_siso = 0; @@ -612,7 +616,7 @@ static void terminal_check_cursor(void) row_to_linenr(term, term->cursor.row)); // Nudge cursor when returning to normal-mode. int off = is_focused(term) ? 0 : (curwin->w_p_rl ? 1 : -1); - coladvance(MAX(0, term->cursor.col + off)); + coladvance(curwin, MAX(0, term->cursor.col + off)); } // Function executed before each iteration of terminal mode. @@ -626,7 +630,7 @@ static int terminal_check(VimState *state) } terminal_check_cursor(); - validate_cursor(); + validate_cursor(curwin); if (must_redraw) { update_screen(); @@ -1627,7 +1631,10 @@ end: return false; } - ins_char_typebuf(vgetc_char, vgetc_mod_mask); + int len = ins_char_typebuf(vgetc_char, vgetc_mod_mask, true); + if (KeyTyped) { + ungetchars(len); + } return true; } |