annotate runtime/ftplugin/gprof.vim @ 29247:5f314b2ed494 v8.2.5142

patch 8.2.5142: startup test fails if there is a status bar Commit: https://github.com/vim/vim/commit/fa04eae5a5b9394079bde2d37ce6f9f8a5567d48 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Jun 21 14:38:40 2022 +0100 patch 8.2.5142: startup test fails if there is a status bar Problem: Startup test fails if there is a status bar at the top of the screen. (Ernie Rael) Solution: Use a larger vertical offset in the test.
author Bram Moolenaar <Bram@vim.org>
date Tue, 21 Jun 2022 18:45:07 +0200
parents 65de67669df3
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
25836
65de67669df3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 24468
diff changeset
1 " Language: gprof
65de67669df3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 24468
diff changeset
2 " Maintainer: Dominique Pelle <dominique.pelle@gmail.com>
65de67669df3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 24468
diff changeset
3 " Contributors: Doug Kearns <dougkearns@gmail.com>
65de67669df3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 24468
diff changeset
4 " Last Change: 2021 Sep 19
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
5
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
6 " When cursor is on one line of the gprof call graph,
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
7 " calling this function jumps to this function in the call graph.
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
8 if exists("b:did_ftplugin")
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
9 finish
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
10 endif
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
11 let b:did_ftplugin=1
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
12
25836
65de67669df3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 24468
diff changeset
13 func! <SID>GprofJumpToFunctionIndex()
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
14 let l:line = getline('.')
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
15 if l:line =~ '[\d\+\]$'
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
16 " We're in a line in the call graph.
4869
a5352e73dc00 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4681
diff changeset
17 norm! $y%
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
18 call search('^' . escape(@", '[]'), 'sw')
4869
a5352e73dc00 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4681
diff changeset
19 norm! zz
24468
9f41bfdbc6fc Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 4869
diff changeset
20 elseif l:line =~ '^\(\s*[0-9\.]\+\)\{3}\s\+'
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
21 " We're in line in the flat profile.
4869
a5352e73dc00 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4681
diff changeset
22 norm! 55|eby$
a5352e73dc00 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4681
diff changeset
23 call search('^\[\d\+\].*\d\s\+' . escape(@", '[]*.') . '\>', 'sW')
a5352e73dc00 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4681
diff changeset
24 norm! zz
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
25 endif
25836
65de67669df3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 24468
diff changeset
26 endfunc
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
27
25836
65de67669df3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 24468
diff changeset
28 if !exists("no_plugin_maps") && !exists("no_gprof_maps")
65de67669df3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 24468
diff changeset
29 " Pressing <C-]> on a line in the gprof flat profile or in
65de67669df3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 24468
diff changeset
30 " the call graph, jumps to the corresponding function inside
65de67669df3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 24468
diff changeset
31 " the flat profile.
65de67669df3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 24468
diff changeset
32 map <buffer> <silent> <C-]> :call <SID>GprofJumpToFunctionIndex()<CR>
65de67669df3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 24468
diff changeset
33 let b:undo_ftplugin = "silent! unmap <buffer> <C-]>"
65de67669df3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 24468
diff changeset
34 endif
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
35
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
36 " vim:sw=2 fdm=indent