1
0
forked from aniani/vim

patch 8.1.0365: function profile doesn't specify where it was defined

Problem:    Function profile doesn't specify where it was defined.
Solution:   Show the script name and line number.
This commit is contained in:
Bram Moolenaar
2018-09-10 22:03:40 +02:00
parent e797abf3c7
commit 4c7b08f640
3 changed files with 162 additions and 146 deletions

View File

@@ -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