mirror of
https://github.com/vim/vim.git
synced 2025-10-13 06:54:15 -04:00
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".
This commit is contained in:
@@ -4061,7 +4061,7 @@ common_function(typval_T *argvars, typval_T *rettv, int is_funcref)
|
||||
* also be called from another script. Using trans_function_name()
|
||||
* would also work, but some plugins depend on the name being
|
||||
* printable text. */
|
||||
sprintf(sid_buf, "<SNR>%ld_", (long)current_SID);
|
||||
sprintf(sid_buf, "<SNR>%ld_", (long)current_sctx.sc_sid);
|
||||
name = alloc((int)(STRLEN(sid_buf) + STRLEN(s + off) + 1));
|
||||
if (name != NULL)
|
||||
{
|
||||
@@ -7618,7 +7618,8 @@ get_maparg(typval_T *argvars, typval_T *rettv, int exact)
|
||||
dict_add_number(dict, "noremap", mp->m_noremap ? 1L : 0L);
|
||||
dict_add_number(dict, "expr", mp->m_expr ? 1L : 0L);
|
||||
dict_add_number(dict, "silent", mp->m_silent ? 1L : 0L);
|
||||
dict_add_number(dict, "sid", (long)mp->m_script_ID);
|
||||
dict_add_number(dict, "sid", (long)mp->m_script_ctx.sc_sid);
|
||||
dict_add_number(dict, "lnum", (long)mp->m_script_ctx.sc_lnum);
|
||||
dict_add_number(dict, "buffer", (long)buffer_local);
|
||||
dict_add_number(dict, "nowait", mp->m_nowait ? 1L : 0L);
|
||||
dict_add_string(dict, "mode", mapmode);
|
||||
|
Reference in New Issue
Block a user