Skip to content

Instantly share code, notes, and snippets.

@bstaletic
Created November 12, 2021 13:44
Show Gist options
  • Save bstaletic/84c10b75be93c99f321a27af73278a8d to your computer and use it in GitHub Desktop.
Save bstaletic/84c10b75be93c99f321a27af73278a8d to your computer and use it in GitHub Desktop.
FUNCTION traces#cmdl_leave()
Defined: ~/.vim/pack/bundle/start/traces/autoload/traces.vim:762
Called 3 times
Total time: 0.001451
Self time: 0.001219
count total (s) self (s)
3 0.000067 let s:nr = bufnr('%')
3 0.000066 if !exists('s:buf[s:nr]')
1 0.000001 return
2 0.000006 endif
2 0.000303 0.000071 call s:restore_undo_history()
" highlights
2 0.000041 if exists('s:win[win_getid()]')
if &scrolloff !=# 0
let scrolloff = &scrolloff
noautocmd let &scrolloff = 0
endif
let cur_win = win_getid()
let alt_win = win_getid(winnr('#'))
let windows = filter(win_findbuf(s:nr), {_, val -> win_id2win(val)})
for id in windows
noautocmd call win_gotoid(id)
if exists('s:win[id]')
if exists('s:win[id].hlight')
for group in keys(s:win[id].hlight)
if s:win[id].hlight[group].index !=# - 1
silent! call matchdelete(s:win[id].hlight[group].index)
endif
endfor
endif
if exists('s:win[id].options')
for option in keys(s:win[id].options)
execute 'noautocmd let &' . option . '="' . s:win[id].options[option] . '"'
endfor
endif
unlet s:win[id]
endif
endfor
if bufname('%') !=# '[Command Line]'
noautocmd call win_gotoid(alt_win)
noautocmd call win_gotoid(cur_win)
endif
if exists('scrolloff')
noautocmd let &scrolloff = scrolloff
endif
2 0.000006 endif
2 0.000032 if &hlsearch !=# s:buf[s:nr].hlsearch
noautocmd let &hlsearch = s:buf[s:nr].hlsearch
2 0.000006 endif
2 0.000025 if &cmdheight !=# s:buf[s:nr].cmdheight
noautocmd let &cmdheight = s:buf[s:nr].cmdheight
2 0.000007 endif
2 0.000055 if winsaveview() !=# s:buf[s:nr].view
call winrestview(s:buf[s:nr].view)
2 0.000007 endif
2 0.000046 unlet s:buf[s:nr]
FUNCTION <SNR>80_highlight()
Defined: ~/.vim/pack/bundle/start/traces/autoload/traces.vim:571
Called 19 times
Total time: 0.001249
Self time: 0.001249
count total (s) self (s)
19 0.000209 let cur_win = win_getid()
19 0.000392 if exists('s:win[cur_win].hlight[a:group].pattern') && s:win[cur_win].hlight[a:group].pattern ==# a:pattern
return
19 0.000043 endif
19 0.000359 if !exists('s:win[cur_win].hlight[a:group].pattern') && empty(a:pattern)
19 0.000107 return
endif
if &hlsearch && !empty(a:pattern) && a:group ==# 'TracesSearch'
noautocmd let &hlsearch = 0
endif
if &scrolloff !=# 0
let scrolloff = &scrolloff
noautocmd let &scrolloff = 0
endif
let alt_win = win_getid(winnr('#'))
let windows = filter(win_findbuf(s:nr), {_, val -> win_id2win(val)})
for id in windows
noautocmd call win_gotoid(id)
let s:win[id] = get(s:win, id, {})
let s:win[id].hlight = get(s:win[id], 'hlight', {})
if !exists('s:win[id].hlight[a:group]')
let x = {}
let x.pattern = a:pattern
silent! let x.index = matchadd(a:group, a:pattern, a:priority)
let s:win[id].hlight[a:group] = x
let s:highlighted = 1
elseif s:win[id].hlight[a:group].pattern !=# a:pattern
if s:win[id].hlight[a:group].index !=# -1
silent! call matchdelete(s:win[id].hlight[a:group].index)
endif
let s:win[id].hlight[a:group].pattern = a:pattern
silent! let s:win[id].hlight[a:group].index = matchadd(a:group, a:pattern, a:priority)
let s:highlighted = 1
endif
if (&conceallevel !=# 2 || &concealcursor !=# 'c') && a:group ==# 'Conceal'
let s:win[id].options = get(s:win[id], 'options', {})
let s:win[id].options.conceallevel = &conceallevel
let s:win[id].options.concealcursor = &concealcursor
noautocmd set conceallevel=2
noautocmd set concealcursor=c
endif
" highlighting doesn't work properly when cursorline or cursorcolumn is
" enabled
if &cursorcolumn || &cursorline
let s:win[id].options = get(s:win[id], 'options', {})
let s:win[id].options.cursorcolumn = &cursorcolumn
let s:win[id].options.cursorline = &cursorline
noautocmd set nocursorcolumn
noautocmd set nocursorline
endif
endfor
if bufname('%') !=# '[Command Line]'
noautocmd call win_gotoid(alt_win)
noautocmd call win_gotoid(cur_win)
endif
if exists('scrolloff')
noautocmd let &scrolloff = scrolloff
endif
FUNCTION slash#callBlink()
Defined: ~/.vim/autoload/slash.vim:41
Called 3 times
Total time: 0.000316
Self time: 0.000316
count total (s) self (s)
3 0.000134 if getcmdtype() == '/' || getcmdtype() == '?'
return "\<cr>:call slash#blink(3, 100)\<cr>"
3 0.000017 else
3 0.000038 if &grepprg != 'grep'
3 0.000057 return "\<C-\>eslash#SubstituteWordBoundaries()\<cr>\<cr>"
endif
return "\<cr>"
endif
FUNCTION <SNR>80_evaluate_range()
Defined: ~/.vim/pack/bundle/start/traces/autoload/traces.vim:330
Called 8 times
Total time: 0.002443
Self time: 0.002443
count total (s) self (s)
8 0.000149 let result = { 'range': [], 'pattern': '', 'end': ''}
8 0.000066 let s:range_valid = 1
8 0.000214 let pos = s:buf[s:nr].cur_init_pos[0]
8 0.000091 for specifier in a:range_structure
let tmp_pos = pos
let specifier_result = []
for address in specifier.addresses
" skip empty unclosed pattern specifier when range is empty otherwise
" substitute it with current position
if address.address =~# '^[?/]$'
let s:buf[s:nr].show_range = 1
if empty(result.range)
break
endif
let address.address = '.'
endif
let query = s:spec_to_abs(address, tmp_pos)
" % specifier doesn't accept additional addresses
if !query.valid || len(query.range) == 2 && len(specifier.addresses) > 1
let s:range_valid = 0
break
endif
let tmp_pos = query.range[-1]
let specifier_result = deepcopy(query.range)
let result.pattern = query.regex
endfor
if !s:range_valid
break
endif
call extend(result.range, specifier_result)
if get(specifier, 'delimiter') is# ';'
let pos = result.range[-1]
endif
8 0.000040 endfor
8 0.000065 if !empty(result.range)
let result.end = result.range[-1]
if len(result.range) == 1
call extend(result.range, result.range)
else
let result.range = result.range[-2:-1]
if result.range[-1] < result.range[-2]
let temp = result.range[-2]
let result.range[-2] = result.range[-1]
let result.range[-1] = temp
endif
endif
8 0.000016 endif
8 0.000112 return s:range_valid ? result : { 'range': [], 'pattern': '', 'end': '' }
FUNCTION <SNR>77_HasAnyKey()
Defined: ~/.vim/pack/bundle/start/YouCompleteMe/autoload/youcompleteme.vim:478
Called 1 time
Total time: 0.000021
Self time: 0.000021
count total (s) self (s)
2 0.000006 for key in a:keys
1 0.000004 if has_key( a:dict, key )
return 1
1 0.000001 endif
2 0.000003 endfor
1 0.000001 return 0
FUNCTION <SNR>80_cmdl_enter()
Defined: ~/.vim/pack/bundle/start/traces/autoload/traces.vim:743
Called 2 times
Total time: 0.001197
Self time: 0.000841
count total (s) self (s)
2 0.000054 let s:buf[s:nr] = {}
2 0.000057 let s:buf[s:nr].view = winsaveview()
2 0.000038 let s:buf[s:nr].show_range = 0
2 0.000032 let s:buf[s:nr].duration = 0
2 0.000035 let s:buf[s:nr].hlsearch = &hlsearch
2 0.000057 let s:buf[s:nr].cword = expand('<cword>')
2 0.000042 let s:buf[s:nr].cWORD = expand('<cWORD>')
2 0.000052 let s:buf[s:nr].cfile = expand('<cfile>')
2 0.000067 let s:buf[s:nr].cur_init_pos = [line('.'), col('.')]
2 0.000062 let s:buf[s:nr].seq_last = undotree().seq_last
2 0.000066 let s:buf[s:nr].empty_undotree = empty(undotree().entries)
2 0.000050 let s:buf[s:nr].changed = 0
2 0.000052 let s:buf[s:nr].cmdheight = &cmdheight
2 0.000033 let s:buf[s:nr].redraw = 1
2 0.000048 let s:buf[s:nr].s_mark = (&encoding == 'utf-8' ? "\uf8b4" : '' )
2 0.000430 0.000074 call s:save_marks()
FUNCTION <SNR>80_evaluate_cmdl()
Defined: ~/.vim/pack/bundle/start/traces/autoload/traces.vim:818
Called 8 times
Total time: 0.016763
Self time: 0.001966
count total (s) self (s)
8 0.000100 let cmdl = {}
8 0.000092 let cmdl.string = a:string
8 0.009778 0.000593 let r = s:evaluate_range(s:parse_range([], cmdl.string))
8 0.000069 let cmdl.range = {}
8 0.000068 let cmdl.range.abs = r.range
8 0.000058 let cmdl.range.end = r.end
8 0.000429 0.000253 let cmdl.range.pattern = s:get_selection_regexp(r.range)
8 0.000420 0.000282 let cmdl.range.specifier = s:add_flags(r.pattern, cmdl, 3)
8 0.000058 let cmdl.cmd = {}
8 0.000057 let cmdl.cmd.args = {}
8 0.005523 0.000225 call s:parse_command(cmdl)
8 0.000045 return cmdl
FUNCTION <SNR>54_cmdline_changed()
Defined: ~/.vim/pack/bundle/start/traces/plugin/traces.vim:21
Called 10 times
Total time: 0.001599
Self time: 0.001599
count total (s) self (s)
10 0.000289 if exists('s:start_init_timer')
8 0.000111 call timer_stop(s:start_init_timer)
10 0.000043 endif
10 0.001071 let s:start_init_timer = timer_start(1, {_-> traces#init(getcmdline())})
FUNCTION <SNR>80_parse_command()
Defined: ~/.vim/pack/bundle/start/traces/autoload/traces.vim:519
Called 8 times
Total time: 0.005298
Self time: 0.001036
count total (s) self (s)
8 0.004500 0.000238 let a:cmdl.cmd.name = s:get_command(a:cmdl.string)
8 0.000213 if a:cmdl.cmd.name =~# '\v^%(g%[lobal]\!=|v%[global])$'
let a:cmdl.cmd.args = s:parse_global(a:cmdl)
8 0.000172 elseif a:cmdl.cmd.name =~# '\v^%(s%[ubstitute]|sm%[agic]|sno%[magic])$'
let a:cmdl.cmd.args = s:parse_substitute(a:cmdl)
8 0.000117 elseif a:cmdl.cmd.name =~# '\v^%(sor%[t]\!=)$'
let a:cmdl.cmd.args = s:parse_sort(a:cmdl)
8 0.000022 endif
FUNCTION neomake#utils#get_verbosity()
Defined: ~/.vim/pack/bundle/start/neomake/autoload/neomake/utils.vim:35
Called 1 time
Total time: 0.000016
Self time: 0.000016
count total (s) self (s)
1 0.000004 if a:0 && has_key(a:1, 'make_id')
return neomake#GetMakeOptions(a:1.make_id).verbosity
1 0.000001 endif
1 0.000007 return get(g:, 'neomake_verbose', 1) + &verbose
FUNCTION <SNR>80_pos_range()
Defined: ~/.vim/pack/bundle/start/traces/autoload/traces.vim:560
Called 3 times
Total time: 0.000066
Self time: 0.000066
count total (s) self (s)
3 0.000047 if g:traces_preserve_view_state || empty(a:end)
3 0.000013 return
endif
call cursor([a:end, 1])
if !empty(a:pattern)
call search(a:pattern, 'c', a:end, s:s_timeout)
endif
let s:moved = 1
FUNCTION <SNR>80_get_selection_regexp()
Defined: ~/.vim/pack/bundle/start/traces/autoload/traces.vim:386
Called 8 times
Total time: 0.000176
Self time: 0.000176
count total (s) self (s)
8 0.000076 if empty(a:range)
8 0.000079 return ''
endif
let pattern = '\%>' . (a:range[-2] - 1) . 'l\%<' . (a:range[-1] + 1) . 'l'
if &listchars =~# 'eol:.'
let pattern .= '\_.'
else
let pattern .= '\(.\|^\)'
endif
return pattern
FUNCTION neomake#utils#LogMessage()
Defined: ~/.vim/pack/bundle/start/neomake/autoload/neomake/utils.vim:42
Called 1 time
Total time: 0.000056
Self time: 0.000040
count total (s) self (s)
1 0.000004 if a:0
let context = a:1
let verbosity = neomake#utils#get_verbosity(context)
1 0.000001 else
1 0.000005 let context = {} " just for vimlint (EVL104)
1 0.000024 0.000008 let verbosity = neomake#utils#get_verbosity()
1 0.000000 endif
1 0.000004 let logfile = get(g:, 'neomake_logfile', '')
1 0.000005 if !s:is_testing && verbosity < a:level && logfile is# ''
1 0.000002 return
endif
if a:0
let msg = printf('[%s.%s:%s:%d] %s', get(context, 'make_id', '-'), get(context, 'id', '-'), get(context, 'bufnr', get(context, 'file_mode', 0) ? '?' : '-'), winnr(), a:msg)
else
let msg = a:msg
endif
" Use Vader's log for messages during tests.
" @vimlint(EVL104, 1, l:timediff)
if s:is_testing && (verbosity >= a:level || get(g:, 'neomake_test_log_all_messages', 0))
let timediff = s:reltime_lastmsg()
if timediff !=# ' '
let test_msg = '['.s:short_level_to_name[a:level].' '.timediff.']: '.msg
else
let test_msg = '['.s:level_to_name[a:level].']: '.msg
endif
call vader#log(test_msg)
" Only keep context entries that are relevant for / used in the message.
let context = a:0 ? filter(copy(context), "index(['id', 'make_id', 'bufnr'], v:key) != -1") : {}
call add(g:neomake_test_messages, [a:level, a:msg, context])
if index(['.', '!', ')', ']'], a:msg[-1:-1]) == -1
Assert 0, 'Log msg does not end with punctuation: "'.a:msg.'".'
endif
elseif verbosity >= a:level
redraw
if a:level ==# 0
echohl ErrorMsg
endif
if verbosity > 2
if !exists('timediff')
let timediff = s:reltime_lastmsg()
endif
echom 'Neomake ['.timediff.']: '.msg
else
echom 'Neomake: '.msg
endif
if a:level ==# 0
echohl None
endif
endif
if !empty(logfile) && type(logfile) ==# type('')
if !exists('s:logfile_writefile_opts')
" Use 'append' with writefile, but only if it is available. Otherwise, just
" overwrite the file. 'S' is used to disable fsync in Neovim
" (https://github.com/neovim/neovim/pull/6427).
let s:can_append_to_logfile = v:version > 704 || (v:version == 704 && has('patch503'))
if !s:can_append_to_logfile
redraw
echohl WarningMsg
echom 'Neomake: appending to the logfile is not supported in your Vim version.'
echohl NONE
endif
let s:logfile_writefile_opts = s:can_append_to_logfile ? 'aS' : ''
endif
let date = strftime('%H:%M:%S')
if !exists('timediff')
let timediff = s:reltime_lastmsg()
endif
try
call writefile([printf('%s [%s %s] %s', date, s:short_level_to_name[a:level], timediff, msg)], logfile, s:logfile_writefile_opts)
catch
unlet g:neomake_logfile
call neomake#utils#ErrorMessage(printf('Error when trying to write to logfile %s: %s. Unsetting g:neomake_logfile.', logfile, v:exception))
endtry
endif
" @vimlint(EVL104, 0, l:timediff)
FUNCTION neomake#VimLeave()
Defined: ~/.vim/pack/bundle/start/neomake/autoload/neomake.vim:1687
Called 1 time
Total time: 0.000098
Self time: 0.000024
count total (s) self (s)
1 0.000087 0.000013 call neomake#utils#DebugMessage('Calling VimLeave.')
1 0.000006 for make_id in keys(s:make_info)
call neomake#CancelMake(make_id)
1 0.000001 endfor
FUNCTION neomake#utils#DebugMessage()
Defined: ~/.vim/pack/bundle/start/neomake/autoload/neomake/utils.vim:146
Called 1 time
Total time: 0.000074
Self time: 0.000018
count total (s) self (s)
1 0.000074 0.000018 call call('neomake#utils#LogMessage', [3] + a:000)
FUNCTION <SNR>80_add_flags()
Defined: ~/.vim/pack/bundle/start/traces/autoload/traces.vim:412
Called 8 times
Total time: 0.000138
Self time: 0.000138
count total (s) self (s)
8 0.000086 if !len(a:pattern)
8 0.000034 return ''
endif
if !s:range_valid
return ''
endif
if !len(substitute(a:pattern, '\\[cCvVmM]', '', 'g'))
return ''
endif
let option = ''
" magic
if has_key(a:cmdl, 'cmd') && a:cmdl.cmd.name =~# '\v^sm%[agic]$'
let option = '\m'
elseif has_key(a:cmdl, 'cmd') && a:cmdl.cmd.name =~# '\v^sno%[magic]$'
let option = '\M'
elseif &magic
let option = '\m'
else
let option = '\M'
endif
" case
if &ignorecase
if &smartcase
if match(a:pattern, '\u') ==# -1
let option .= '\c'
else
let option .= '\C'
endif
else
let option .= '\c'
endif
endif
if !empty(a:cmdl.range.abs)
let start = a:cmdl.range.abs[-2] - 1
let end = a:cmdl.range.abs[-1] + 1
elseif a:type ==# 1
return option . a:pattern
elseif a:type ==# 2
let start = s:buf[s:nr].cur_init_pos[0] - 1
let end = s:buf[s:nr].cur_init_pos[0] + 1
endif
" range pattern specifer
if a:type == 3
let start = a:cmdl.range.end - 1
let end = a:cmdl.range.end + 1
endif
let range = '\m\%>'. start .'l' . '\%<' . end . 'l'
" group is necessary to contain pattern inside range when using branches (\|)
let group_start = '\%('
let group_end = '\m\)'
" add backslash to the end of pattern if it ends with odd number of
" backslashes, this is required to properly close group
if len(matchstr(a:pattern, '\\\+$')) % 2
let group_end = '\' . group_end
endif
return range . group_start . option . a:pattern . group_end
FUNCTION <SNR>77_DisableOnLargeFile()
Defined: ~/.vim/pack/bundle/start/YouCompleteMe/autoload/youcompleteme.vim:463
Called 1 time
Total time: 0.000006
Self time: 0.000006
count total (s) self (s)
1 0.000004 if exists( 'b:ycm_largefile' )
1 0.000001 return b:ycm_largefile
endif
let threshold = g:ycm_disable_for_files_larger_than_kb * 1024
let b:ycm_largefile = threshold > 0 && getfsize( expand( a:buffer ) ) > threshold
if b:ycm_largefile
py3 vimsupport.PostVimMessage( 'YouCompleteMe is disabled in this buffer;' + ' the file exceeded the max size (see YCM options).' )
endif
return b:ycm_largefile
FUNCTION <SNR>77_OnVimLeave()
Defined: ~/.vim/pack/bundle/start/YouCompleteMe/autoload/youcompleteme.vim:589
Called 1 time
Total time: 0.005614
Self time: 0.005578
count total (s) self (s)
" Workaround a NeoVim issue - not shutting down timers correctly
" https://github.com/neovim/neovim/issues/6840
7 0.000013 for poller in values( s:pollers )
6 0.000092 0.000056 call s:StopPoller( poller )
7 0.000007 endfor
1 0.005495 py3 ycm_state.OnVimLeave()
FUNCTION <SNR>80_parse_range()
Defined: ~/.vim/pack/bundle/start/traces/autoload/traces.vim:91
Called 8 times
Total time: 0.006742
Self time: 0.005143
count total (s) self (s)
8 0.000083 let specifier = {}
8 0.000067 let specifier.addresses = []
8 0.000060 let while_limit = 0
8 0.000041 while 1
" address part
8 0.000788 0.000231 call s:trim(a:cmdl)
8 0.000070 let entry = {}
" regexp for pattern specifier
8 0.000074 let pattern = '/%(\\.|/@!&.)*/=|\?%(\\.|\?@!&.)*\?='
8 0.000095 if !len(specifier.addresses)
" \& is not supported
8 0.000498 let address = matchstrpos(a:cmdl[0], '\v^%(\d+|\.|\$|\%|\*|''.|'. pattern . '|\\\/|\\\?)')
else
let address = matchstrpos(a:cmdl[0], '\v^%(' . pattern . ')' )
8 0.000024 endif
8 0.000089 if address[2] != -1
call s:trim(a:cmdl, address[2])
let entry.address = address[0]
8 0.000021 endif
" offset
8 0.000763 0.000256 call s:trim(a:cmdl)
8 0.000300 let offset = matchstrpos(a:cmdl[0], '\m^\%(\d\|\s\|+\|-\)\+')
8 0.000112 if offset[2] != -1
call s:trim(a:cmdl, offset[2])
let entry.offset = offset[0]
8 0.000020 endif
" add first address
8 0.000111 if address[2] != -1 || offset[2] != -1
" if offset is present but specifier is missing add '.' specifier
if !has_key(entry, 'address')
let entry.address = '.'
endif
call add(specifier.addresses, entry)
8 0.000024 else
" stop trying if previous attempt was unsuccessful
8 0.000025 break
endif
let while_limit += 1 | if while_limit == 1000 | echoerr 'infinite loop' | break | endif
8 0.000055 endwhile
" delimiter
8 0.000810 0.000275 call s:trim(a:cmdl)
8 0.000251 let delimiter = matchstrpos(a:cmdl[0], '\m^\%(,\|;\)')
8 0.000092 if delimiter[2] != -1
call s:trim(a:cmdl, delimiter[2])
let specifier.delimiter = delimiter[0]
8 0.000020 endif
" add when addresses or delimiter are found or when one specifier is
" already known
8 0.000176 if !empty(specifier.addresses) || delimiter[2] != -1 || !empty(a:range)
" specifiers are not given but delimiter is present
if empty(specifier.addresses)
call add(specifier.addresses, { 'address': '.' })
endif
call add(a:range, specifier)
8 0.000021 endif
8 0.000072 if delimiter[2] != -1
try
return s:parse_range(a:range, a:cmdl)
catch /^Vim\%((\a\+)\)\=:E132/
return []
endtry
8 0.000019 else
8 0.000047 return a:range
endif
FUNCTION <SNR>45_can_diffoff()
Defined: ~/.vim/pack/bundle/start/fugitive/plugin/fugitive.vim:1705
Called 1 time
Total time: 0.000012
Self time: 0.000012
count total (s) self (s)
1 0.000010 return getwinvar(bufwinnr(a:buf), '&diff') && !empty(getbufvar(a:buf, 'git_dir')) && !empty(getwinvar(bufwinnr(a:buf), 'fugitive_diff_restore'))
FUNCTION UpdateMatches()
Defined: ~/.vim/pack/bundle/start/YouCompleteMe/autoload/youcompleteme.vim:720
Called 1 time
Total time: 88.803143
Self time: 88.803143
count total (s) self (s)
1 0.000014 let properties = []
10100001 11.952865 for line in range( line('$') )
10100000 65.304175 call extend(properties, filter(prop_list( line + 1, { 'bufnr': 1 } ), 'v:val[ "type" ][ :3 ] ==# "Ycm"' ))
10100001 9.540698 endfor
1 0.000005 return properties
FUNCTION <SNR>80_save_marks()
Defined: ~/.vim/pack/bundle/start/traces/autoload/traces.vim:835
Called 2 times
Total time: 0.000356
Self time: 0.000356
count total (s) self (s)
2 0.000058 if !exists('s:buf[s:nr].marks')
2 0.000029 let types = ['[', ']']
2 0.000037 let s:buf[s:nr].marks = {}
6 0.000051 for mark in types
4 0.000109 let s:buf[s:nr].marks[mark] = getpos("'" . mark)
6 0.000030 endfor
2 0.000007 endif
FUNCTION <SNR>77_OnBufferUnload()
Defined: ~/.vim/pack/bundle/start/YouCompleteMe/autoload/youcompleteme.vim:708
Called 1 time
Total time: 0.000113
Self time: 0.000020
count total (s) self (s)
" Expanding <abuf> returns the unloaded buffer number as a string but we want
" it as a true number for the getbufvar function.
1 0.000006 let buffer_number = str2nr( expand( '<abuf>' ) )
1 0.000103 0.000010 if !s:AllowedToCompleteInBuffer( buffer_number )
1 0.000001 return
endif
py3 ycm_state.OnBufferUnload( vimsupport.GetIntValue( 'buffer_number' ) )
FUNCTION <SNR>80_skip_modifiers()
Defined: ~/.vim/pack/bundle/start/traces/autoload/traces.vim:919
Called 8 times
Total time: 0.003435
Self time: 0.003435
count total (s) self (s)
8 0.000086 let cmdl = a:cmdl
" skip leading colon
8 0.000261 let cmdl = substitute(cmdl, '\v^:+', '', '')
" skip modifiers
8 0.000173 let pattern = '\v^\s*%(' . 'sil%[ent]\!=|' . 'verb%[ose]|' . 'noa%[utocmd]|' . 'loc%[kmarks]' . 'keepp%[atterns]|' . 'keepa%[lt]|' . 'keepj%[umps]|' . 'kee%[pmarks]|' . ')\s+'
8 0.000080 while 1
8 0.000768 let offset = matchstrpos(cmdl, pattern)
8 0.000159 if offset[2] isnot -1
let cmdl = strcharpart(cmdl, offset[2])
8 0.000032 else
8 0.000033 break
endif
8 0.000037 endwhile
8 0.000056 if g:traces_skip_modifiers
" skip *do modifiers
8 0.000609 let cmdl = substitute(cmdl, '\v^\s*%(%(%(\d+|\.|\$|\%)\s*[,;]=\s*)+)=\s*%(cdo|cfdo|ld%[o]|lfdo' . '|bufd%[o]|tabd%[o]|argdo|wind%[o])\!=\s+', '', '')
" skip modifiers
8 0.000052 while 1
8 0.000398 let offset = matchstrpos(cmdl, pattern)
8 0.000107 if offset[2] isnot -1
let cmdl = strcharpart(cmdl, offset[2])
8 0.000028 else
8 0.000027 break
endif
8 0.000031 endwhile
8 0.000018 endif
8 0.000055 return cmdl
FUNCTION slash#SubstituteWordBoundaries()
Defined: ~/.vim/autoload/slash.vim:31
Called 3 times
Total time: 0.000234
Self time: 0.000234
count total (s) self (s)
3 0.000068 let l:cmd = getcmdline()
" TODO: make sure this is calling grep, not vimgrep
3 0.000079 if l:cmd =~# '\<grep\>'
return substitute(l:cmd, '\\[<>]', '\\\\b', 'g')
3 0.000010 else
3 0.000019 return l:cmd
endif
FUNCTION traces#init()
Defined: ~/.vim/pack/bundle/start/traces/autoload/traces.vim:965
Called 8 times
Total time: 0.029859
Self time: 0.007149
count total (s) self (s)
8 0.000569 if &buftype ==# 'terminal' || (has('nvim') && !empty(&inccommand))
if exists('s:track_cmdl_timer')
call timer_stop(s:track_cmdl_timer)
endif
return
8 0.000022 endif
8 0.000172 let s:nr = bufnr('%')
8 0.000187 if !exists('s:buf[s:nr]')
2 0.001271 0.000074 call s:cmdl_enter()
8 0.000022 endif
8 0.000071 let s:highlighted = 0
8 0.000070 let s:moved = 0
8 0.000072 let s:last_pattern = @/
8 0.000105 if s:buf[s:nr].duration < s:timeout
8 0.000104 let start_time = reltime()
8 0.000023 endif
8 0.000082 if s:buf[s:nr].changed
let view = winsaveview()
noautocmd keepjumps silent undo
let s:buf[s:nr].changed = 0
let s:highlighted = 1
call s:restore_marks()
call winrestview(view)
8 0.000023 endif
8 0.020930 0.000732 let cmdl = s:evaluate_cmdl([s:skip_modifiers(a:cmdl)])
8 0.000103 if s:buf[s:nr].duration < s:timeout
" range preview
8 0.000173 if (!empty(cmdl.cmd.name) || s:buf[s:nr].show_range) && !get(s:, 'entire_file')
3 0.000355 0.000111 call s:highlight('Visual', cmdl.range.pattern, 100)
3 0.000031 if empty(cmdl.cmd.name)
call s:highlight('TracesSearch', cmdl.range.specifier, 101)
3 0.000010 endif
3 0.000201 0.000135 call s:pos_range(cmdl.range.end, cmdl.range.specifier)
8 0.000022 endif
" cmd preview
8 0.000166 if cmdl.cmd.name =~# '\v^%(s%[ubstitute]|sm%[agic]|sno%[magic])$'
call s:preview_substitute(cmdl)
8 0.000156 elseif cmdl.cmd.name =~# '\v^%(g%[lobal]\!=|v%[global])$'
call s:preview_global(cmdl)
8 0.000110 elseif cmdl.cmd.name =~# '\v^%(sor%[t]\!=)$'
call s:preview_sort(cmdl)
8 0.000023 endif
" clear unnecessary hl
8 0.000093 if empty(cmdl.range.pattern) || get(s:, 'entire_file')
8 0.000780 0.000246 call s:highlight('Visual', '', 100)
8 0.000025 endif
8 0.000169 if empty(cmdl.cmd.name) && empty(cmdl.range.specifier) || !empty(cmdl.cmd.name) && empty(cmdl.cmd.args)
8 0.000681 0.000210 call s:highlight('TracesSearch', '', 101)
8 0.000021 endif
8 0.000015 endif
" move to starting position if necessary
8 0.000205 if !s:moved && winsaveview() != s:buf[s:nr].view && !wildmenumode()
call winrestview(s:buf[s:nr].view)
8 0.000021 endif
" update screen if necessary
8 0.000038 if s:highlighted
call s:adjust_cmdheight(a:cmdl)
if has('nvim')
redraw
else
" https://github.com/markonm/traces.vim/issues/17
" if Vim is missing CmdlineChanged, use explicit redraw only at the
" start of preview or else it is going to be slow
if exists('##CmdlineChanged') || s:buf[s:nr].redraw
redraw
let s:buf[s:nr].redraw = 0
else
call winline()
endif
" after patch 8.0.1449, necessary for linux cui, otherwise highlighting
" is not drawn properly, fixed by 8.0.1476
if has('unix') && !has('gui_running') && has("patch-8.0.1449") && !has("patch-8.0.1476")
silent! call feedkeys("\<left>\<right>", 'tn')
endif
endif
8 0.000017 endif
8 0.000065 if exists('start_time')
8 0.000182 let s:buf[s:nr].duration = reltimefloat(reltime(start_time)) * 1000
8 0.000025 endif
FUNCTION <SNR>54_create_cmdl_changed_au()
Defined: ~/.vim/pack/bundle/start/traces/plugin/traces.vim:28
Called 2 times
Total time: 0.001573
Self time: 0.001193
count total (s) self (s)
2 0.000059 augroup traces_augroup_cmdline_changed
2 0.000928 autocmd!
2 0.000070 autocmd CmdlineChanged : call s:cmdline_changed()
2 0.000010 augroup END
" necessary when entering command line that has already been populated with
" text from mappings
2 0.000479 0.000099 call s:cmdline_changed()
FUNCTION <SNR>77_StopPoller()
Defined: ~/.vim/pack/bundle/start/YouCompleteMe/autoload/youcompleteme.vim:583
Called 6 times
Total time: 0.000036
Self time: 0.000036
count total (s) self (s)
6 0.000019 call timer_stop( a:poller.id )
6 0.000014 let a:poller.id = -1
FUNCTION <SNR>54_t_start()
Defined: ~/.vim/pack/bundle/start/traces/plugin/traces.vim:38
Called 3 times
Total time: 0.000282
Self time: 0.000282
count total (s) self (s)
3 0.000072 if exists('##CmdlineChanged')
3 0.000120 let s:track_cmdl_timer = timer_start(30,function('s:create_cmdl_changed_au'))
else
let s:track_cmdl_timer = timer_start(30,function('s:track_cmdl'),{'repeat':-1})
3 0.000009 endif
FUNCTION <SNR>77_AllowedToCompleteInBuffer()
Defined: ~/.vim/pack/bundle/start/YouCompleteMe/autoload/youcompleteme.vim:492
Called 1 time
Total time: 0.000093
Self time: 0.000066
count total (s) self (s)
1 0.000006 let buftype = getbufvar( a:buffer, '&buftype' )
1 0.000004 if has_key( s:buftype_blacklist, buftype )
return 0
1 0.000001 endif
1 0.000004 let filetype = getbufvar( a:buffer, '&filetype' )
1 0.000003 if empty( filetype )
let filetype = 'ycm_nofiletype'
1 0.000000 endif
1 0.000010 let whitelist_allows = type( g:ycm_filetype_whitelist ) != v:t_dict || has_key( g:ycm_filetype_whitelist, '*' ) || s:HasAnyKey( g:ycm_filetype_whitelist, split( filetype, '\.' ) )
1 0.000038 0.000017 let blacklist_allows = type( g:ycm_filetype_blacklist ) != v:t_dict || !s:HasAnyKey( g:ycm_filetype_blacklist, split( filetype, '\.' ) )
1 0.000003 let allowed = whitelist_allows && blacklist_allows
1 0.000015 0.000009 if !allowed || s:DisableOnLargeFile( a:buffer )
1 0.000001 return 0
endif
if allowed
let s:previous_allowed_buffer_number = bufnr( a:buffer )
endif
return allowed
FUNCTION <SNR>80_get_command()
Defined: ~/.vim/pack/bundle/start/traces/autoload/traces.vim:399
Called 8 times
Total time: 0.004262
Self time: 0.003615
count total (s) self (s)
8 0.000660 0.000188 call s:trim(a:cmdl)
8 0.000046 if !s:range_valid
return ''
8 0.000018 endif
8 0.002895 let result = matchstrpos(a:cmdl[0], s:cmd_pattern)
8 0.000140 if result[2] != -1
3 0.000291 0.000116 call s:trim(a:cmdl, result[2])
3 0.000032 return result[0]
5 0.000010 endif
5 0.000016 return ''
FUNCTION <SNR>80_trim()
Defined: ~/.vim/pack/bundle/start/traces/autoload/traces.vim:83
Called 35 times
Total time: 0.002246
Self time: 0.002246
count total (s) self (s)
35 0.000287 if a:0 == 2
3 0.000077 let a:1[0] = strcharpart(a:1[0], a:2)
32 0.000103 else
32 0.001114 let a:1[0] = substitute(a:1[0], '^\s\+', '', '')
35 0.000132 endif
FUNCTION <SNR>80_restore_undo_history()
Defined: ~/.vim/pack/bundle/start/traces/autoload/traces.vim:875
Called 2 times
Total time: 0.000232
Self time: 0.000232
count total (s) self (s)
2 0.000029 if s:buf[s:nr].changed
noautocmd keepjumps silent undo
call s:restore_marks()
2 0.000008 endif
2 0.000061 if type(get(s:buf[s:nr], 'undo_file')) isnot v:t_string
2 0.000011 return
endif
if has('nvim')
" can't use try/catch on Neovim inside CmdlineLeave
" https://github.com/neovim/neovim/issues/7876
silent! execute 'noautocmd rundo ' . s:buf[s:nr].undo_file
if undotree().seq_last !=# s:buf[s:nr].seq_last
echohl WarningMsg
echom 'traces.vim - undo history could not be restored'
echohl None
endif
else
try
silent execute 'noautocmd rundo ' . s:buf[s:nr].undo_file
catch
echohl WarningMsg
echom 'traces.vim - ' . v:exception
echohl None
endtry
endif
call delete(s:buf[s:nr].undo_file)
FUNCTION <SNR>54_t_stop()
Defined: ~/.vim/pack/bundle/start/traces/plugin/traces.vim:46
Called 3 times
Total time: 0.001775
Self time: 0.001775
count total (s) self (s)
3 0.000041 if exists('s:previous_cmdl')
unlet s:previous_cmdl
3 0.000008 endif
3 0.000025 if exists('s:track_cmdl_timer')
3 0.000027 call timer_stop(s:track_cmdl_timer)
3 0.000020 unlet s:track_cmdl_timer
3 0.000006 endif
3 0.000022 if exists('s:start_init_timer')
2 0.000156 call timer_stop(s:start_init_timer)
2 0.000016 unlet s:start_init_timer
3 0.000006 endif
3 0.000029 augroup traces_augroup_cmdline_changed
3 0.001360 autocmd!
3 0.000016 augroup END
FUNCTIONS SORTED ON TOTAL TIME
count total (s) self (s) function
1 88.803143 UpdateMatches()
8 0.029859 0.007149 traces#init()
8 0.016763 0.001966 <SNR>80_evaluate_cmdl()
8 0.006742 0.005143 <SNR>80_parse_range()
1 0.005614 0.005578 <SNR>77_OnVimLeave()
8 0.005298 0.001036 <SNR>80_parse_command()
8 0.004262 0.003615 <SNR>80_get_command()
8 0.003435 <SNR>80_skip_modifiers()
8 0.002443 <SNR>80_evaluate_range()
35 0.002246 <SNR>80_trim()
3 0.001775 <SNR>54_t_stop()
10 0.001599 <SNR>54_cmdline_changed()
2 0.001573 0.001193 <SNR>54_create_cmdl_changed_au()
3 0.001451 0.001219 traces#cmdl_leave()
19 0.001249 <SNR>80_highlight()
2 0.001197 0.000841 <SNR>80_cmdl_enter()
2 0.000356 <SNR>80_save_marks()
3 0.000316 slash#callBlink()
3 0.000282 <SNR>54_t_start()
3 0.000234 slash#SubstituteWordBoundaries()
FUNCTIONS SORTED ON SELF TIME
count total (s) self (s) function
1 88.803143 UpdateMatches()
8 0.029859 0.007149 traces#init()
1 0.005614 0.005578 <SNR>77_OnVimLeave()
8 0.006742 0.005143 <SNR>80_parse_range()
8 0.004262 0.003615 <SNR>80_get_command()
8 0.003435 <SNR>80_skip_modifiers()
8 0.002443 <SNR>80_evaluate_range()
35 0.002246 <SNR>80_trim()
8 0.016763 0.001966 <SNR>80_evaluate_cmdl()
3 0.001775 <SNR>54_t_stop()
10 0.001599 <SNR>54_cmdline_changed()
19 0.001249 <SNR>80_highlight()
3 0.001451 0.001219 traces#cmdl_leave()
2 0.001573 0.001193 <SNR>54_create_cmdl_changed_au()
8 0.005298 0.001036 <SNR>80_parse_command()
2 0.001197 0.000841 <SNR>80_cmdl_enter()
2 0.000356 <SNR>80_save_marks()
3 0.000316 slash#callBlink()
3 0.000282 <SNR>54_t_start()
3 0.000234 slash#SubstituteWordBoundaries()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment