Skip to content

Instantly share code, notes, and snippets.

@stevschmid
Created November 29, 2013 13:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stevschmid/7705755 to your computer and use it in GitHub Desktop.
Save stevschmid/7705755 to your computer and use it in GitHub Desktop.
FUNCTION airline#util#exec_funcrefs()
Called 4 times
Total time: 0.006994
Self time: 0.000127
count total (s) self (s)
10 0.000022 for Fn in a:list
10 0.006934 0.000067 let code = call(Fn, a:000)
10 0.000012 if code != 0
4 0.000004 return code
endif
6 0.000005 endfor
return 0
FUNCTION 256()
Called 1284 times
Total time: 0.003076
Self time: 0.003076
count total (s) self (s)
1284 0.002591 return len(self._rawLoclist)
FUNCTION airline#statusline()
Called 3210 times
Total time: 0.046842
Self time: 0.046842
count total (s) self (s)
3210 0.021248 if has_key(s:contexts, a:winnr)
3210 0.020389 return '%{airline#check_mode('.a:winnr.')}'.s:contexts[a:winnr].line
endif
" in rare circumstances this happens...see #276
return ''
FUNCTION airline#check_mode()
Called 3210 times
Total time: 0.196435
Self time: 0.181183
count total (s) self (s)
3210 0.011560 let context = s:contexts[a:winnr]
3210 0.009493 if get(w:, 'airline_active', 1)
1284 0.003166 let l:m = mode()
1284 0.002259 if l:m ==# "i"
let l:mode = ['insert']
elseif l:m ==# "R"
let l:mode = ['replace']
elseif l:m =~# '\v(v|V||s|S|)'
let l:mode = ['visual']
else
1284 0.002430 let l:mode = ['normal']
1284 0.000860 endif
1284 0.004898 let w:airline_current_mode = get(g:airline_mode_map, l:m, l:m)
1284 0.000810 else
1926 0.003661 let l:mode = ['inactive']
1926 0.006788 let w:airline_current_mode = get(g:airline_mode_map, '__')
1926 0.001277 endif
3210 0.003918 if g:airline_detect_modified
3210 0.005397 if &modified
call add(l:mode, 'modified')
endif
3210 0.001361 endif
3210 0.004716 if g:airline_detect_paste && &paste
call add(l:mode, 'paste')
endif
3210 0.010809 let mode_string = join(l:mode)
3210 0.011222 if get(w:, 'airline_lastmode', '') != mode_string
2 0.000162 0.000017 call airline#highlighter#highlight_modified_inactive(context.bufnr)
2 0.015126 0.000019 call airline#highlighter#highlight(l:mode)
2 0.000006 let w:airline_lastmode = mode_string
2 0.000002 endif
3210 0.002725 return ''
FUNCTION airline#util#append()
Called 2568 times
Total time: 0.026782
Self time: 0.026782
count total (s) self (s)
2568 0.004879 if a:minwidth > 0 && winwidth(0) < a:minwidth
return ''
endif
2568 0.009208 let prefix = s:spc == "\ua0" ? s:spc : s:spc.s:spc
2568 0.007532 return empty(a:text) ? '' : prefix.g:airline_left_alt_sep.s:spc.a:text
FUNCTION <SNR>100_get_buffer_list()
Called 642 times
Total time: 0.036230
Self time: 0.036230
count total (s) self (s)
642 0.000985 let buffers = []
642 0.001520 let cur = bufnr('%')
1926 0.003552 for nr in range(1, bufnr('$'))
1284 0.003130 if buflisted(nr) && bufexists(nr)
642 0.000948 for ex in s:excludes
if match(bufname(nr), ex)
continue
endif
endfor
642 0.002002 if getbufvar(nr, 'current_syntax') == 'qf'
continue
endif
642 0.002083 call add(buffers, nr)
642 0.000455 endif
1284 0.000670 endfor
642 0.001478 let s:current_buffer_list = buffers
642 0.000653 return buffers
FUNCTION airline#themes#get_highlight()
Called 2654 times
Total time: 0.241415
Self time: 0.018808
count total (s) self (s)
2654 0.240425 0.017818 return call('airline#highlighter#get_highlight', [a:group] + a:000)
FUNCTION airline#extensions#default#apply()
Called 4 times
Total time: 0.006504
Self time: 0.000168
count total (s) self (s)
4 0.000006 let winnr = a:context.winnr
4 0.000005 let active = a:context.active
4 0.000037 0.000023 if airline#util#getwinvar(winnr, 'airline_render_left', active || (!active && !g:airline_inactive_collapse))
1 0.000923 0.000005 call <sid>build_sections(a:builder, a:context, s:layout[0])
1 0.000001 else
3 0.000177 0.000015 call a:builder.add_section('airline_c'.(a:context.bufnr), ' %f%m ')
3 0.000002 endif
4 0.000189 0.000035 call a:builder.split(s:get_section(winnr, 'gutter', '', ''))
4 0.000027 0.000015 if airline#util#getwinvar(winnr, 'airline_render_right', 1)
4 0.005102 0.000026 call <sid>build_sections(a:builder, a:context, s:layout[1])
4 0.000003 endif
4 0.000003 return 1
FUNCTION <SNR>81_Highlight_Matching_Pair()
Called 325 times
Total time: 0.031104
Self time: 0.031104
count total (s) self (s)
" Remove any previous match.
325 0.001212 if exists('w:paren_hl_on') && w:paren_hl_on
5 0.000012 3match none
5 0.000008 let w:paren_hl_on = 0
5 0.000001 endif
" Avoid that we remove the popup menu.
" Return when there are no colors (looks like the cursor jumps).
325 0.001160 if pumvisible() || (&t_Co < 8 && !has("gui_running"))
return
endif
" Get the character under the cursor and check if it's in 'matchpairs'.
325 0.000925 let c_lnum = line('.')
325 0.000815 let c_col = col('.')
325 0.000427 let before = 0
325 0.001355 let c = getline(c_lnum)[c_col - 1]
325 0.004399 let plist = split(&matchpairs, '.\zs[:,]')
325 0.001109 let i = index(plist, c)
325 0.000401 if i < 0
" not found, in Insert mode try character before the cursor
320 0.000730 if c_col > 1 && (mode() == 'i' || mode() == 'R')
let before = 1
let c = getline(c_lnum)[c_col - 2]
let i = index(plist, c)
endif
320 0.000250 if i < 0
" not found, nothing to do
320 0.000233 return
endif
endif
" Figure out the arguments for searchpairpos().
5 0.000005 if i % 2 == 0
5 0.000016 let s_flags = 'nW'
5 0.000013 let c2 = plist[i + 1]
5 0.000003 else
let s_flags = 'nbW'
let c2 = c
let c = plist[i - 1]
endif
5 0.000006 if c == '['
3 0.000003 let c = '\['
3 0.000004 let c2 = '\]'
3 0.000002 endif
" Find the match. When it was just before the cursor move it there for a
" moment.
5 0.000004 if before > 0
let save_cursor = winsaveview()
call cursor(c_lnum, c_col - before)
endif
" When not in a string or comment ignore matches inside them.
" We match "escape" for special items, such as lispEscapeSpecial.
5 0.000015 let s_skip ='synIDattr(synID(line("."), col("."), 0), "name") ' . '=~? "string\\|character\\|singlequote\\|escape\\|comment"'
5 0.010557 execute 'if' s_skip '| let s_skip = 0 | endif'
" Limit the search to lines visible in the window.
5 0.000021 let stoplinebottom = line('w$')
5 0.000011 let stoplinetop = line('w0')
5 0.000009 if i % 2 == 0
5 0.000009 let stopline = stoplinebottom
5 0.000003 else
let stopline = stoplinetop
endif
" Limit the search time to 300 msec to avoid a hang on very long lines.
" This fails when a timeout is not supported.
5 0.000015 if mode() == 'i' || mode() == 'R'
let timeout = exists("b:matchparen_insert_timeout") ? b:matchparen_insert_timeout : g:matchparen_insert_timeout
else
5 0.000022 let timeout = exists("b:matchparen_timeout") ? b:matchparen_timeout : g:matchparen_timeout
5 0.000005 endif
5 0.000005 try
5 0.001085 let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip, stopline, timeout)
5 0.000010 catch /E118/
" Can't use the timeout, restrict the stopline a bit more to avoid taking
" a long time on closed folds and long lines.
" The "viewable" variables give a range in which we can scroll while
" keeping the cursor at the same position.
" adjustedScrolloff accounts for very large numbers of scrolloff.
let adjustedScrolloff = min([&scrolloff, (line('w$') - line('w0')) / 2])
let bottom_viewable = min([line('$'), c_lnum + &lines - adjustedScrolloff - 2])
let top_viewable = max([1, c_lnum-&lines+adjustedScrolloff + 2])
" one of these stoplines will be adjusted below, but the current values are
" minimal boundaries within the current window
if i % 2 == 0
if has("byte_offset") && has("syntax_items") && &smc > 0
let stopbyte = min([line2byte("$"), line2byte(".") + col(".") + &smc * 2])
let stopline = min([bottom_viewable, byte2line(stopbyte)])
else
let stopline = min([bottom_viewable, c_lnum + 100])
endif
let stoplinebottom = stopline
else
if has("byte_offset") && has("syntax_items") && &smc > 0
let stopbyte = max([1, line2byte(".") + col(".") - &smc * 2])
let stopline = max([top_viewable, byte2line(stopbyte)])
else
let stopline = max([top_viewable, c_lnum - 100])
endif
let stoplinetop = stopline
endif
let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip, stopline)
endtry
5 0.000005 if before > 0
call winrestview(save_cursor)
endif
" If a match is found setup match highlighting.
5 0.000010 if m_lnum > 0 && m_lnum >= stoplinetop && m_lnum <= stoplinebottom
5 0.000098 exe '3match MatchParen /\(\%' . c_lnum . 'l\%' . (c_col - before) . 'c\)\|\(\%' . m_lnum . 'l\%' . m_col . 'c\)/'
5 0.000010 let w:paren_hl_on = 1
5 0.000004 endif
FUNCTION airline#parts#filetype()
Called 3210 times
Total time: 0.006546
Self time: 0.006546
count total (s) self (s)
3210 0.005053 return &filetype
FUNCTION airline#parts#iminsert()
Called 1284 times
Total time: 0.007232
Self time: 0.007232
count total (s) self (s)
1284 0.002818 if g:airline_detect_iminsert && &iminsert && exists('b:keymap_name')
return toupper(b:keymap_name)
endif
1284 0.000802 return ''
FUNCTION 501()
Called 1945 times
Total time: 0.476513
Self time: 0.133894
count total (s) self (s)
1945 0.003652 if self._curgroup != ''
1299 0.002535 if self._curgroup == a:group
let self._line .= self._side ? self._context.left_alt_sep : self._context.right_alt_sep
else
1299 0.348826 0.006207 call airline#highlighter#add_separator(self._curgroup, a:group, self._side)
1299 0.006069 let self._line .= '%#'.self._curgroup.'_to_'.a:group.'#'
1299 0.004200 let self._line .= self._side ? self._context.left_sep : self._context.right_sep
1299 0.000869 endif
1299 0.000505 endif
1945 0.003477 if self._curgroup != a:group
1945 0.005386 let self._line .= '%#'.a:group.'#'
1945 0.001115 endif
1945 0.002055 if self._context.active
1933 0.002641 let contents = []
1933 0.012053 let content_parts = split(a:contents, '__accent')
3225 0.004766 for cpart in content_parts
1292 0.010590 let accent = matchstr(cpart, '_\zs[^#]*\ze')
1292 0.003752 call add(contents, cpart)
1292 0.001065 endfor
1933 0.006447 let line = join(contents, a:group)
1933 0.011650 let line = substitute(line, '__restore__', a:group, 'g')
1933 0.001440 else
12 0.000110 let line = substitute(a:contents, '%#__accent[^#]*#', '', 'g')
12 0.000075 let line = substitute(line, '%#__restore__#', '', 'g')
12 0.000012 endif
1945 0.003616 let self._line .= line
1945 0.003207 let self._curgroup = a:group
FUNCTION 502()
Called 2 times
Total time: 0.000006
Self time: 0.000006
count total (s) self (s)
2 0.000005 let self._line .= a:text
FUNCTION airline#extensions#apply()
Called 4 times
Total time: 0.000346
Self time: 0.000166
count total (s) self (s)
4 0.000010 let s:active_winnr = winnr()
4 0.000196 0.000016 if s:is_excluded_window()
return -1
endif
4 0.000008 if &buftype == 'help'
call airline#extensions#apply_left_override('Help', '%f')
let w:airline_section_x = ''
let w:airline_section_y = ''
let w:airline_render_right = 1
endif
4 0.000004 if &previewwindow
let w:airline_section_a = 'Preview'
let w:airline_section_b = ''
let w:airline_section_c = bufname(winbufnr(winnr()))
endif
4 0.000017 if has_key(s:filetype_overrides, &ft)
let args = s:filetype_overrides[&ft]
call airline#extensions#apply_left_override(args[0], args[1])
endif
4 0.000012 for item in items(s:filetype_regex_overrides)
if match(&ft, item[0]) >= 0
call airline#extensions#apply_left_override(item[1][0], item[1][1])
endif
endfor
FUNCTION <SNR>64_InTmuxSession()
Called 1 time
Total time: 0.000003
Self time: 0.000003
count total (s) self (s)
1 0.000003 return $TMUX != ''
FUNCTION <SNR>64_VimNavigate()
Called 1 time
Total time: 0.007605
Self time: 0.000016
count total (s) self (s)
1 0.000001 try
1 0.007598 0.000009 execute 'wincmd ' . a:direction
1 0.000001 catch
echohl ErrorMsg | echo 'E11: Invalid in command-line window; <CR> executes, CTRL-C quits: wincmd k' | echohl None
endtry
FUNCTION <SNR>63_invoke_funcrefs()
Called 4 times
Total time: 0.007346
Self time: 0.000137
count total (s) self (s)
4 0.000112 0.000019 let builder = airline#builder#new(a:context)
4 0.007027 0.000033 let err = airline#util#exec_funcrefs(a:funcrefs + s:core_funcrefs, builder, a:context)
4 0.000006 if err == 1
4 0.000141 0.000019 let a:context.line = builder.build()
4 0.000020 let s:contexts[a:context.winnr] = a:context
4 0.000031 call setwinvar(a:context.winnr, '&statusline', '%!airline#statusline('.a:context.winnr.')')
4 0.000002 endif
FUNCTION <SNR>62_on_window_changed()
Called 1 time
Total time: 0.007510
Self time: 0.000016
count total (s) self (s)
1 0.000002 if pumvisible()
return
endif
1 0.000022 0.000006 call <sid>init()
1 0.007485 0.000007 call airline#update_statusline()
FUNCTION airline#util#wrap()
Called 8988 times
Total time: 0.043360
Self time: 0.043360
count total (s) self (s)
8988 0.018443 if a:minwidth > 0 && winwidth(0) < a:minwidth
return ''
endif
8988 0.008017 return a:text
FUNCTION <SNR>102_exec_separator()
Called 1327 times
Total time: 0.329996
Self time: 0.042282
count total (s) self (s)
1327 0.133340 0.008152 let l:from = airline#themes#get_highlight(a:from.a:suffix)
1327 0.122521 0.006294 let l:to = airline#themes#get_highlight(a:to.a:suffix)
1327 0.004657 let group = a:from.'_to_'.a:to.a:suffix
1327 0.001494 if a:inverse
658 0.003053 let colors = [ l:from[1], l:to[1], l:from[3], l:to[3] ]
658 0.000455 else
669 0.002923 let colors = [ l:to[1], l:from[1], l:to[3], l:from[3] ]
669 0.000456 endif
1327 0.003532 let a:dict[group] = colors
1327 0.051901 0.005602 call airline#highlighter#exec(group, colors)
FUNCTION airline#extensions#tabline#get()
Called 642 times
Total time: 0.690127
Self time: 0.007319
count total (s) self (s)
642 0.002437 if s:show_buffers && tabpagenr('$') == 1
642 0.687114 0.004306 return s:get_buffers()
else
return s:get_tabs()
endif
FUNCTION <SNR>64_TmuxAwareNavigate()
Called 1 time
Total time: 0.007632
Self time: 0.000027
count total (s) self (s)
1 0.000003 let nr = winnr()
1 0.000003 let tmux_last_pane = (a:direction == 'p' && s:tmux_is_last_pane)
1 0.000001 if !tmux_last_pane
1 0.007611 0.000006 call s:VimNavigate(a:direction)
1 0.000000 endif
" Forward the switch panes command to tmux if:
" a) we're toggling between the last tmux pane;
" b) we tried switching windows in vim but it didn't have effect.
1 0.000003 if tmux_last_pane || nr == winnr()
let cmd = 'tmux select-pane -' . tr(a:direction, 'phjkl', 'lLDUR')
silent call system(cmd)
let s:tmux_is_last_pane = 1
else
1 0.000002 let s:tmux_is_last_pane = 0
1 0.000001 endif
FUNCTION airline#util#getwinvar()
Called 24 times
Total time: 0.000081
Self time: 0.000081
count total (s) self (s)
24 0.000074 return getwinvar(a:winnr, a:key, a:def)
FUNCTION airline#extensions#whitespace#check()
Called 1284 times
Total time: 0.050751
Self time: 0.050751
count total (s) self (s)
1284 0.003098 if &readonly || !&modifiable || !s:enabled
return ''
endif
1284 0.004010 if !exists('b:airline_whitespace_check')
let b:airline_whitespace_check = ''
let checks = get(g:, 'airline#extensions#whitespace#checks', s:default_checks)
let trailing = 0
if index(checks, 'trailing') > -1
let trailing = search(' $', 'nw')
endif
let mixed = 0
if index(checks, 'indent') > -1
let indents = [search('^ \{2,}', 'nb'), search('^ \{2,}', 'n'), search('^\t', 'nb'), search('^\t', 'n')]
let mixed = indents[0] != 0 && indents[1] != 0 && indents[2] != 0 && indents[3] != 0
endif
if trailing != 0 || mixed
let b:airline_whitespace_check = s:symbol
if s:show_message
if trailing != 0
let b:airline_whitespace_check .= (g:airline_symbols.space).printf(s:trailing_format, trailing)
endif
if mixed
let mixnr = indents[0] == indents[1] ? indents[0] : indents[2]
let b:airline_whitespace_check .= (g:airline_symbols.space).printf(s:mixed_indent_format, mixnr)
endif
endif
endif
endif
1284 0.001813 return b:airline_whitespace_check
FUNCTION <SNR>100_get_visible_buffers()
Called 642 times
Total time: 0.131970
Self time: 0.044533
count total (s) self (s)
642 0.038979 0.002749 let buffers = s:get_buffer_list()
642 0.001411 let cur = bufnr('%')
642 0.000920 let total_width = 0
642 0.000897 let max_width = 0
1284 0.001411 for nr in buffers
642 0.055086 0.003879 let width = len(airline#extensions#tabline#get_buffer_name(nr)) + 4
642 0.001325 let total_width += width
642 0.002165 let max_width = max([max_width, width])
642 0.000442 endfor
" only show current and surrounding buffers if there are too many buffers
642 0.001743 let position = index(buffers, cur)
642 0.001193 let vimwidth = &columns
642 0.001119 if total_width > vimwidth && position > -1
let buf_count = len(buffers)
" determine how many buffers to show based on the longest buffer width,
" use one on the right side and put the rest on the left
let buf_max = vimwidth / max_width
let buf_right = 1
let buf_left = max([0, buf_max - buf_right])
let start = max([0, position - buf_left])
let end = min([buf_count, position + buf_right])
" fill up available space on the right
if position < buf_left
let end += (buf_left - position)
endif
" fill up available space on the left
if end > buf_count - 1 - buf_right
let start -= max([0, buf_right - (buf_count - 1 - position)])
endif
let buffers = eval('buffers[' . start . ':' . end . ']')
if start > 0
call insert(buffers, -1, 0)
endif
if end < buf_count - 1
call add(buffers, -1)
endif
endif
642 0.000600 return buffers
FUNCTION airline#highlighter#highlight()
Called 2 times
Total time: 0.015107
Self time: 0.004597
count total (s) self (s)
2 0.000006 let p = g:airline#themes#{g:airline_theme}#palette
" draw the base mode, followed by any overrides
2 0.000014 let mapped = map(a:modes, 'v:val == a:modes[0] ? v:val : a:modes[0]."_".v:val')
2 0.000006 let suffix = a:modes[0] == 'inactive' ? '_inactive' : ''
4 0.000006 for mode in mapped
2 0.000010 if exists('g:airline#themes#{g:airline_theme}#palette[mode]')
2 0.000008 let dict = g:airline#themes#{g:airline_theme}#palette[mode]
44 0.000079 for kvp in items(dict)
42 0.000087 let mode_colors = kvp[1]
42 0.001449 0.000218 call airline#highlighter#exec(kvp[0].suffix, mode_colors)
126 0.000200 for accent in keys(s:accents)
84 0.000172 if !has_key(p.accents, accent)
continue
endif
84 0.000279 let colors = copy(mode_colors)
84 0.000209 if p.accents[accent][0] != ''
let colors[0] = p.accents[accent][0]
endif
84 0.000175 if p.accents[accent][2] != ''
42 0.000118 let colors[2] = p.accents[accent][2]
42 0.000031 endif
84 0.000122 if len(colors) >= 5
24 0.000083 let colors[4] = get(p.accents[accent], 4, '')
24 0.000018 else
60 0.000206 call add(colors, get(p.accents[accent], 4, ''))
60 0.000040 endif
84 0.003051 0.000472 call airline#highlighter#exec(kvp[0].suffix.'_'.accent, colors)
84 0.000063 endfor
42 0.000030 endfor
" TODO: optimize this
30 0.000052 for sep in items(s:separators)
28 0.006968 0.000268 call <sid>exec_separator(dict, sep[1][0], sep[1][1], sep[1][2], suffix)
28 0.000032 endfor
2 0.000000 endif
2 0.000002 endfor
FUNCTION airline#parts#ffenc()
Called 642 times
Total time: 0.007735
Self time: 0.007735
count total (s) self (s)
642 0.007401 return printf('%s%s', &fenc, strlen(&ff) > 0 ? '['.&ff.']' : '')
FUNCTION <SNR>108_wrap_name()
Called 1284 times
Total time: 0.016468
Self time: 0.016468
count total (s) self (s)
1284 0.004259 let _ = s:buf_nr_show ? printf(s:buf_nr_format, a:bufnr) : ''
1284 0.003060 let _ .= a:buffer_name
1284 0.004091 if getbufvar(a:bufnr, '&modified') == 1
let _ .= s:buf_modified_symbol
endif
1284 0.001147 return _
FUNCTION airline#extensions#ctrlp#apply()
Called 1 time
Total time: 0.000007
Self time: 0.000007
count total (s) self (s)
" disable statusline overwrite if ctrlp already did it
1 0.000006 return match(&statusline, 'CtrlPwhite') >= 0 ? -1 : 0
FUNCTION <SNR>107_build_sections()
Called 5 times
Total time: 0.005994
Self time: 0.000227
count total (s) self (s)
24 0.000028 for key in a:keys
19 0.000038 if key == 'warning' && !a:context.active
3 0.000003 continue
endif
16 0.005847 0.000080 call s:add_section(a:builder, a:context, key)
16 0.000014 endfor
FUNCTION <SNR>107_get_section()
Called 20 times
Total time: 0.000535
Self time: 0.000480
count total (s) self (s)
20 0.000052 if has_key(s:section_truncate_width, a:key)
13 0.000039 if winwidth(a:winnr) < s:section_truncate_width[a:key]
4 0.000004 return ''
endif
9 0.000001 endif
16 0.000025 let spc = g:airline_symbols.space
16 0.000177 0.000122 let text = airline#util#getwinvar(a:winnr, 'airline_section_'.a:key, g:airline_section_{a:key})
16 0.000106 let [prefix, suffix] = [get(a:000, 0, '%('.spc), get(a:000, 1, spc.'%)')]
16 0.000055 return empty(text) ? '' : prefix.text.suffix
FUNCTION <SNR>107_add_section()
Called 16 times
Total time: 0.005767
Self time: 0.000313
count total (s) self (s)
" i have no idea why the warning section needs special treatment, but it's
" needed to prevent separators from showing up
16 0.000028 if a:key == 'warning'
1 0.000008 0.000005 call a:builder.add_raw('%(')
1 0.000000 endif
16 0.005593 0.000145 call a:builder.add_section('airline_'.a:key, s:get_section(a:context.winnr, a:key))
16 0.000031 if a:key == 'warning'
1 0.000007 0.000004 call a:builder.add_raw('%)')
1 0.000001 endif
FUNCTION airline#parts#paste()
Called 1284 times
Total time: 0.003749
Self time: 0.003749
count total (s) self (s)
1284 0.003209 return g:airline_detect_paste && &paste ? g:airline_symbols.paste : ''
FUNCTION airline#update_statusline()
Called 1 time
Total time: 0.007478
Self time: 0.000132
count total (s) self (s)
4 0.000015 for nr in filter(range(1, winnr('$')), 'v:val != winnr()')
3 0.000011 call setwinvar(nr, 'airline_active', 0)
3 0.000015 let context = { 'winnr': nr, 'active': 0, 'bufnr': winbufnr(nr) }
3 0.004591 0.000024 call s:invoke_funcrefs(context, s:inactive_funcrefs)
3 0.000006 endfor
1 0.000002 unlet! w:airline_render_left
1 0.000001 unlet! w:airline_render_right
9 0.000009 for section in s:sections
8 0.000017 unlet! w:airline_section_{section}
8 0.000006 endfor
1 0.000002 let w:airline_active = 1
1 0.000005 let context = { 'winnr': winnr(), 'active': 1, 'bufnr': winbufnr(winnr()) }
1 0.002786 0.000007 call s:invoke_funcrefs(context, g:airline_statusline_funcrefs)
FUNCTION airline#parts#readonly()
Called 1284 times
Total time: 0.003137
Self time: 0.003137
count total (s) self (s)
1284 0.002568 return &readonly ? g:airline_symbols.readonly : ''
FUNCTION <SNR>93_sync_active_winnr()
Called 324 times
Total time: 0.002672
Self time: 0.002672
count total (s) self (s)
324 0.001616 if exists('#airline') && winnr() != s:active_winnr
call airline#update_statusline()
endif
FUNCTION airline#highlighter#exec()
Called 1455 times
Total time: 0.050193
Self time: 0.050193
count total (s) self (s)
1455 0.002327 let colors = a:colors
1455 0.001659 if s:is_win32term
let colors[2] = s:gui2cui(get(colors, 0, ''), get(colors, 2, ''))
let colors[3] = s:gui2cui(get(colors, 1, ''), get(colors, 3, ''))
endif
1455 0.034624 exec printf('hi %s %s %s %s %s %s %s %s', a:group, get(colors, 0, '') != '' ? 'guifg='.colors[0] : '', get(colors, 1, '') != '' ? 'guibg='.colors[1] : '', get(colors, 2, '') != '' ? 'ctermfg='.colors[2] : '', get(colors, 3, '') != '' ? 'ctermbg='.colors[3] : '', get(colors, 4, '') != '' ? 'gui='.colors[4] : '', get(colors, 4, '') != '' ? 'cterm='.colors[4] : '', get(colors, 4, '') != '' ? 'term='.colors[4] : '')
FUNCTION airline#extensions#tabline#formatters#unique_tail()
Called 1284 times
Total time: 0.089213
Self time: 0.072745
count total (s) self (s)
1284 0.002401 let duplicates = {}
1284 0.001640 let tails = {}
1284 0.001493 let map = {}
2568 0.003086 for nr in a:buffers
1284 0.003073 let name = bufname(nr)
1284 0.002378 if empty(name)
let map[nr] = '[No Name]'
else
1284 0.003955 let tail = fnamemodify(name, ':t')
1284 0.002871 if has_key(tails, tail)
let duplicates[nr] = nr
endif
1284 0.002789 let tails[tail] = 1
1284 0.026257 0.009789 let map[nr] = s:wrap_name(nr, tail)
1284 0.000986 endif
1284 0.000691 endfor
1284 0.003143 for nr in values(duplicates)
let map[nr] = s:wrap_name(nr, fnamemodify(bufname(nr), ':p:.'))
endfor
1284 0.002499 return map[a:bufnr]
FUNCTION <SNR>102_get_array()
Called 2654 times
Total time: 0.027126
Self time: 0.027126
count total (s) self (s)
2654 0.004217 let fg = a:fg
2654 0.003456 let bg = a:bg
2654 0.017572 return has('gui_running') ? [ fg, bg, '', '', join(a:opts, ',') ] : [ '', '', fg, bg, join(a:opts, ',') ]
FUNCTION <SNR>100_get_buffers()
Called 642 times
Total time: 0.682808
Self time: 0.054662
count total (s) self (s)
642 0.019697 0.002887 let b = airline#builder#new(s:builder_context)
642 0.001922 let cur = bufnr('%')
642 0.002306 let tab_bufs = tabpagebuflist(tabpagenr())
1284 0.135824 0.003854 for nr in s:get_visible_buffers()
642 0.000776 if nr < 0
call b.add_raw('%#airline_tabhid#...')
continue
endif
642 0.000687 if cur == nr
642 0.001947 if g:airline_detect_modified && getbufvar(nr, '&modified')
let group = 'airline_tabmod'
else
642 0.000954 let group = 'airline_tabsel'
642 0.000748 endif
642 0.000321 else
if index(tab_bufs, nr) > -1
let group = 'airline_tab'
else
let group = 'airline_tabhid'
endif
endif
642 0.052779 0.005907 call b.add_section(group, s:spc.'%(%{airline#extensions#tabline#get_buffer_name('.nr.')}%)'.s:spc)
642 0.000467 endfor
642 0.217345 0.002951 call b.add_section('airline_tabfill', '')
642 0.007402 0.003327 call b.split()
642 0.213194 0.003150 call b.add_section('airline_tabtype', ' buffers ')
642 0.006307 0.002326 return b.build()
FUNCTION airline#extensions#quickfix#apply()
Called 1 time
Total time: 0.000010
Self time: 0.000010
count total (s) self (s)
1 0.000002 if &buftype == 'quickfix'
let w:airline_section_a = s:get_text()
let w:airline_section_b = '%{get(w:, "quickfix_title", "")}'
let w:airline_section_c = ''
let w:airline_section_x = ''
endif
FUNCTION <SNR>93_is_excluded_window()
Called 4 times
Total time: 0.000180
Self time: 0.000180
count total (s) self (s)
4 0.000008 for matchft in g:airline_exclude_filetypes
if matchft ==# &ft
return 1
endif
endfor
16 0.000020 for matchw in g:airline_exclude_filenames
12 0.000073 if matchstr(expand('%'), matchw) ==# matchw
return 1
endif
12 0.000005 endfor
4 0.000005 if g:airline_exclude_preview && &previewwindow
return 1
endif
4 0.000003 return 0
FUNCTION airline#highlighter#add_separator()
Called 1299 times
Total time: 0.342619
Self time: 0.019323
count total (s) self (s)
1299 0.007019 let s:separators[a:from.a:to] = [a:from, a:to, a:inverse]
1299 0.334723 0.011427 call <sid>exec_separator({}, a:from, a:to, a:inverse, '')
FUNCTION <SNR>102_get_syn()
Called 5308 times
Total time: 0.133131
Self time: 0.133131
count total (s) self (s)
" need to pass in mode, known to break on 7.3.547
5308 0.021180 let mode = has('gui_running') ? 'gui' : 'cterm'
5308 0.031867 let color = synIDattr(synIDtrans(hlID(a:group)), a:what, mode)
5308 0.012331 if empty(color) || color == -1
36 0.000215 let color = synIDattr(synIDtrans(hlID('Normal')), a:what, mode)
36 0.000026 endif
5308 0.009838 if empty(color) || color == -1
if has('gui_running')
let color = a:what ==# 'fg' ? '#000000' : '#FFFFFF'
else
let color = a:what ==# 'fg' ? 0 : 1
endif
endif
5308 0.004504 return color
FUNCTION airline#extensions#tabline#get_buffer_name()
Called 1284 times
Total time: 0.101720
Self time: 0.012507
count total (s) self (s)
1284 0.101199 0.011986 return airline#extensions#tabline#formatters#{s:formatter}(a:nr, get(s:, 'current_buffer_list', []))
FUNCTION 250()
Called 1284 times
Total time: 0.010819
Self time: 0.010819
count total (s) self (s)
1284 0.004523 if !exists("b:syntastic_loclist")
let b:syntastic_loclist = g:SyntasticLoclist.New([])
endif
1284 0.001577 return b:syntastic_loclist
FUNCTION 253()
Called 1284 times
Total time: 0.005207
Self time: 0.005207
count total (s) self (s)
1284 0.004673 return copy(self._quietWarnings ? self.errors() : self._rawLoclist)
FUNCTION <SNR>64_TmuxWinCmd()
Called 1 time
Total time: 0.007657
Self time: 0.000022
count total (s) self (s)
1 0.000011 0.000008 if s:InTmuxSession()
1 0.007641 0.000009 call s:TmuxAwareNavigate(a:direction)
1 0.000000 else
call s:VimNavigate(a:direction)
endif
FUNCTION 260()
Called 1284 times
Total time: 0.004221
Self time: 0.004221
count total (s) self (s)
1284 0.001781 if self._hasErrorsOrWarningsToDisplay >= 0
1284 0.001596 return self._hasErrorsOrWarningsToDisplay
endif
let self._hasErrorsOrWarningsToDisplay = empty(self._rawLoclist) ? 0 : (!self._quietWarnings || len(self.errors()))
return self._hasErrorsOrWarningsToDisplay
FUNCTION airline#highlighter#get_highlight()
Called 2654 times
Total time: 0.222607
Self time: 0.062350
count total (s) self (s)
2654 0.082494 0.012742 let fg = s:get_syn(a:group, 'fg')
2654 0.075085 0.011706 let bg = s:get_syn(a:group, 'bg')
2654 0.019839 let reverse = synIDattr(synIDtrans(hlID(a:group)), 'reverse', has('gui_running') ? 'gui' : 'term')
2654 0.042882 0.015756 return reverse ? s:get_array(bg, fg, a:000) : s:get_array(fg, bg, a:000)
FUNCTION airline#extensions#syntastic#get_warnings()
Called 1284 times
Total time: 0.102272
Self time: 0.013768
count total (s) self (s)
1284 0.094477 0.005973 let errors = SyntasticStatuslineFlag()
1284 0.003072 if strlen(errors) > 0
return errors.(g:airline_symbols.space)
endif
1284 0.000777 return ''
FUNCTION airline#parts#mode()
Called 1284 times
Total time: 0.004350
Self time: 0.004350
count total (s) self (s)
1284 0.003649 return get(w:, 'airline_current_mode', '')
FUNCTION 503()
Called 646 times
Total time: 0.004103
Self time: 0.004103
count total (s) self (s)
646 0.000936 if !self._context.active
3 0.000103 let self._line = substitute(self._line, '%#.\{-}\ze#', '\0_inactive', 'g')
3 0.000003 endif
646 0.000827 return self._line
FUNCTION airline#highlighter#highlight_modified_inactive()
Called 2 times
Total time: 0.000145
Self time: 0.000061
count total (s) self (s)
2 0.000008 if getbufvar(a:bufnr, '&modified')
let colors = exists('g:airline#themes#{g:airline_theme}#palette.inactive_modified.airline_c') ? g:airline#themes#{g:airline_theme}#palette.inactive_modified.airline_c : []
else
2 0.000019 let colors = exists('g:airline#themes#{g:airline_theme}#palette.inactive.airline_c') ? g:airline#themes#{g:airline_theme}#palette.inactive.airline_c : []
2 0.000002 endif
2 0.000004 if !empty(colors)
2 0.000097 0.000013 call airline#highlighter#exec('airline_c'.(a:bufnr).'_inactive', colors)
2 0.000002 endif
FUNCTION 499()
Called 646 times
Total time: 0.004101
Self time: 0.004101
count total (s) self (s)
646 0.001093 let self._side = 0
646 0.002517 let self._line .= '%#'.self._curgroup.'#'.(a:0 ? a:1 : '%=')
FUNCTION SyntasticStatuslineFlag()
Called 1284 times
Total time: 0.088504
Self time: 0.065181
count total (s) self (s)
1284 0.017638 0.006819 let loclist = g:SyntasticLoclist.current()
1284 0.010023 0.004816 let issues = loclist.filteredRaw()
1284 0.008043 0.004967 let num_issues = loclist.getLength()
1284 0.007872 0.003651 if loclist.hasErrorsOrWarningsToDisplay()
let errors = loclist.errors()
let warnings = loclist.warnings()
let num_errors = len(errors)
let num_warnings = len(warnings)
let output = g:syntastic_stl_format
"hide stuff wrapped in %E(...) unless there are errors
let output = substitute(output, '\m\C%E{\([^}]*\)}', num_errors ? '\1' : '' , 'g')
"hide stuff wrapped in %W(...) unless there are warnings
let output = substitute(output, '\m\C%W{\([^}]*\)}', num_warnings ? '\1' : '' , 'g')
"hide stuff wrapped in %B(...) unless there are both errors and warnings
let output = substitute(output, '\m\C%B{\([^}]*\)}', (num_warnings && num_errors) ? '\1' : '' , 'g')
"sub in the total errors/warnings/both
let output = substitute(output, '\m\C%w', num_warnings, 'g')
let output = substitute(output, '\m\C%e', num_errors, 'g')
let output = substitute(output, '\m\C%t', num_issues, 'g')
"first error/warning line num
let output = substitute(output, '\m\C%F', num_issues ? issues[0]['lnum'] : '', 'g')
"first error line num
let output = substitute(output, '\m\C%fe', num_errors ? errors[0]['lnum'] : '', 'g')
"first warning line num
let output = substitute(output, '\m\C%fw', num_warnings ? warnings[0]['lnum'] : '', 'g')
return output
else
1284 0.000899 return ''
endif
FUNCTION <SNR>62_init()
Called 1 time
Total time: 0.000016
Self time: 0.000016
count total (s) self (s)
1 0.000002 if !s:airline_initialized
let s:airline_initialized = 1
call airline#init#bootstrap()
call airline#extensions#load()
call airline#init#sections()
let s:airline_theme_defined = exists('g:airline_theme')
if s:airline_theme_defined || !airline#switch_matching_theme()
let g:airline_theme = get(g:, 'airline_theme', 'dark')
call airline#switch_theme(g:airline_theme)
endif
endif
FUNCTION airline#builder#new()
Called 646 times
Total time: 0.016903
Self time: 0.016903
count total (s) self (s)
646 0.003536 let builder = copy(s:prototype)
646 0.001693 let builder._context = a:context
646 0.001100 let builder._side = 1
646 0.001044 let builder._curgroup = ''
646 0.000926 let builder._line = ''
646 0.006284 call extend(builder._context, { 'left_sep': g:airline_left_sep, 'left_alt_sep': g:airline_left_alt_sep, 'right_sep': g:airline_right_sep, 'right_alt_sep': g:airline_right_alt_sep, }, 'keep')
646 0.000791 return builder
FUNCTIONS SORTED ON TOTAL TIME
count total (s) self (s) function
642 0.690127 0.007319 airline#extensions#tabline#get()
642 0.682808 0.054662 <SNR>100_get_buffers()
1945 0.476513 0.133894 501()
1299 0.342619 0.019323 airline#highlighter#add_separator()
1327 0.329996 0.042282 <SNR>102_exec_separator()
2654 0.241415 0.018808 airline#themes#get_highlight()
2654 0.222607 0.062350 airline#highlighter#get_highlight()
3210 0.196435 0.181183 airline#check_mode()
5308 0.133131 <SNR>102_get_syn()
642 0.131970 0.044533 <SNR>100_get_visible_buffers()
1284 0.102272 0.013768 airline#extensions#syntastic#get_warnings()
1284 0.101720 0.012507 airline#extensions#tabline#get_buffer_name()
1284 0.089213 0.072745 airline#extensions#tabline#formatters#unique_tail()
1284 0.088504 0.065181 SyntasticStatuslineFlag()
1284 0.050751 airline#extensions#whitespace#check()
1455 0.050193 airline#highlighter#exec()
3210 0.046842 airline#statusline()
8988 0.043360 airline#util#wrap()
642 0.036230 <SNR>100_get_buffer_list()
325 0.031104 <SNR>81_Highlight_Matching_Pair()
FUNCTIONS SORTED ON SELF TIME
count total (s) self (s) function
3210 0.196435 0.181183 airline#check_mode()
1945 0.476513 0.133894 501()
5308 0.133131 <SNR>102_get_syn()
1284 0.089213 0.072745 airline#extensions#tabline#formatters#unique_tail()
1284 0.088504 0.065181 SyntasticStatuslineFlag()
2654 0.222607 0.062350 airline#highlighter#get_highlight()
642 0.682808 0.054662 <SNR>100_get_buffers()
1284 0.050751 airline#extensions#whitespace#check()
1455 0.050193 airline#highlighter#exec()
3210 0.046842 airline#statusline()
642 0.131970 0.044533 <SNR>100_get_visible_buffers()
8988 0.043360 airline#util#wrap()
1327 0.329996 0.042282 <SNR>102_exec_separator()
642 0.036230 <SNR>100_get_buffer_list()
325 0.031104 <SNR>81_Highlight_Matching_Pair()
2654 0.027126 <SNR>102_get_array()
2568 0.026782 airline#util#append()
1299 0.342619 0.019323 airline#highlighter#add_separator()
2654 0.241415 0.018808 airline#themes#get_highlight()
646 0.016903 airline#builder#new()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment