aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/normal.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/normal.c')
-rw-r--r--src/nvim/normal.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/nvim/normal.c b/src/nvim/normal.c
index d6bc416c91..a0d2c7903d 100644
--- a/src/nvim/normal.c
+++ b/src/nvim/normal.c
@@ -3,7 +3,7 @@
*
* Do ":help uganda" in Vim to read copying and usage conditions.
* Do ":help credits" in Vim to see a list of people who contributed.
- * See README.txt for an overview of the Vim source code.
+ * See README.md for an overview of the Vim source code.
*/
/*
* normal.c: Contains the main routine for processing characters in command
@@ -12,7 +12,6 @@
*/
#include <assert.h>
-#include <errno.h>
#include <inttypes.h>
#include <string.h>
#include <stdbool.h>
@@ -349,6 +348,8 @@ static const struct nv_cmd {
{K_F8, farsi_fkey, 0, 0},
{K_F9, farsi_fkey, 0, 0},
{K_EVENT, nv_event, NV_KEEPREG, 0},
+ {K_FOCUSGAINED, nv_focusgained, NV_KEEPREG, 0},
+ {K_FOCUSLOST, nv_focuslost, NV_KEEPREG, 0},
};
/* Number of commands in nv_cmds[]. */
@@ -7715,6 +7716,18 @@ static void nv_event(cmdarg_T *cap)
cap->retval |= CA_COMMAND_BUSY; // don't call edit() now
}
+/// Trigger FocusGained event.
+static void nv_focusgained(cmdarg_T *cap)
+{
+ apply_autocmds(EVENT_FOCUSGAINED, NULL, NULL, false, curbuf);
+}
+
+/// Trigger FocusLost event.
+static void nv_focuslost(cmdarg_T *cap)
+{
+ apply_autocmds(EVENT_FOCUSLOST, NULL, NULL, false, curbuf);
+}
+
/*
* Return TRUE when 'mousemodel' is set to "popup" or "popup_setpos".
*/