summaryrefslogtreecommitdiff
path: root/src/structs.h
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-09-03 21:35:53 +0100
committerBram Moolenaar <Bram@vim.org>2022-09-03 21:35:53 +0100
commit1d84f7608f1e41dad03b8cc7925895437775f7c0 (patch)
treecc276825566021a35b96f93e178e5f2ac621a84b /src/structs.h
parent06d32a0c177e4166ff0491668cd459464bc2ef45 (diff)
downloadvim-git-1d84f7608f1e41dad03b8cc7925895437775f7c0.tar.gz
patch 9.0.0370: cleaning up afterwards can make a function messyv9.0.0370
Problem: Cleaning up afterwards can make a function messy. Solution: Add the :defer command.
Diffstat (limited to 'src/structs.h')
-rw-r--r--src/structs.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/structs.h b/src/structs.h
index b8627dddf..8fab297b5 100644
--- a/src/structs.h
+++ b/src/structs.h
@@ -1753,6 +1753,7 @@ struct funccall_S
linenr_T breakpoint; // next line with breakpoint or zero
int dbg_tick; // debug_tick when breakpoint was set
int level; // top nesting level of executed function
+ garray_T fc_defer; // functions to be called on return
#ifdef FEAT_PROFILE
proftime_T prof_child; // time spent in a child
#endif
@@ -1767,6 +1768,14 @@ struct funccall_S
// "func"
};
+// structure used as item in "fc_defer"
+typedef struct
+{
+ char_u *dr_name; // function name, allocated
+ typval_T dr_argvars[MAX_FUNC_ARGS + 1];
+ int dr_argcount;
+} defer_T;
+
/*
* Struct used by trans_function_name()
*/
@@ -2850,7 +2859,7 @@ struct file_buffer
int b_u_synced; // entry lists are synced
long b_u_seq_last; // last used undo sequence number
long b_u_save_nr_last; // counter for last file write
- long b_u_seq_cur; // hu_seq of header below which we are now
+ long b_u_seq_cur; // uh_seq of header below which we are now
time_T b_u_time_cur; // uh_time of header below which we are now
long b_u_save_nr_cur; // file write nr after which we are now