]> granicus.if.org Git - vim/commitdiff
patch 8.2.2348: no check for modified files after focus gained v8.2.2348
authorBram Moolenaar <Bram@vim.org>
Thu, 14 Jan 2021 18:19:18 +0000 (19:19 +0100)
committerBram Moolenaar <Bram@vim.org>
Thu, 14 Jan 2021 18:19:18 +0000 (19:19 +0100)
Problem:    No check for modified files after focus gained. (Mathias Stearn)
Solution:   Call ui_focus_change().

src/term.c
src/ui.c
src/version.c

index f4f54e2a5a44c7e58d4823be97e60aad95efdcf7..d3d0581d663c01b7ffe5345ea98c713d89349129 100644 (file)
@@ -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
 
index ed565276c8c52fa015c720e231b7752220fb74fb..3f4304f6921189076a729abd6b4c0cdd49ed3cf3 100644 (file)
--- 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)
 /*
index 319e65eb4b98807e65ecb8e02bce16b065f1928f..cfc929073a1d8b4750fa46f5fbe5a63ce0831f50 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2348,
 /**/
     2347,
 /**/