diff options
author | Bram Moolenaar <Bram@vim.org> | 2018-09-10 22:03:40 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2018-09-10 22:03:40 +0200 |
commit | 4c7b08f6409349cf5324a26f7523c438590550ef (patch) | |
tree | d742059c88721a93968729981fc512d8435bbaa3 /src/userfunc.c | |
parent | e797abf3c75358ebc0b31d6e076972daf889e06e (diff) | |
download | vim-git-4c7b08f6409349cf5324a26f7523c438590550ef.tar.gz |
patch 8.1.0365: function profile doesn't specify where it was definedv8.1.0365
Problem: Function profile doesn't specify where it was defined.
Solution: Show the script name and line number.
Diffstat (limited to 'src/userfunc.c')
-rw-r--r-- | src/userfunc.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/userfunc.c b/src/userfunc.c index 78a2ecc14..f6e16fefd 100644 --- a/src/userfunc.c +++ b/src/userfunc.c @@ -2587,6 +2587,7 @@ func_dump_profile(FILE *fd) int i; ufunc_T **sorttab; int st_len = 0; + char_u *p; todo = (int)func_hashtab.ht_used; if (todo == 0) @@ -2609,6 +2610,14 @@ func_dump_profile(FILE *fd) fprintf(fd, "FUNCTION <SNR>%s()\n", fp->uf_name + 3); else fprintf(fd, "FUNCTION %s()\n", fp->uf_name); + p = home_replace_save(NULL, + get_scriptname(fp->uf_script_ctx.sc_sid)); + if (p != NULL) + { + fprintf(fd, " Defined: %s line %ld\n", + p, (long)fp->uf_script_ctx.sc_lnum); + vim_free(p); + } if (fp->uf_tm_count == 1) fprintf(fd, "Called 1 time\n"); else |