summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-01-14 19:19:18 +0100
committerBram Moolenaar <Bram@vim.org>2021-01-14 19:19:18 +0100
commitfadd55bd633b3b84d41a691e953f569bb6c21689 (patch)
treedb8eb08015ef089af1622686aeac207f802b3e65
parente1ee58ac788508585f60c91fcf6629e2251a9220 (diff)
downloadvim-git-8.2.2348.tar.gz
patch 8.2.2348: no check for modified files after focus gainedv8.2.2348
Problem: No check for modified files after focus gained. (Mathias Stearn) Solution: Call ui_focus_change().
-rw-r--r--src/term.c14
-rw-r--r--src/ui.c2
-rw-r--r--src/version.c2
3 files changed, 4 insertions, 14 deletions
diff --git a/src/term.c b/src/term.c
index f4f54e2a5..d3d0581d6 100644
--- a/src/term.c
+++ b/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
diff --git a/src/ui.c b/src/ui.c
index ed565276c..3f4304f69 100644
--- a/src/ui.c
+++ b/src/ui.c
@@ -1101,7 +1101,6 @@ check_row(int 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
* be done in the console (Win32).
@@ -1164,7 +1163,6 @@ ui_focus_change(
maketitle();
#endif
}
-#endif
#if defined(HAVE_INPUT_METHOD) || defined(PROTO)
/*
diff --git a/src/version.c b/src/version.c
index 319e65eb4..cfc929073 100644
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 2348,
+/**/
2347,
/**/
2346,