commit 4f235e3cafba5dc305aa0be33cdec093e9c5a92d
parent 727ec8d59d64987ff0ac5ccbc67d666a6afe11a6
Author: zeertzjq <zeertzjq@outlook.com>
Date: Fri, 28 Apr 2023 20:26:02 +0800
fix(tui): position cursor at bottom-left before stopping (#23369)
Fix #23361
Diffstat:
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/src/nvim/main.c b/src/nvim/main.c
@@ -685,9 +685,6 @@ void getout(int exitval)
set_vim_var_nr(VV_EXITING, exitval);
- // Position the cursor on the last screen line, below all the text
- ui_cursor_goto(Rows - 1, 0);
-
// Invoked all deferred functions in the function stack.
invoke_all_defer();
@@ -776,9 +773,6 @@ void getout(int exitval)
wait_return(false);
}
- // Position the cursor again, the autocommands may have moved it
- ui_cursor_goto(Rows - 1, 0);
-
// Apply 'titleold'.
if (p_title && *p_titleold != NUL) {
ui_call_set_title(cstr_as_string(p_titleold));
diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c
@@ -437,6 +437,8 @@ static void tui_terminal_stop(TUIData *tui)
}
tinput_stop(&tui->input);
signal_watcher_stop(&tui->winch_handle);
+ // Position the cursor on the last screen line, below all the text
+ cursor_goto(tui, tui->height - 1, 0);
terminfo_stop(tui);
}