0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

patch 8.2.2348: no check for modified files after focus gained

Problem:    No check for modified files after focus gained. (Mathias Stearn)
Solution:   Call ui_focus_change().
This commit is contained in:
Bram Moolenaar
2021-01-14 19:19:18 +01:00
parent e1ee58ac78
commit fadd55bd63
3 changed files with 4 additions and 14 deletions

View File

@@ -5708,30 +5708,20 @@ check_termcode(
&& key_name[0] == KS_EXTRA && key_name[0] == KS_EXTRA
) )
{ {
int did_aucmd = FALSE;
if (key_name[1] == KE_FOCUSGAINED && !focus_state) if (key_name[1] == KE_FOCUSGAINED && !focus_state)
{ {
did_aucmd = apply_autocmds(EVENT_FOCUSGAINED, ui_focus_change(TRUE);
NULL, NULL, FALSE, curbuf);
did_cursorhold = TRUE; did_cursorhold = TRUE;
focus_state = TRUE; focus_state = TRUE;
key_name[1] = (int)KE_IGNORE; key_name[1] = (int)KE_IGNORE;
} }
else if (key_name[1] == KE_FOCUSLOST && focus_state) else if (key_name[1] == KE_FOCUSLOST && focus_state)
{ {
did_aucmd = apply_autocmds(EVENT_FOCUSLOST, ui_focus_change(FALSE);
NULL, NULL, FALSE, curbuf);
did_cursorhold = TRUE; did_cursorhold = TRUE;
focus_state = FALSE; focus_state = FALSE;
key_name[1] = (int)KE_IGNORE; key_name[1] = (int)KE_IGNORE;
} }
if (did_aucmd && (State & (NORMAL | INSERT | TERMINAL)))
{
// in case a message was displayed: reposition the cursor
setcursor();
out_flush();
}
} }
#endif #endif

View File

@@ -1101,7 +1101,6 @@ check_row(int row)
return row; return row;
} }
#if defined(FEAT_GUI) || defined(MSWIN) || defined(PROTO)
/* /*
* Called when focus changed. Used for the GUI or for systems where this can * Called when focus changed. Used for the GUI or for systems where this can
* be done in the console (Win32). * be done in the console (Win32).
@@ -1164,7 +1163,6 @@ ui_focus_change(
maketitle(); maketitle();
#endif #endif
} }
#endif
#if defined(HAVE_INPUT_METHOD) || defined(PROTO) #if defined(HAVE_INPUT_METHOD) || defined(PROTO)
/* /*

View File

@@ -750,6 +750,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
2348,
/**/ /**/
2347, 2347,
/**/ /**/