Skip to content

Commit 181d4f5

Browse files
committed
patch 8.1.2055: not easy to jump to function line from profile
Problem: Not easy to jump to function line from profile. Solution: Use "file:99" instead of "file line 99" so that "gf" works. (Daniel Hahler, closes #4951)
1 parent cebfcff commit 181d4f5

3 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/profiler.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,7 @@ func_dump_profile(FILE *fd)
696696
get_scriptname(fp->uf_script_ctx.sc_sid));
697697
if (p != NULL)
698698
{
699-
fprintf(fd, " Defined: %s line %ld\n",
699+
fprintf(fd, " Defined: %s:%ld\n",
700700
p, (long)fp->uf_script_ctx.sc_lnum);
701701
vim_free(p);
702702
}

src/testdir/test_profile.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func Test_profile_func()
5555
call assert_equal(30, len(lines))
5656

5757
call assert_equal('FUNCTION Foo1()', lines[0])
58-
call assert_match('Defined:.*Xprofile_func.vim', lines[1])
58+
call assert_match('Defined:.*Xprofile_func.vim:3', lines[1])
5959
call assert_equal('Called 2 times', lines[2])
6060
call assert_match('^Total time:\s\+\d\+\.\d\+$', lines[3])
6161
call assert_match('^ Self time:\s\+\d\+\.\d\+$', lines[4])

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -757,6 +757,8 @@ static char *(features[]) =
757757

758758
static int included_patches[] =
759759
{ /* Add new patch number below this line */
760+
/**/
761+
2055,
760762
/**/
761763
2054,
762764
/**/

0 commit comments

Comments
 (0)