mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
patch 8.2.3763: when editing the cmdline a callback may cause a scroll up
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)
This commit is contained in:
24
src/ui.c
24
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)
|
||||
|
Reference in New Issue
Block a user