summaryrefslogtreecommitdiffstats
path: root/src/ui.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-12-09 10:51:05 +0000
committerBram Moolenaar <Bram@vim.org>2021-12-09 10:51:05 +0000
commite50507126f532a0b0ae65e201a6372b7ea5b0ccd (patch)
tree91e6c7e0409133dfd761059f03055320e3659cdc /src/ui.c
parent56150da6879a96db1c84c7ec4ceedeb84969f606 (diff)
patch 8.2.3763: when editing the cmdline a callback may cause a scroll upv8.2.3763
Problem: When editing the command line a FocusLost callback may cause the screen to scroll up. Solution: Do not redraw at the last line but at the same place where the command line was before. (closes #9295)
Diffstat (limited to 'src/ui.c')
-rw-r--r--src/ui.c24
1 files changed, 1 insertions, 23 deletions
diff --git a/src/ui.c b/src/ui.c
index 906d88f299..8cbe49bde4 100644
--- a/src/ui.c
+++ b/src/ui.c
@@ -1156,29 +1156,7 @@ ui_focus_change(
: EVENT_FOCUSLOST, NULL, NULL, FALSE, curbuf);
if (need_redraw)
- {
- // Something was executed, make sure the cursor is put back where it
- // belongs.
- need_wait_return = FALSE;
-
- if (State & CMDLINE)
- redrawcmdline();
- else if (State == HITRETURN || State == SETWSIZE || State == ASKMORE
- || State == EXTERNCMD || State == CONFIRM || exmode_active)
- repeat_message();
- else if ((State & NORMAL) || (State & INSERT))
- {
- if (must_redraw != 0)
- update_screen(0);
- setcursor();
- }
- cursor_on(); // redrawing may have switched it off
- out_flush_cursor(FALSE, TRUE);
-# ifdef FEAT_GUI
- if (gui.in_use)
- gui_update_scrollbars(FALSE);
-# endif
- }
+ redraw_after_callback(TRUE, TRUE);
// File may have been changed from 'readonly' to 'noreadonly'
if (need_maketitle)