comparison src/structs.h @ 14700:0a3b9ecf7cb8 v8.1.0362

patch 8.1.0362: cannot get the script line number when executing a function commit https://github.com/vim/vim/commit/f29c1c6aa3f365c025890fab5fb9efbe88eb1761 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Sep 10 21:05:02 2018 +0200 patch 8.1.0362: cannot get the script line number when executing a function Problem: Cannot get the script line number when executing a function. Solution: Store the line number besides the script ID. (Ozaki Kiichi, closes #3362) Also display the line number with ":verbose set".
author Christian Brabandt <cb@256bit.org>
date Mon, 10 Sep 2018 21:15:07 +0200
parents 195e8b1fcbbf
children 1ae9c8a1b3bf
comparison
equal deleted inserted replaced
14699:2d2a36710dad 14700:0a3b9ecf7cb8
71 typedef struct terminal_S term_T; 71 typedef struct terminal_S term_T;
72 72
73 #ifdef FEAT_MENU 73 #ifdef FEAT_MENU
74 typedef struct VimMenu vimmenu_T; 74 typedef struct VimMenu vimmenu_T;
75 #endif 75 #endif
76
77 /*
78 * SCript ConteXt (SCTX): identifies a script script line.
79 * When sourcing a script "sc_lnum" is zero, "sourcing_lnum" is the current
80 * line number. When executing a user function "sc_lnum" is the line where the
81 * function was defined, "sourcing_lnum" is the line number inside the
82 * function. When stored with a function, mapping, option, etc. "sc_lnum" is
83 * the line number in the script "sc_sid".
84 */
85 typedef struct {
86 scid_T sc_sid; // script ID
87 linenr_T sc_lnum; // line number
88 } sctx_T;
76 89
77 /* 90 /*
78 * Reference to a buffer that stores the value of buf_free_count. 91 * Reference to a buffer that stores the value of buf_free_count.
79 * bufref_valid() only needs to check "buf" when the count differs. 92 * bufref_valid() only needs to check "buf" when the count differs.
80 */ 93 */
276 char_u *wo_tws; 289 char_u *wo_tws;
277 # define w_p_tws w_onebuf_opt.wo_tws /* 'termwinsize' */ 290 # define w_p_tws w_onebuf_opt.wo_tws /* 'termwinsize' */
278 #endif 291 #endif
279 292
280 #ifdef FEAT_EVAL 293 #ifdef FEAT_EVAL
281 int wo_scriptID[WV_COUNT]; /* SIDs for window-local options */ 294 sctx_T wo_script_ctx[WV_COUNT]; /* SCTXs for window-local options */
282 # define w_p_scriptID w_onebuf_opt.wo_scriptID 295 # define w_p_script_ctx w_onebuf_opt.wo_script_ctx
283 #endif 296 #endif
284 } winopt_T; 297 } winopt_T;
285 298
286 /* 299 /*
287 * Window info stored with a buffer. 300 * Window info stored with a buffer.
539 int xp_context; /* type of expansion */ 552 int xp_context; /* type of expansion */
540 char_u *xp_pattern; /* start of item to expand */ 553 char_u *xp_pattern; /* start of item to expand */
541 int xp_pattern_len; /* bytes in xp_pattern before cursor */ 554 int xp_pattern_len; /* bytes in xp_pattern before cursor */
542 #if defined(FEAT_USR_CMDS) && defined(FEAT_EVAL) && defined(FEAT_CMDL_COMPL) 555 #if defined(FEAT_USR_CMDS) && defined(FEAT_EVAL) && defined(FEAT_CMDL_COMPL)
543 char_u *xp_arg; /* completion function */ 556 char_u *xp_arg; /* completion function */
544 int xp_scriptID; /* SID for completion function */ 557 sctx_T xp_script_ctx; /* SCTX for completion function */
545 #endif 558 #endif
546 int xp_backslash; /* one of the XP_BS_ values */ 559 int xp_backslash; /* one of the XP_BS_ values */
547 #ifndef BACKSLASH_IN_FILENAME 560 #ifndef BACKSLASH_IN_FILENAME
548 int xp_shell; /* TRUE for a shell command, more 561 int xp_shell; /* TRUE for a shell command, more
549 characters need to be escaped */ 562 characters need to be escaped */
1069 int m_noremap; /* if non-zero no re-mapping for m_str */ 1082 int m_noremap; /* if non-zero no re-mapping for m_str */
1070 char m_silent; /* <silent> used, don't echo commands */ 1083 char m_silent; /* <silent> used, don't echo commands */
1071 char m_nowait; /* <nowait> used */ 1084 char m_nowait; /* <nowait> used */
1072 #ifdef FEAT_EVAL 1085 #ifdef FEAT_EVAL
1073 char m_expr; /* <expr> used, m_str is an expression */ 1086 char m_expr; /* <expr> used, m_str is an expression */
1074 scid_T m_script_ID; /* ID of script where map was defined */ 1087 sctx_T m_script_ctx; /* SCTX where map was defined */
1075 #endif 1088 #endif
1076 }; 1089 };
1077 1090
1078 /* 1091 /*
1079 * Used for highlighting in the status line. 1092 * Used for highlighting in the status line.
1359 proftime_T uf_tml_children; /* time spent in children for this line */ 1372 proftime_T uf_tml_children; /* time spent in children for this line */
1360 proftime_T uf_tml_wait; /* start wait time for current line */ 1373 proftime_T uf_tml_wait; /* start wait time for current line */
1361 int uf_tml_idx; /* index of line being timed; -1 if none */ 1374 int uf_tml_idx; /* index of line being timed; -1 if none */
1362 int uf_tml_execed; /* line being timed was executed */ 1375 int uf_tml_execed; /* line being timed was executed */
1363 #endif 1376 #endif
1364 scid_T uf_script_ID; /* ID of script where function was defined, 1377 sctx_T uf_script_ctx; /* SCTX where function was defined,
1365 used for s: variables */ 1378 used for s: variables */
1366 int uf_refcount; /* reference count, see func_name_refcount() */ 1379 int uf_refcount; /* reference count, see func_name_refcount() */
1367 funccall_T *uf_scoped; /* l: local variables for closure */ 1380 funccall_T *uf_scoped; /* l: local variables for closure */
1368 char_u uf_name[1]; /* name of function (actually longer); can 1381 char_u uf_name[1]; /* name of function (actually longer); can
1369 start with <SNR>123_ (<SNR> is K_SPECIAL 1382 start with <SNR>123_ (<SNR> is K_SPECIAL
2121 * or contents of the file being edited. 2134 * or contents of the file being edited.
2122 */ 2135 */
2123 int b_p_initialized; /* set when options initialized */ 2136 int b_p_initialized; /* set when options initialized */
2124 2137
2125 #ifdef FEAT_EVAL 2138 #ifdef FEAT_EVAL
2126 int b_p_scriptID[BV_COUNT]; /* SIDs for buffer-local options */ 2139 sctx_T b_p_script_ctx[BV_COUNT]; /* SCTXs for buffer-local options */
2127 #endif 2140 #endif
2128 2141
2129 int b_p_ai; /* 'autoindent' */ 2142 int b_p_ai; /* 'autoindent' */
2130 int b_p_ai_nopaste; /* b_p_ai saved for paste mode */ 2143 int b_p_ai_nopaste; /* b_p_ai saved for paste mode */
2131 char_u *b_p_bkc; /* 'backupcopy' */ 2144 char_u *b_p_bkc; /* 'backupcopy' */