forked from aniani/vim
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:
14
src/term.c
14
src/term.c
@@ -5708,30 +5708,20 @@ check_termcode(
|
||||
&& key_name[0] == KS_EXTRA
|
||||
)
|
||||
{
|
||||
int did_aucmd = FALSE;
|
||||
|
||||
if (key_name[1] == KE_FOCUSGAINED && !focus_state)
|
||||
{
|
||||
did_aucmd = apply_autocmds(EVENT_FOCUSGAINED,
|
||||
NULL, NULL, FALSE, curbuf);
|
||||
ui_focus_change(TRUE);
|
||||
did_cursorhold = TRUE;
|
||||
focus_state = TRUE;
|
||||
key_name[1] = (int)KE_IGNORE;
|
||||
}
|
||||
else if (key_name[1] == KE_FOCUSLOST && focus_state)
|
||||
{
|
||||
did_aucmd = apply_autocmds(EVENT_FOCUSLOST,
|
||||
NULL, NULL, FALSE, curbuf);
|
||||
ui_focus_change(FALSE);
|
||||
did_cursorhold = TRUE;
|
||||
focus_state = FALSE;
|
||||
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
|
||||
|
||||
|
Reference in New Issue
Block a user