2 " Maintainer: Dominique Pelle <dominique.pelle@gmail.com>
3 " Last Change: 2013 Jun 09
5 " When cursor is on one line of the gprof call graph,
6 " calling this function jumps to this function in the call graph.
7 if exists("b:did_ftplugin")
12 fun! <SID>GprofJumpToFunctionIndex()
13 let l:line = getline('.')
14 if l:line =~ '[\d\+\]$'
15 " We're in a line in the call graph.
17 call search('^' . escape(@", '[]'), 'sw')
19 elseif l:line =~ '^\(\s\+[0-9\.]\+\)\{3}\s\+'
20 " We're in line in the flat profile.
22 call search('^\[\d\+\].*\d\s\+' . escape(@", '[]*.') . '\>', 'sW')
27 " Pressing <C-]> on a line in the gprof flat profile or in
28 " the call graph, jumps to the corresponding function inside
30 map <buffer> <silent> <C-]> :call <SID>GprofJumpToFunctionIndex()<CR>