aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorgeekodour <hrishikeshbman@gmail.com>2018-04-14 19:21:22 +0530
committerJustin M. Keyes <justinkz@gmail.com>2018-04-15 15:05:02 +0200
commit1e71978cf032b4a8c3f27e11e6fbafc4fd2ab8db (patch)
tree6a38461978a3275d2674afd0ff449b97931eaece /src
parent1e7d5e8cdf9827978f42ea114cfd85f9d32b00eb (diff)
downloadrneovim-1e71978cf032b4a8c3f27e11e6fbafc4fd2ab8db.tar.gz
rneovim-1e71978cf032b4a8c3f27e11e6fbafc4fd2ab8db.tar.bz2
rneovim-1e71978cf032b4a8c3f27e11e6fbafc4fd2ab8db.zip
events: VimSuspend, VimResume #8280
closes #3648 ref #5959
Diffstat (limited to 'src')
-rw-r--r--src/nvim/auevents.lua2
-rw-r--r--src/nvim/ex_docmd.c3
2 files changed, 5 insertions, 0 deletions
diff --git a/src/nvim/auevents.lua b/src/nvim/auevents.lua
index 7dfaf54ff0..1153314e76 100644
--- a/src/nvim/auevents.lua
+++ b/src/nvim/auevents.lua
@@ -92,6 +92,8 @@ return {
'VimLeave', -- before exiting Vim
'VimLeavePre', -- before exiting Vim and writing ShaDa file
'VimResized', -- after Vim window was resized
+ 'VimResume', -- after Nvim is resumed
+ 'VimSuspend', -- before Nvim is suspended
'WinNew', -- when entering a new window
'WinEnter', -- after entering a window
'WinLeave', -- before leaving a window
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index 93cb0e50fa..7cd6dbdeca 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -6300,15 +6300,18 @@ static void ex_stop(exarg_T *eap)
if (!eap->forceit) {
autowrite_all();
}
+ apply_autocmds(EVENT_VIMSUSPEND, NULL, NULL, false, NULL);
ui_cursor_goto((int)Rows - 1, 0);
ui_linefeed();
ui_flush();
ui_call_suspend(); // call machine specific function
+
ui_flush();
maketitle();
resettitle(); // force updating the title
redraw_later_clear();
ui_refresh(); // may have resized window
+ apply_autocmds(EVENT_VIMRESUME, NULL, NULL, false, NULL);
}
}