0
0
mirror of https://github.com/vim/vim.git synced 2025-09-29 04:34:16 -04:00

patch 8.2.2070: can't get the exit value in VimLeave(Pre) autocommands

Problem:    Can't get the exit value in VimLeave or VimLeavePre autocommands.
Solution:   Add v:exiting like in Neovim. (Yegappan Lakshmanan, closes #7395)
This commit is contained in:
Bram Moolenaar
2020-11-30 17:42:10 +01:00
parent 23515b4ef7
commit f0068c5154
7 changed files with 49 additions and 2 deletions

View File

@@ -1505,7 +1505,8 @@ getout_preserve_modified(int exitval)
/*
* Exit properly.
* Exit properly. This is the only way to exit Vim after startup has
* succeeded. We are certain to exit here, no way to abort it.
*/
void
getout(int exitval)
@@ -1521,6 +1522,11 @@ getout(int exitval)
if (exmode_active)
exitval += ex_exitval;
#ifdef FEAT_EVAL
set_vim_var_type(VV_EXITING, VAR_NUMBER);
set_vim_var_nr(VV_EXITING, exitval);
#endif
// Position the cursor on the last screen line, below all the text
#ifdef FEAT_GUI
if (!gui.in_use)