comparison src/structs.h @ 30065:6cf788ab844c v9.0.0370

patch 9.0.0370: cleaning up afterwards can make a function messy Commit: https://github.com/vim/vim/commit/1d84f7608f1e41dad03b8cc7925895437775f7c0 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Sep 3 21:35:53 2022 +0100 patch 9.0.0370: cleaning up afterwards can make a function messy Problem: Cleaning up afterwards can make a function messy. Solution: Add the :defer command.
author Bram Moolenaar <Bram@vim.org>
date Sat, 03 Sep 2022 22:45:03 +0200
parents 5dfd4bd66ad8
children 458162398682
comparison
equal deleted inserted replaced
30064:a8f1fbaa43c8 30065:6cf788ab844c
1751 listitem_T l_listitems[MAX_FUNC_ARGS]; // listitems for a:000 1751 listitem_T l_listitems[MAX_FUNC_ARGS]; // listitems for a:000
1752 typval_T *rettv; // return value 1752 typval_T *rettv; // return value
1753 linenr_T breakpoint; // next line with breakpoint or zero 1753 linenr_T breakpoint; // next line with breakpoint or zero
1754 int dbg_tick; // debug_tick when breakpoint was set 1754 int dbg_tick; // debug_tick when breakpoint was set
1755 int level; // top nesting level of executed function 1755 int level; // top nesting level of executed function
1756 garray_T fc_defer; // functions to be called on return
1756 #ifdef FEAT_PROFILE 1757 #ifdef FEAT_PROFILE
1757 proftime_T prof_child; // time spent in a child 1758 proftime_T prof_child; // time spent in a child
1758 #endif 1759 #endif
1759 funccall_T *caller; // calling function or NULL; or next funccal in 1760 funccall_T *caller; // calling function or NULL; or next funccal in
1760 // list pointed to by previous_funccal. 1761 // list pointed to by previous_funccal.
1764 // funccal 1765 // funccal
1765 int fc_copyID; // for garbage collection 1766 int fc_copyID; // for garbage collection
1766 garray_T fc_funcs; // list of ufunc_T* which keep a reference to 1767 garray_T fc_funcs; // list of ufunc_T* which keep a reference to
1767 // "func" 1768 // "func"
1768 }; 1769 };
1770
1771 // structure used as item in "fc_defer"
1772 typedef struct
1773 {
1774 char_u *dr_name; // function name, allocated
1775 typval_T dr_argvars[MAX_FUNC_ARGS + 1];
1776 int dr_argcount;
1777 } defer_T;
1769 1778
1770 /* 1779 /*
1771 * Struct used by trans_function_name() 1780 * Struct used by trans_function_name()
1772 */ 1781 */
1773 typedef struct 1782 typedef struct
2848 u_header_T *b_u_curhead; // pointer to current header 2857 u_header_T *b_u_curhead; // pointer to current header
2849 int b_u_numhead; // current number of headers 2858 int b_u_numhead; // current number of headers
2850 int b_u_synced; // entry lists are synced 2859 int b_u_synced; // entry lists are synced
2851 long b_u_seq_last; // last used undo sequence number 2860 long b_u_seq_last; // last used undo sequence number
2852 long b_u_save_nr_last; // counter for last file write 2861 long b_u_save_nr_last; // counter for last file write
2853 long b_u_seq_cur; // hu_seq of header below which we are now 2862 long b_u_seq_cur; // uh_seq of header below which we are now
2854 time_T b_u_time_cur; // uh_time of header below which we are now 2863 time_T b_u_time_cur; // uh_time of header below which we are now
2855 long b_u_save_nr_cur; // file write nr after which we are now 2864 long b_u_save_nr_cur; // file write nr after which we are now
2856 2865
2857 /* 2866 /*
2858 * variables for "U" command in undo.c 2867 * variables for "U" command in undo.c