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:
@@ -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)
|
||||
|
Reference in New Issue
Block a user