diff options
author | watiko <service@mail.watiko.net> | 2016-02-15 14:48:39 +0900 |
---|---|---|
committer | watiko <service@mail.watiko.net> | 2016-02-15 16:08:16 +0900 |
commit | 5b1a536d50578f82b2e42b89f9fff41396ea798a (patch) | |
tree | 0866c24219133a9793a745d9b3785d6b4a9615bb | |
parent | e3bf1385e69911e39c3f3a753d4c7db936328d7c (diff) | |
download | rneovim-5b1a536d50578f82b2e42b89f9fff41396ea798a.tar.gz rneovim-5b1a536d50578f82b2e42b89f9fff41396ea798a.tar.bz2 rneovim-5b1a536d50578f82b2e42b89f9fff41396ea798a.zip |
vim-patch:7.4.879
Problem: Can't see line numbers in nested function calls.
Solution: Add line number to the file name. (Alberto Fanjul)
https://github.com/vim/vim/commit/1d6328ca00fc6cfe37b1f5e038ec23f443258886
-rw-r--r-- | src/nvim/eval.c | 14 | ||||
-rw-r--r-- | src/nvim/version.c | 2 |
2 files changed, 10 insertions, 6 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index b9b913a969..f1d57c698b 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -20873,14 +20873,18 @@ call_user_func ( save_sourcing_name = sourcing_name; save_sourcing_lnum = sourcing_lnum; sourcing_lnum = 1; - sourcing_name = xmalloc((save_sourcing_name == NULL ? 0 : STRLEN(save_sourcing_name)) - + STRLEN(fp->uf_name) + 13); + // need space for function name + ("function " + 3) or "[number]" + size_t len = (save_sourcing_name == NULL ? 0 : STRLEN(save_sourcing_name)) + + STRLEN(fp->uf_name) + 20; + sourcing_name = xmalloc(len); { if (save_sourcing_name != NULL - && STRNCMP(save_sourcing_name, "function ", 9) == 0) - sprintf((char *)sourcing_name, "%s..", save_sourcing_name); - else + && STRNCMP(save_sourcing_name, "function ", 9) == 0) { + vim_snprintf((char *)sourcing_name, len, "%s[%zu]..", + save_sourcing_name, save_sourcing_lnum); + } else { STRCPY(sourcing_name, "function "); + } cat_func_name(sourcing_name + STRLEN(sourcing_name), fp); if (p_verbose >= 12) { diff --git a/src/nvim/version.c b/src/nvim/version.c index f332e55ca4..afc043498c 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -409,7 +409,7 @@ static int included_patches[] = { // 882, // 881, // 880 NA - // 879, + 879, // 878, // 877, // 876 NA |