Created
December 16, 2013 04:45
-
-
Save justinmk/7982440 to your computer and use it in GitHub Desktop.
vim-airline issue #326, profile #1, inserting text "awefawefoiawejfoaiwejfoaiwefawefawefawefawefawe" in .vimrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FUNCTION AutoPairsSpace() | |
Called 2 times | |
Total time: 0.000123 | |
Self time: 0.000123 | |
count total (s) self (s) | |
2 0.000030 let line = getline('.') | |
2 0.000024 let prev_char = line[col('.')-2] | |
2 0.000005 let cmd = '' | |
2 0.000013 let cur_char =line[col('.')-1] | |
2 0.000017 if has_key(g:AutoPairsParens, prev_char) && g:AutoPairsParens[prev_char] == cur_char | |
let cmd = "\<SPACE>\<LEFT>" | |
endif | |
2 0.000014 return "\<SPACE>".cmd | |
FUNCTION airline#check_mode() | |
Called 371 times | |
Total time: 0.220209 | |
Self time: 0.027951 | |
count total (s) self (s) | |
371 0.001800 let context = s:contexts[a:winnr] | |
371 0.001433 if get(w:, 'airline_active', 1) | |
149 0.000516 let l:m = mode() | |
149 0.000603 if l:m ==# "i" | |
119 0.000339 let l:mode = ['insert'] | |
119 0.000198 elseif l:m ==# "R" | |
let l:mode = ['replace'] | |
elseif l:m =~# '\v(v|V||s|S|)' | |
6 0.000021 let l:mode = ['visual'] | |
6 0.000007 else | |
24 0.000069 let l:mode = ['normal'] | |
24 0.000024 endif | |
149 0.000891 let w:airline_current_mode = get(g:airline_mode_map, l:m, l:m) | |
149 0.000124 else | |
222 0.000570 let l:mode = ['inactive'] | |
222 0.001061 let w:airline_current_mode = get(g:airline_mode_map, '__') | |
222 0.000198 endif | |
371 0.000602 if g:airline_detect_modified | |
371 0.000793 if &modified | |
140 0.000656 call add(l:mode, 'modified') | |
140 0.000112 endif | |
371 0.000222 endif | |
371 0.000749 if g:airline_detect_paste && &paste | |
call add(l:mode, 'paste') | |
endif | |
371 0.001698 let mode_string = join(l:mode) | |
371 0.001819 if get(w:, 'airline_lastmode', '') != mode_string | |
7 0.000994 0.000061 call airline#highlighter#highlight_modified_inactive(context.bufnr) | |
7 0.191421 0.000096 call airline#highlighter#highlight(l:mode) | |
7 0.000026 let w:airline_lastmode = mode_string | |
7 0.000007 endif | |
371 0.000402 return '' | |
FUNCTION <SNR>93_Highlight_Matching_Pair() | |
Called 45 times | |
Total time: 0.004953 | |
Self time: 0.004953 | |
count total (s) self (s) | |
" Remove any previous match. | |
45 0.000324 if exists('w:paren_hl_on') && w:paren_hl_on | |
3match none | |
let w:paren_hl_on = 0 | |
endif | |
" Avoid that we remove the popup menu. | |
" Return when there are no colors (looks like the cursor jumps). | |
45 0.000483 if pumvisible() || (&t_Co < 8 && !has("gui_running")) | |
return | |
endif | |
" Get the character under the cursor and check if it's in 'matchpairs'. | |
45 0.000210 let c_lnum = line('.') | |
45 0.000168 let c_col = col('.') | |
45 0.000088 let before = 0 | |
45 0.000299 let c = getline(c_lnum)[c_col - 1] | |
45 0.001287 let plist = split(&matchpairs, '.\zs[:,]') | |
45 0.000239 let i = index(plist, c) | |
45 0.000086 if i < 0 | |
" not found, in Insert mode try character before the cursor | |
45 0.000243 if c_col > 1 && (mode() == 'i' || mode() == 'R') | |
34 0.000071 let before = 1 | |
34 0.000191 let c = getline(c_lnum)[c_col - 2] | |
34 0.000123 let i = index(plist, c) | |
34 0.000031 endif | |
45 0.000059 if i < 0 | |
" not found, nothing to do | |
45 0.000053 return | |
endif | |
endif | |
" Figure out the arguments for searchpairpos(). | |
if i % 2 == 0 | |
let s_flags = 'nW' | |
let c2 = plist[i + 1] | |
else | |
let s_flags = 'nbW' | |
let c2 = c | |
let c = plist[i - 1] | |
endif | |
if c == '[' | |
let c = '\[' | |
let c2 = '\]' | |
endif | |
" Find the match. When it was just before the cursor move it there for a | |
" moment. | |
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. | |
let s_skip ='synIDattr(synID(line("."), col("."), 0), "name") ' . '=~? "string\\|character\\|singlequote\\|escape\\|comment"' | |
execute 'if' s_skip '| let s_skip = 0 | endif' | |
" Limit the search to lines visible in the window. | |
let stoplinebottom = line('w$') | |
let stoplinetop = line('w0') | |
if i % 2 == 0 | |
let stopline = stoplinebottom | |
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. | |
if mode() == 'i' || mode() == 'R' | |
let timeout = exists("b:matchparen_insert_timeout") ? b:matchparen_insert_timeout : g:matchparen_insert_timeout | |
else | |
let timeout = exists("b:matchparen_timeout") ? b:matchparen_timeout : g:matchparen_timeout | |
endif | |
try | |
let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip, stopline, timeout) | |
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 | |
if before > 0 | |
call winrestview(save_cursor) | |
endif | |
" If a match is found setup match highlighting. | |
if m_lnum > 0 && m_lnum >= stoplinetop && m_lnum <= stoplinebottom | |
exe '3match MatchParen /\(\%' . c_lnum . 'l\%' . (c_col - before) . 'c\)\|\(\%' . m_lnum . 'l\%' . m_col . 'c\)/' | |
let w:paren_hl_on = 1 | |
endif | |
FUNCTION airline#util#append() | |
Called 298 times | |
Total time: 0.004429 | |
Self time: 0.004429 | |
count total (s) self (s) | |
298 0.000833 if a:minwidth > 0 && winwidth(0) < a:minwidth | |
return '' | |
endif | |
298 0.001597 let prefix = s:spc == "\ua0" ? s:spc : s:spc.s:spc | |
298 0.001210 return empty(a:text) ? '' : prefix.g:airline_left_alt_sep.s:spc.a:text | |
FUNCTION <SNR>125_wrap_name() | |
Called 238 times | |
Total time: 0.005005 | |
Self time: 0.005005 | |
count total (s) self (s) | |
238 0.001656 let _ = s:buf_nr_show ? printf(s:buf_nr_format, a:bufnr) : '' | |
238 0.000721 let _ .= a:buffer_name | |
238 0.001105 if getbufvar(a:bufnr, '&modified') == 1 | |
113 0.000370 let _ .= s:buf_modified_symbol | |
113 0.000090 endif | |
238 0.000300 return _ | |
FUNCTION airline#themes#get_highlight() | |
Called 1394 times | |
Total time: 0.207803 | |
Self time: 0.014589 | |
count total (s) self (s) | |
1394 0.206987 0.013773 return call('airline#highlighter#get_highlight', [a:group] + a:000) | |
FUNCTION airline#parts#ffenc() | |
Called 111 times | |
Total time: 0.002212 | |
Self time: 0.002212 | |
count total (s) self (s) | |
111 0.002121 return printf('%s%s', &fenc, strlen(&ff) > 0 ? '['.&ff.']' : '') | |
FUNCTION <SNR>111_on_cursormove() | |
Called 6 times | |
Total time: 0.000106 | |
Self time: 0.000106 | |
count total (s) self (s) | |
6 0.000022 if a:total_count >= a:min_count | |
6 0.000020 if &showtabline != 2 | |
set showtabline=2 | |
endif | |
6 0.000006 else | |
if &showtabline != 0 | |
set showtabline=0 | |
endif | |
endif | |
FUNCTION <SNR>113_exec_separator() | |
Called 697 times | |
Total time: 0.294048 | |
Self time: 0.031955 | |
count total (s) self (s) | |
697 0.112369 0.005335 let l:from = airline#themes#get_highlight(a:from.a:suffix) | |
697 0.105816 0.005047 let l:to = airline#themes#get_highlight(a:to.a:suffix) | |
697 0.003413 let group = a:from.'_to_'.a:to.a:suffix | |
697 0.001046 if a:inverse | |
329 0.002277 let colors = [ l:from[1], l:to[1], l:from[3], l:to[3] ] | |
329 0.000328 else | |
368 0.002352 let colors = [ l:to[1], l:from[1], l:to[3], l:from[3] ] | |
368 0.000318 endif | |
697 0.002817 let a:dict[group] = colors | |
697 0.058954 0.004664 call airline#highlighter#exec(group, colors) | |
FUNCTION GetVimIndentIntern() | |
Called 4 times | |
Total time: 0.001633 | |
Self time: 0.001633 | |
count total (s) self (s) | |
" Find a non-blank line above the current line. | |
4 0.000053 let lnum = prevnonblank(v:lnum - 1) | |
" If the current line doesn't start with '\' and below a line that starts | |
" with '\', use the indent of the line above it. | |
4 0.000133 if getline(v:lnum) !~ '^\s*\\' | |
19 0.000291 while lnum > 0 && getline(lnum) =~ '^\s*\\' | |
17 0.000103 let lnum = lnum - 1 | |
17 0.000040 endwhile | |
2 0.000004 endif | |
" At the start of the file use zero indent. | |
4 0.000010 if lnum == 0 | |
return 0 | |
endif | |
" Add a 'shiftwidth' after :if, :while, :try, :catch, :finally, :function | |
" and :else. Add it three times for a line that starts with '\' after | |
" a line that doesn't (or g:vim_indent_cont if it exists). | |
4 0.000025 let ind = indent(lnum) | |
4 0.000071 if getline(v:lnum) =~ '^\s*\\' && v:lnum > 1 && getline(lnum) !~ '^\s*\\' | |
if exists("g:vim_indent_cont") | |
let ind = ind + g:vim_indent_cont | |
else | |
let ind = ind + &sw * 3 | |
endif | |
elseif getline(lnum) =~ '^\s*aug\%[roup]' && getline(lnum) !~ '^\s*aug\%[roup]\s*!\=\s\+END' | |
let ind = ind + &sw | |
else | |
4 0.000022 let line = getline(lnum) | |
4 0.000168 let i = match(line, '\(^\||\)\s*\(if\|wh\%[ile]\|for\|try\|cat\%[ch]\|fina\%[lly]\|fu\%[nction]\|el\%[seif]\)\>') | |
4 0.000013 if i >= 0 | |
let ind += &sw | |
if strpart(line, i, 1) == '|' && has('syntax_items') && synIDattr(synID(lnum, i, 1), "name") =~ '\(Comment\|String\)$' | |
let ind -= &sw | |
endif | |
endif | |
4 0.000003 endif | |
" If the previous line contains an "end" after a pipe, but not in an ":au" | |
" command. And not when there is a backslash before the pipe. | |
" And when syntax HL is enabled avoid a match inside a string. | |
4 0.000021 let line = getline(lnum) | |
4 0.000093 let i = match(line, '[^\\]|\s*\(ene\@!\)') | |
4 0.000013 if i > 0 && line !~ '^\s*au\%[tocmd]' | |
if !has('syntax_items') || synIDattr(synID(lnum, i + 2, 1), "name") !~ '\(Comment\|String\)$' | |
let ind = ind - &sw | |
endif | |
endif | |
" Subtract a 'shiftwidth' on a :endif, :endwhile, :catch, :finally, :endtry, | |
" :endfun, :else and :augroup END. | |
4 0.000097 if getline(v:lnum) =~ '^\s*\(ene\@!\|cat\|fina\|el\|aug\%[roup]\s*!\=\s\+END\)' | |
let ind = ind - &sw | |
endif | |
4 0.000011 return ind | |
FUNCTION airline#parts#filetype() | |
Called 371 times | |
Total time: 0.001142 | |
Self time: 0.001142 | |
count total (s) self (s) | |
371 0.000881 return &filetype | |
FUNCTION airline#parts#iminsert() | |
Called 149 times | |
Total time: 0.001222 | |
Self time: 0.001222 | |
count total (s) self (s) | |
149 0.000465 if g:airline_detect_iminsert && &iminsert && exists('b:keymap_name') | |
return toupper(b:keymap_name) | |
endif | |
149 0.000130 return '' | |
FUNCTION <SNR>124_add_register() | |
Called 6 times | |
Total time: 0.000190 | |
Self time: 0.000190 | |
count total (s) self (s) | |
6 0.000076 let reg = [getreg(a:name), getregtype(a:name)] | |
6 0.000050 if get(s:prev_registers, a:name, []) ==# reg | |
" Skip same register value. | |
5 0.000007 return | |
endif | |
1 0.000010 let len_history = len(reg[0]) | |
" Ignore too long yank. | |
1 0.000004 if len_history < 2 || len_history > 100000 | |
return | |
endif | |
1 0.000006 let s:prev_registers[a:name] = reg | |
" Append register value. | |
1 0.000006 call insert(s:yank_histories, reg) | |
FUNCTION airline#highlighter#add_separator() | |
Called 476 times | |
Total time: 0.220181 | |
Self time: 0.011628 | |
count total (s) self (s) | |
476 0.004219 let s:separators[a:from.a:to] = [a:from, a:to, a:inverse] | |
476 0.215492 0.006939 call <sid>exec_separator({}, a:from, a:to, a:inverse, '') | |
FUNCTION airline#extensions#tabline#get_buffer_name() | |
Called 238 times | |
Total time: 0.019071 | |
Self time: 0.002973 | |
count total (s) self (s) | |
238 0.018904 0.002806 return airline#extensions#tabline#formatters#{s:formatter}(a:nr, get(s:, 'current_buffer_list', [])) | |
FUNCTION airline#highlighter#get_highlight() | |
Called 1394 times | |
Total time: 0.193214 | |
Self time: 0.056336 | |
count total (s) self (s) | |
1394 0.069583 0.009651 let fg = s:get_syn(a:group, 'fg') | |
1394 0.065557 0.009506 let bg = s:get_syn(a:group, 'bg') | |
1394 0.022074 let reverse = synIDattr(synIDtrans(hlID(a:group)), 'reverse', has('gui_running') ? 'gui' : 'term') | |
1394 0.034107 0.013212 return reverse ? s:get_array(bg, fg, a:000) : s:get_array(fg, bg, a:000) | |
FUNCTION airline#util#wrap() | |
Called 780 times | |
Total time: 0.005587 | |
Self time: 0.005587 | |
count total (s) self (s) | |
780 0.002436 if a:minwidth > 0 && winwidth(0) < a:minwidth | |
return '' | |
endif | |
780 0.000967 return a:text | |
FUNCTION airline#extensions#tabline#get() | |
Called 119 times | |
Total time: 0.324816 | |
Self time: 0.003821 | |
count total (s) self (s) | |
119 0.000920 if s:show_buffers && tabpagenr('$') == 1 | |
return s:get_buffers() | |
else | |
119 0.322929 0.001934 return s:get_tabs() | |
endif | |
FUNCTION 92() | |
Called 119 times | |
Total time: 0.001125 | |
Self time: 0.001125 | |
count total (s) self (s) | |
119 0.000279 let self._side = 0 | |
119 0.000711 let self._line .= '%#'.self._curgroup.'#'.(a:0 ? a:1 : '%=') | |
FUNCTION 94() | |
Called 595 times | |
Total time: 0.286497 | |
Self time: 0.066316 | |
count total (s) self (s) | |
595 0.001662 if self._curgroup != '' | |
476 0.001273 if self._curgroup == a:group | |
let self._line .= self._side ? self._context.left_alt_sep : self._context.right_alt_sep | |
else | |
476 0.224240 0.004059 call airline#highlighter#add_separator(self._curgroup, a:group, self._side) | |
476 0.004270 let self._line .= '%#'.self._curgroup.'_to_'.a:group.'#' | |
476 0.002372 let self._line .= self._side ? self._context.left_sep : self._context.right_sep | |
476 0.000500 endif | |
476 0.000306 endif | |
595 0.001633 if self._curgroup != a:group | |
595 0.002490 let self._line .= '%#'.a:group.'#' | |
595 0.000531 endif | |
595 0.000922 if self._context.active | |
595 0.001359 let contents = [] | |
595 0.006094 let content_parts = split(a:contents, '__accent') | |
1071 0.002867 for cpart in content_parts | |
476 0.004559 let accent = matchstr(cpart, '_\zs[^#]*\ze') | |
476 0.002034 call add(contents, cpart) | |
476 0.000604 endfor | |
595 0.002871 let line = join(contents, a:group) | |
595 0.005793 let line = substitute(line, '__restore__', a:group, 'g') | |
595 0.000684 else | |
let line = substitute(a:contents, '%#__accent[^#]*#', '', 'g') | |
let line = substitute(line, '%#__restore__#', '', 'g') | |
endif | |
595 0.001658 let self._line .= line | |
595 0.001360 let self._curgroup = a:group | |
FUNCTION 95() | |
Called 119 times | |
Total time: 0.000510 | |
Self time: 0.000510 | |
count total (s) self (s) | |
119 0.000412 let self._line .= a:text | |
FUNCTION 96() | |
Called 119 times | |
Total time: 0.001090 | |
Self time: 0.001090 | |
count total (s) self (s) | |
119 0.000262 if !self._context.active | |
let self._line = substitute(self._line, '%#.\{-}\ze#', '\0_inactive', 'g') | |
endif | |
119 0.000198 return self._line | |
FUNCTION airline#extensions#tabline#title() | |
Called 238 times | |
Total time: 0.023095 | |
Self time: 0.004024 | |
count total (s) self (s) | |
238 0.001212 let buflist = tabpagebuflist(a:n) | |
238 0.000815 let winnr = tabpagewinnr(a:n) | |
238 0.020787 0.001716 return airline#extensions#tabline#get_buffer_name(buflist[winnr - 1]) | |
FUNCTION airline#highlighter#highlight() | |
Called 7 times | |
Total time: 0.191325 | |
Self time: 0.047983 | |
count total (s) self (s) | |
7 0.000035 let p = g:airline#themes#{g:airline_theme}#palette | |
" draw the base mode, followed by any overrides | |
7 0.000106 let mapped = map(a:modes, 'v:val == a:modes[0] ? v:val : a:modes[0]."_".v:val') | |
7 0.000033 let suffix = a:modes[0] == 'inactive' ? '_inactive' : '' | |
20 0.000042 for mode in mapped | |
13 0.000104 if exists('g:airline#themes#{g:airline_theme}#palette[mode]') | |
13 0.000065 let dict = g:airline#themes#{g:airline_theme}#palette[mode] | |
295 0.000836 for kvp in items(dict) | |
282 0.000979 let mode_colors = kvp[1] | |
282 0.021009 0.002195 call airline#highlighter#exec(kvp[0].suffix, mode_colors) | |
846 0.002493 for accent in keys(s:accents) | |
564 0.001866 if !has_key(p.accents, accent) | |
continue | |
endif | |
564 0.003090 let colors = copy(mode_colors) | |
564 0.002382 if p.accents[accent][0] != '' | |
282 0.001197 let colors[0] = p.accents[accent][0] | |
282 0.000261 endif | |
564 0.001698 if p.accents[accent][2] != '' | |
282 0.001055 let colors[2] = p.accents[accent][2] | |
282 0.000258 endif | |
564 0.001202 if len(colors) >= 5 | |
96 0.000499 let colors[4] = get(p.accents[accent], 4, '') | |
96 0.000100 else | |
468 0.002280 call add(colors, get(p.accents[accent], 4, '')) | |
468 0.000377 endif | |
564 0.043831 0.004798 call airline#highlighter#exec(kvp[0].suffix.'_'.accent, colors) | |
564 0.000840 endfor | |
282 0.000202 endfor | |
" TODO: optimize this | |
234 0.000687 for sep in items(s:separators) | |
221 0.088682 0.003187 call <sid>exec_separator(dict, sep[1][0], sep[1][1], sep[1][2], suffix) | |
221 0.000350 endfor | |
13 0.000009 endif | |
13 0.000008 endfor | |
FUNCTION GetVimIndent() | |
Called 4 times | |
Total time: 0.001912 | |
Self time: 0.000279 | |
count total (s) self (s) | |
4 0.000078 let ignorecase_save = &ignorecase | |
4 0.000016 try | |
4 0.000046 let &ignorecase = 0 | |
4 0.001698 0.000065 return GetVimIndentIntern() | |
finally | |
4 0.000025 let &ignorecase = ignorecase_save | |
4 0.000010 endtry | |
FUNCTION airline#parts#readonly() | |
Called 149 times | |
Total time: 0.000572 | |
Self time: 0.000572 | |
count total (s) self (s) | |
149 0.000457 return &readonly ? g:airline_symbols.readonly : '' | |
FUNCTION UndotreeUpdate() | |
Called 8 times | |
Total time: 0.000128 | |
Self time: 0.000128 | |
count total (s) self (s) | |
8 0.000081 if !exists('t:undotree') | |
8 0.000021 return | |
endif | |
if !exists('w:undotree_id') | |
let w:undotree_id = 'id_'.s:getUniqueID() | |
call s:log("Unique window id assigned: ".w:undotree_id) | |
endif | |
" assume window layout won't change during updating. | |
let thiswinnr = winnr() | |
call t:undotree.Update() | |
" focus moved | |
if winnr() != thiswinnr | |
call s:exec("norm! ".thiswinnr."\<c-w>\<c-w>") | |
endif | |
FUNCTION airline#parts#paste() | |
Called 149 times | |
Total time: 0.000652 | |
Self time: 0.000652 | |
count total (s) self (s) | |
149 0.000539 return g:airline_detect_paste && &paste ? g:airline_symbols.paste : '' | |
FUNCTION <SNR>105_sync_active_winnr() | |
Called 6 times | |
Total time: 0.000097 | |
Self time: 0.000097 | |
count total (s) self (s) | |
6 0.000063 if exists('#airline') && winnr() != s:active_winnr | |
call airline#update_statusline() | |
endif | |
FUNCTION airline#parts#mode() | |
Called 149 times | |
Total time: 0.000822 | |
Self time: 0.000822 | |
count total (s) self (s) | |
149 0.000680 return get(w:, 'airline_current_mode', '') | |
FUNCTION airline#highlighter#exec() | |
Called 1550 times | |
Total time: 0.112779 | |
Self time: 0.112779 | |
count total (s) self (s) | |
1550 0.003658 let colors = a:colors | |
1550 0.002645 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 | |
1550 0.089668 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 <SNR>113_get_array() | |
Called 1394 times | |
Total time: 0.020895 | |
Self time: 0.020895 | |
count total (s) self (s) | |
1394 0.003141 let fg = a:fg | |
1394 0.002416 let bg = a:bg | |
1394 0.013704 return has('gui_running') ? [ fg, bg, '', '', join(a:opts, ',') ] : [ '', '', fg, bg, join(a:opts, ',') ] | |
FUNCTION airline#extensions#tabline#formatters#default() | |
Called 238 times | |
Total time: 0.016098 | |
Self time: 0.011093 | |
count total (s) self (s) | |
238 0.000500 let _ = '' | |
238 0.000868 let name = bufname(a:bufnr) | |
238 0.000586 if empty(name) | |
let _ .= '[No Name]' | |
else | |
238 0.000372 if s:fnamecollapse | |
238 0.004511 let _ .= substitute(fnamemodify(name, s:fmod), '\v\w\zs.{-}\ze(\\|/)', '', 'g') | |
238 0.000282 else | |
let _ .= fnamemodify(name, s:fmod) | |
endif | |
238 0.000125 endif | |
238 0.006630 0.001625 return s:wrap_name(a:bufnr, _) | |
FUNCTION <SNR>111_get_buffer_list() | |
Called 6 times | |
Total time: 0.003545 | |
Self time: 0.003545 | |
count total (s) self (s) | |
6 0.000024 let buffers = [] | |
6 0.000041 let cur = bufnr('%') | |
120 0.000244 for nr in range(1, bufnr('$')) | |
114 0.000502 if buflisted(nr) && bufexists(nr) | |
108 0.000274 for ex in s:excludes | |
if match(bufname(nr), ex) | |
continue | |
endif | |
endfor | |
108 0.000477 if getbufvar(nr, 'current_syntax') == 'qf' | |
continue | |
endif | |
108 0.000371 call add(buffers, nr) | |
108 0.000111 endif | |
114 0.000110 endfor | |
6 0.000052 let s:current_buffer_list = buffers | |
6 0.000012 return buffers | |
FUNCTION <SNR>111_get_tabs() | |
Called 119 times | |
Total time: 0.320995 | |
Self time: 0.026837 | |
count total (s) self (s) | |
119 0.005940 0.001004 let b = airline#builder#new(s:builder_context) | |
357 0.001196 for i in range(1, tabpagenr('$')) | |
238 0.000662 if i == tabpagenr() | |
119 0.000313 let group = 'airline_tabsel' | |
119 0.000213 if g:airline_detect_modified | |
476 0.001079 for bi in tabpagebuflist(i) | |
357 0.001567 if getbufvar(bi, '&modified') | |
113 0.000286 let group = 'airline_tabmod' | |
113 0.000121 endif | |
357 0.000308 endfor | |
119 0.000096 endif | |
119 0.000253 else | |
119 0.000259 let group = 'airline_tab' | |
119 0.000115 endif | |
238 0.000435 let val = '%(' | |
238 0.000464 if s:tab_nr_type == 0 | |
let val .= ' %{len(tabpagebuflist('.i.'))}' | |
else | |
238 0.001385 let val .= (g:airline_symbols.space).i | |
238 0.000223 endif | |
238 0.091163 0.003363 call b.add_section(group, val.'%'.i.'T %{airline#extensions#tabline#title('.i.')} %)') | |
238 0.000405 endfor | |
119 0.001245 0.000735 call b.add_raw('%T') | |
119 0.066614 0.000792 call b.add_section('airline_tabfill', '') | |
119 0.001757 0.000632 call b.split() | |
119 0.067560 0.000932 call b.add_section('airline_tab', ' %999XX ') | |
119 0.067297 0.001050 call b.add_section('airline_tabtype', ' tabs ') | |
119 0.001754 0.000664 return b.build() | |
FUNCTION <SNR>124_load() | |
Called 6 times | |
Total time: 0.000370 | |
Self time: 0.000370 | |
count total (s) self (s) | |
6 0.000344 if !filereadable(g:unite_source_history_yank_file) || s:yank_histories_file_mtime == getftime(g:unite_source_history_yank_file) | |
6 0.000013 return | |
endif | |
let file = readfile(g:unite_source_history_yank_file) | |
if empty(file) | |
return | |
endif | |
try | |
sandbox let s:yank_histories = eval(file[0]) | |
" Type check. | |
let history = s:yank_histories[0] | |
let history[0] = history[0] | |
catch | |
let s:yank_histories = [] | |
endtry | |
let s:yank_histories_file_mtime = getftime(g:unite_source_history_yank_file) | |
FUNCTION airline#statusline() | |
Called 371 times | |
Total time: 0.007404 | |
Self time: 0.007404 | |
count total (s) self (s) | |
371 0.003267 if has_key(s:contexts, a:winnr) | |
371 0.003318 return '%{airline#check_mode('.a:winnr.')}'.s:contexts[a:winnr].line | |
endif | |
" in rare circumstances this happens...see #276 | |
return '' | |
FUNCTION AutoPairsInsert() | |
Called 2 times | |
Total time: 0.000598 | |
Self time: 0.000598 | |
count total (s) self (s) | |
2 0.000018 if !b:autopairs_enabled | |
return a:key | |
end | |
2 0.000017 let line = getline('.') | |
2 0.000015 let pos = col('.') - 1 | |
2 0.000011 let before = strpart(line, 0, pos) | |
2 0.000009 let after = strpart(line, pos) | |
2 0.000025 let next_chars = split(after, '\zs') | |
2 0.000012 let current_char = get(next_chars, 0, '') | |
2 0.000008 let next_char = get(next_chars, 1, '') | |
2 0.000043 let prev_chars = split(before, '\zs') | |
2 0.000010 let prev_char = get(prev_chars, -1, '') | |
2 0.000004 let eol = 0 | |
2 0.000011 if col('$') - col('.') <= 1 | |
2 0.000005 let eol = 1 | |
2 0.000002 end | |
" Ignore auto close if prev character is \ | |
2 0.000006 if prev_char == '\' | |
return a:key | |
end | |
" The key is difference open-pair, then it means only for ) ] } by default | |
2 0.000011 if !has_key(b:AutoPairs, a:key) | |
let b:autopairs_saved_pair = [a:key, getpos('.')] | |
" Skip the character if current character is the same as input | |
if current_char == a:key | |
return "\<Right>" | |
end | |
if !g:AutoPairsFlyMode | |
" Skip the character if next character is space | |
if current_char == ' ' && next_char == a:key | |
return "\<Right>\<Right>" | |
end | |
" Skip the character if closed pair is next character | |
if current_char == '' | |
let next_lineno = line('.')+1 | |
let next_line = getline(nextnonblank(next_lineno)) | |
let next_char = matchstr(next_line, '\s*\zs.') | |
if next_char == a:key | |
return "\<ESC>e^a" | |
endif | |
endif | |
endif | |
" Fly Mode, and the key is closed-pairs, search closed-pair and jump | |
if g:AutoPairsFlyMode && has_key(b:AutoPairsClosedPairs, a:key) | |
if search(a:key, 'W') | |
return "\<Right>" | |
endif | |
endif | |
" Insert directly if the key is not an open key | |
return a:key | |
end | |
2 0.000005 let open = a:key | |
2 0.000008 let close = b:AutoPairs[open] | |
2 0.000008 if current_char == close && open == close | |
return "\<Right>" | |
end | |
" Ignore auto close ' if follows a word | |
" MUST after closed check. 'hello|' | |
2 0.000017 if a:key == "'" && prev_char =~ '\v\w' | |
return a:key | |
end | |
" support for ''' ``` and """ | |
2 0.000006 if open == close | |
" The key must be ' " ` | |
2 0.000013 let pprev_char = line[col('.')-3] | |
2 0.000007 if pprev_char == open && prev_char == open | |
" Double pair found | |
return repeat(a:key, 4) . repeat("\<LEFT>", 3) | |
end | |
2 0.000002 end | |
2 0.000005 let quotes_num = 0 | |
" Ignore comment line for vim file | |
2 0.000010 if &filetype == 'vim' && a:key == '"' | |
if before =~ '^\s*$' | |
return a:key | |
end | |
if before =~ '^\s*"' | |
let quotes_num = -1 | |
end | |
end | |
" Keep quote number is odd. | |
" Because quotes should be matched in the same line in most of situation | |
2 0.000006 if g:AutoPairsSmartQuotes && open == close | |
" Remove \\ \" \' | |
2 0.000032 let cleaned_line = substitute(line, '\v(\\.)', '', 'g') | |
2 0.000006 let n = quotes_num | |
2 0.000003 let pos = 0 | |
2 0.000004 while 1 | |
2 0.000011 let pos = stridx(cleaned_line, open, pos) | |
2 0.000005 if pos == -1 | |
2 0.000003 break | |
end | |
let n = n + 1 | |
let pos = pos + 1 | |
endwhile | |
2 0.000003 if n % 2 == 1 | |
return a:key | |
endif | |
2 0.000002 endif | |
2 0.000013 return open.close."\<Left>" | |
FUNCTION airline#highlighter#highlight_modified_inactive() | |
Called 7 times | |
Total time: 0.000933 | |
Self time: 0.000291 | |
count total (s) self (s) | |
7 0.000040 if getbufvar(a:bufnr, '&modified') | |
6 0.000085 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 : [] | |
6 0.000006 else | |
1 0.000011 let colors = exists('g:airline#themes#{g:airline_theme}#palette.inactive.airline_c') ? g:airline#themes#{g:airline_theme}#palette.inactive.airline_c : [] | |
1 0.000001 endif | |
7 0.000018 if !empty(colors) | |
7 0.000709 0.000067 call airline#highlighter#exec('airline_c'.(a:bufnr).'_inactive', colors) | |
7 0.000009 endif | |
FUNCTION <SNR>113_get_syn() | |
Called 2788 times | |
Total time: 0.115983 | |
Self time: 0.115983 | |
count total (s) self (s) | |
" need to pass in mode, known to break on 7.3.547 | |
2788 0.015992 let mode = has('gui_running') ? 'gui' : 'cterm' | |
2788 0.038055 let color = synIDattr(synIDtrans(hlID(a:group)), a:what, mode) | |
2788 0.009310 if empty(color) || color == -1 | |
104 0.001244 let color = synIDattr(synIDtrans(hlID('Normal')), a:what, mode) | |
104 0.000089 endif | |
2788 0.007564 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 | |
2788 0.003316 return color | |
FUNCTION unite#sources#history_yank#_append() | |
Called 6 times | |
Total time: 0.000974 | |
Self time: 0.000414 | |
count total (s) self (s) | |
6 0.000042 let prev_histories = s:yank_histories | |
6 0.000425 0.000055 call s:load() | |
6 0.000259 0.000069 call s:add_register('"') | |
6 0.000018 if g:unite_source_history_yank_save_clipboard | |
call s:add_register('+') | |
endif | |
6 0.000021 if prev_histories !=# s:yank_histories | |
" Updated. | |
call unite#util#uniq(s:yank_histories) | |
if g:unite_source_history_yank_limit < len(s:yank_histories) | |
let s:yank_histories = s:yank_histories[ : g:unite_source_history_yank_limit - 1] | |
endif | |
call s:save() | |
endif | |
FUNCTION airline#builder#new() | |
Called 119 times | |
Total time: 0.004936 | |
Self time: 0.004936 | |
count total (s) self (s) | |
119 0.001082 let builder = copy(s:prototype) | |
119 0.000465 let builder._context = a:context | |
119 0.000293 let builder._side = 1 | |
119 0.000296 let builder._curgroup = '' | |
119 0.000261 let builder._line = '' | |
119 0.001880 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') | |
119 0.000234 return builder | |
FUNCTIONS SORTED ON TOTAL TIME | |
count total (s) self (s) function | |
119 0.324816 0.003821 airline#extensions#tabline#get() | |
119 0.320995 0.026837 <SNR>111_get_tabs() | |
697 0.294048 0.031955 <SNR>113_exec_separator() | |
595 0.286497 0.066316 94() | |
371 0.220209 0.027951 airline#check_mode() | |
476 0.220181 0.011628 airline#highlighter#add_separator() | |
1394 0.207803 0.014589 airline#themes#get_highlight() | |
1394 0.193214 0.056336 airline#highlighter#get_highlight() | |
7 0.191325 0.047983 airline#highlighter#highlight() | |
2788 0.115983 <SNR>113_get_syn() | |
1550 0.112779 airline#highlighter#exec() | |
238 0.023095 0.004024 airline#extensions#tabline#title() | |
1394 0.020895 <SNR>113_get_array() | |
238 0.019071 0.002973 airline#extensions#tabline#get_buffer_name() | |
238 0.016098 0.011093 airline#extensions#tabline#formatters#default() | |
371 0.007404 airline#statusline() | |
780 0.005587 airline#util#wrap() | |
238 0.005005 <SNR>125_wrap_name() | |
45 0.004953 <SNR>93_Highlight_Matching_Pair() | |
119 0.004936 airline#builder#new() | |
FUNCTIONS SORTED ON SELF TIME | |
count total (s) self (s) function | |
2788 0.115983 <SNR>113_get_syn() | |
1550 0.112779 airline#highlighter#exec() | |
595 0.286497 0.066316 94() | |
1394 0.193214 0.056336 airline#highlighter#get_highlight() | |
7 0.191325 0.047983 airline#highlighter#highlight() | |
697 0.294048 0.031955 <SNR>113_exec_separator() | |
371 0.220209 0.027951 airline#check_mode() | |
119 0.320995 0.026837 <SNR>111_get_tabs() | |
1394 0.020895 <SNR>113_get_array() | |
1394 0.207803 0.014589 airline#themes#get_highlight() | |
476 0.220181 0.011628 airline#highlighter#add_separator() | |
238 0.016098 0.011093 airline#extensions#tabline#formatters#default() | |
371 0.007404 airline#statusline() | |
780 0.005587 airline#util#wrap() | |
238 0.005005 <SNR>125_wrap_name() | |
45 0.004953 <SNR>93_Highlight_Matching_Pair() | |
119 0.004936 airline#builder#new() | |
298 0.004429 airline#util#append() | |
238 0.023095 0.004024 airline#extensions#tabline#title() | |
119 0.324816 0.003821 airline#extensions#tabline#get() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment