From ad0f97f4123b3b84e0f0883afce305d20aec954a Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sat, 21 Sep 2019 23:18:56 +0200 Subject: vim-patch:8.1.2055: profile: adjust line format #11058 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 vim/vim#4951) https://github.com/vim/vim/commit/181d4f58cc421f2e6d3b16333d4cb70d35ad1342 --- src/nvim/eval.c | 2 +- src/nvim/testdir/test_profile.vim | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/nvim/eval.c b/src/nvim/eval.c index be761afa1f..2ddcd389fe 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -22270,7 +22270,7 @@ void func_dump_profile(FILE *fd) .channel_id = 0, }; char_u *p = get_scriptname(last_set, &should_free); - fprintf(fd, " Defined: %s line %" PRIdLINENR "\n", + fprintf(fd, " Defined: %s:%" PRIdLINENR "\n", p, fp->uf_script_ctx.sc_lnum); if (should_free) { xfree(p); diff --git a/src/nvim/testdir/test_profile.vim b/src/nvim/testdir/test_profile.vim index 7e853eeac3..b677ac3704 100644 --- a/src/nvim/testdir/test_profile.vim +++ b/src/nvim/testdir/test_profile.vim @@ -54,7 +54,7 @@ func Test_profile_func() call assert_equal(30, len(lines)) call assert_equal('FUNCTION Foo1()', lines[0]) - call assert_match('Defined:.*Xprofile_func.vim', lines[1]) + call assert_match('Defined:.*Xprofile_func.vim:3', lines[1]) call assert_equal('Called 2 times', lines[2]) call assert_match('^Total time:\s\+\d\+\.\d\+$', lines[3]) call assert_match('^ Self time:\s\+\d\+\.\d\+$', lines[4]) -- cgit