mirror of
https://github.com/neovim/neovim.git
synced 2025-09-07 20:08:17 +00:00
vim-patch:8.0.1564: too many #ifdefs
Problem: Too many #ifdefs.
Solution: Graduate the +autocmd feature. Takes away 450 #ifdefs and
increases code size of tiny Vim by only 40 Kbyte.
f2bd8ef2b4
This commit is contained in:
@@ -478,6 +478,8 @@ EXTERN int sc_col; // column for shown command
|
|||||||
EXTERN int starting INIT(= NO_SCREEN);
|
EXTERN int starting INIT(= NO_SCREEN);
|
||||||
// true when planning to exit. Might keep running if there is a changed buffer.
|
// true when planning to exit. Might keep running if there is a changed buffer.
|
||||||
EXTERN bool exiting INIT(= false);
|
EXTERN bool exiting INIT(= false);
|
||||||
|
// internal value of v:dying
|
||||||
|
EXTERN int v_dying INIT(= 0);
|
||||||
// is stdin a terminal?
|
// is stdin a terminal?
|
||||||
EXTERN int stdin_isatty INIT(= true);
|
EXTERN int stdin_isatty INIT(= true);
|
||||||
// is stdout a terminal?
|
// is stdout a terminal?
|
||||||
|
@@ -621,7 +621,7 @@ void getout(int exitval)
|
|||||||
/* Optionally print hashtable efficiency. */
|
/* Optionally print hashtable efficiency. */
|
||||||
hash_debug_results();
|
hash_debug_results();
|
||||||
|
|
||||||
if (get_vim_var_nr(VV_DYING) <= 1) {
|
if (v_dying <= 1) {
|
||||||
const tabpage_T *next_tp;
|
const tabpage_T *next_tp;
|
||||||
|
|
||||||
// Trigger BufWinLeave for all windows, but only once per buffer.
|
// Trigger BufWinLeave for all windows, but only once per buffer.
|
||||||
@@ -670,8 +670,9 @@ void getout(int exitval)
|
|||||||
shada_write_file(NULL, false);
|
shada_write_file(NULL, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (get_vim_var_nr(VV_DYING) <= 1)
|
if (v_dying <= 1) {
|
||||||
apply_autocmds(EVENT_VIMLEAVE, NULL, NULL, FALSE, curbuf);
|
apply_autocmds(EVENT_VIMLEAVE, NULL, NULL, false, curbuf);
|
||||||
|
}
|
||||||
|
|
||||||
profile_dump();
|
profile_dump();
|
||||||
|
|
||||||
|
@@ -157,6 +157,7 @@ static void deadly_signal(int signum)
|
|||||||
{
|
{
|
||||||
// Set the v:dying variable.
|
// Set the v:dying variable.
|
||||||
set_vim_var_nr(VV_DYING, 1);
|
set_vim_var_nr(VV_DYING, 1);
|
||||||
|
v_dying = 1;
|
||||||
|
|
||||||
WLOG("got signal %d (%s)", signum, signal_name(signum));
|
WLOG("got signal %d (%s)", signum, signal_name(signum));
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user