From a2e48b556b7537acd26353b6cc201410be7cf3dc Mon Sep 17 00:00:00 2001 From: erw7 Date: Sun, 25 Aug 2019 13:45:45 +0900 Subject: vim-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 vim/vim#3362) Also display the line number with ":verbose set". https://github.com/vim/vim/commit/f29c1c6aa3f365c025890fab5fb9efbe88eb1761 --- src/nvim/getchar.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/nvim/getchar.c') diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c index 0ef0c852a4..318b36860e 100644 --- a/src/nvim/getchar.c +++ b/src/nvim/getchar.c @@ -2957,7 +2957,8 @@ int buf_do_map(int maptype, MapArguments *args, int mode, bool is_abbrev, mp->m_silent = args->silent; mp->m_mode = mode; mp->m_expr = args->expr; - mp->m_script_ID = current_SID; + mp->m_script_ctx = current_sctx; + mp->m_script_ctx.sc_lnum += sourcing_lnum; did_it = true; } } @@ -3032,7 +3033,8 @@ int buf_do_map(int maptype, MapArguments *args, int mode, bool is_abbrev, mp->m_silent = args->silent; mp->m_mode = mode; mp->m_expr = args->expr; - mp->m_script_ID = current_SID; + mp->m_script_ctx = current_sctx; + mp->m_script_ctx.sc_lnum += sourcing_lnum; // add the new entry in front of the abbrlist or maphash[] list if (is_abbrev) { @@ -3375,9 +3377,10 @@ showmap ( msg_outtrans_special(s, FALSE); xfree(s); } - if (p_verbose > 0) - last_set_msg(mp->m_script_ID); - ui_flush(); /* show one line at a time */ + if (p_verbose > 0) { + last_set_msg(mp->m_script_ctx); + } + ui_flush(); // show one line at a time } /// Check if a map exists that has given string in the rhs -- cgit