Created
October 14, 2016 21:13
-
-
Save qstrahl/2a00408ffff3e76b4139696004515e74 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 repeat#wrap() | |
Called 1 time | |
Total time: 0.000364 | |
Self time: 0.000364 | |
count total (s) self (s) | |
1 0.000020 let preserve = (g:repeat_tick == b:changedtick) | |
1 0.000319 exe 'norm! '.(a:count ? a:count : '').a:command . (&foldopen =~# 'undo\|all' ? 'zv' : '') | |
1 0.000008 if preserve | |
let g:repeat_tick = b:changedtick | |
endif | |
FUNCTION tabline#branch() | |
Called 2 times | |
Total time: 0.000718 | |
Self time: 0.000043 | |
count total (s) self (s) | |
2 0.000003 try | |
2 0.000520 0.000020 let repo = fugitive#repo(fugitive#extract_git_dir(1)) | |
2 0.000189 0.000014 return repo.head(7) | |
catch /./ | |
return '' | |
endtry | |
FUNCTION <SNR>31_Highlight_Matching_Pair() | |
Called 4 times | |
Total time: 0.000753 | |
Self time: 0.000753 | |
count total (s) self (s) | |
" Remove any previous match. | |
4 0.000044 if exists('w:paren_hl_on') && w:paren_hl_on | |
silent! call matchdelete(3) | |
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). | |
4 0.000035 if pumvisible() || (&t_Co < 8 && !has("gui_running")) | |
return | |
endif | |
" Get the character under the cursor and check if it's in 'matchpairs'. | |
4 0.000029 let c_lnum = line('.') | |
4 0.000019 let c_col = col('.') | |
4 0.000011 let before = 0 | |
4 0.000023 let text = getline(c_lnum) | |
4 0.000101 let matches = matchlist(text, '\(.\)\=\%'.c_col.'c\(.\=\)') | |
4 0.000017 if empty(matches) | |
let [c_before, c] = ['', ''] | |
else | |
4 0.000036 let [c_before, c] = matches[1:2] | |
4 0.000007 endif | |
4 0.000121 let plist = split(&matchpairs, '.\zs[:,]') | |
4 0.000029 let i = index(plist, c) | |
4 0.000010 if i < 0 | |
" not found, in Insert mode try character before the cursor | |
4 0.000026 if c_col > 1 && (mode() == 'i' || mode() == 'R') | |
let before = strlen(c_before) | |
let c = c_before | |
let i = index(plist, c) | |
endif | |
4 0.000008 if i < 0 | |
" not found, nothing to do | |
4 0.000008 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 has_getcurpos = exists("*getcurpos") | |
if has_getcurpos | |
" getcurpos() is more efficient but doesn't exist before 7.4.313. | |
let save_cursor = getcurpos() | |
else | |
let save_cursor = winsaveview() | |
endif | |
call cursor(c_lnum, c_col - before) | |
endif | |
" Build an expression that detects whether the current cursor position is in | |
" certain syntax types (string, comment, etc.), for use as searchpairpos()'s | |
" skip argument. | |
" We match "escape" for special items, such as lispEscapeSpecial. | |
let s_skip = '!empty(filter(map(synstack(line("."), col(".")), ''synIDattr(v:val, "name")''), ' . '''v:val =~? "string\\|character\\|singlequote\\|escape\\|comment"''))' | |
" If executing the expression determines that the cursor is currently in | |
" one of the syntax types, then we want searchpairpos() to find the pair | |
" within those syntax types (i.e., not skip). Otherwise, the cursor is | |
" outside of the syntax types and s_skip should keep its value so we skip any | |
" matching pair inside the syntax types. | |
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 | |
if has_getcurpos | |
call setpos('.', save_cursor) | |
else | |
call winrestview(save_cursor) | |
endif | |
endif | |
" If a match is found setup match highlighting. | |
if m_lnum > 0 && m_lnum >= stoplinetop && m_lnum <= stoplinebottom | |
if exists('*matchaddpos') | |
call matchaddpos('MatchParen', [[c_lnum, c_col - before], [m_lnum, m_col]], 10, 3) | |
else | |
exe '3match MatchParen /\(\%' . c_lnum . 'l\%' . (c_col - before) . 'c\)\|\(\%' . m_lnum . 'l\%' . m_col . 'c\)/' | |
endif | |
let w:paren_hl_on = 1 | |
endif | |
FUNCTION fugitive#buffer() | |
Called 27 times | |
Total time: 0.000883 | |
Self time: 0.000102 | |
count total (s) self (s) | |
27 0.000873 0.000093 return s:buffer(a:0 ? a:1 : '%') | |
FUNCTION <SNR>71_buffer() | |
Called 27 times | |
Total time: 0.000780 | |
Self time: 0.000687 | |
count total (s) self (s) | |
27 0.000139 let buffer = {'#': bufnr(a:0 ? a:1 : '%')} | |
27 0.000398 call extend(extend(buffer,s:buffer_prototype,'keep'),s:abstract_prototype,'keep') | |
27 0.000198 0.000105 if buffer.getvar('git_dir') !=# '' | |
27 0.000025 return buffer | |
endif | |
call s:throw('not a git repository: '.expand('%:p')) | |
FUNCTION <SNR>71_winshell() | |
Called 175 times | |
Total time: 0.000855 | |
Self time: 0.000855 | |
count total (s) self (s) | |
175 0.000790 return &shell =~? 'cmd' || exists('+shellslash') && !&shellslash | |
FUNCTION <SNR>71_repo_tree() | |
Called 78 times | |
Total time: 0.001757 | |
Self time: 0.001307 | |
count total (s) self (s) | |
78 0.000587 0.000368 if self.dir() =~# '/\.git$' | |
78 0.000497 0.000265 let dir = self.dir()[0:-6] | |
78 0.000039 else | |
let dir = s:configured_tree(self.git_dir) | |
endif | |
78 0.000060 if dir ==# '' | |
call s:throw('no work tree') | |
else | |
78 0.000145 return join([dir]+a:000,'/') | |
endif | |
FUNCTION <SNR>71_repo_dir() | |
Called 220 times | |
Total time: 0.000642 | |
Self time: 0.000642 | |
count total (s) self (s) | |
220 0.000581 return join([self.git_dir]+a:000,'/') | |
FUNCTION <SNR>12_leader() | |
Called 6 times | |
Total time: 0.000056 | |
Self time: 0.000056 | |
count total (s) self (s) | |
6 0.000054 return substitute(repeat('┄', indent(v:foldstart)), '\v.$', ' ', '') | |
FUNCTION <SNR>81_matchmake() | |
Called 2 times | |
Total time: 0.000037 | |
Self time: 0.000023 | |
count total (s) self (s) | |
2 0.000030 0.000016 if !s:is_enabled() | |
2 0.000004 return | |
endif | |
if empty(a:needle) | |
"Decho "Empty needle: " . a:needle | |
call s:matchunmake() | |
return | |
endif | |
"Decho "Current needle: " . a:needle | |
if !s:is_new_needle(a:needle) | |
return | |
endif | |
call s:matchunmake() | |
let w:matchmaker_needle = a:needle | |
call s:highlight(w:matchmaker_needle) | |
FUNCTION <SNR>71_buffer_spec() | |
Called 171 times | |
Total time: 0.008143 | |
Self time: 0.006366 | |
count total (s) self (s) | |
171 0.000428 let bufname = bufname(self['#']) | |
171 0.003420 0.001643 return s:shellslash(bufname == '' ? '' : fnamemodify(bufname,':p')) | |
FUNCTION <SNR>71_repo_head() | |
Called 2 times | |
Total time: 0.000175 | |
Self time: 0.000048 | |
count total (s) self (s) | |
2 0.000094 0.000013 let head = s:repo().head_ref() | |
2 0.000011 if head =~# '^ref: ' | |
2 0.000054 0.000007 let branch = s:sub(head,'^ref: %(refs/%(heads/|remotes/|tags/)=)=','') | |
2 0.000002 elseif head =~# '^\x\{40\}$' | |
" truncate hash to a:1 characters if we're in detached head mode | |
let len = a:0 ? a:1 : 0 | |
let branch = len ? head[0:len-1] : '' | |
else | |
return '' | |
endif | |
2 0.000002 return branch | |
FUNCTION <SNR>71_sub() | |
Called 86 times | |
Total time: 0.000776 | |
Self time: 0.000776 | |
count total (s) self (s) | |
86 0.000731 return substitute(a:str,'\v\C'.a:pat,a:rep,'') | |
FUNCTION <SNR>71_buffer_getvar() | |
Called 204 times | |
Total time: 0.000525 | |
Self time: 0.000525 | |
count total (s) self (s) | |
204 0.000480 return getbufvar(self['#'],a:var) | |
FUNCTION tabline#label() | |
Called 8 times | |
Total time: 0.000044 | |
Self time: 0.000044 | |
count total (s) self (s) | |
8 0.000041 return fnamemodify(getcwd(-1, a:tab), get(a:, 1, ':t')) | |
let win = tabpagewinnr(a:tab) | |
let bufs = tabpagebuflist(a:tab) | |
let buf = bufs[win - 1] | |
let pre = '' | |
let dir = '' | |
let etc = '' | |
let label = '' | |
try | |
let repo = fugitive#buffer(buf).repo() | |
let pre = '⑂' | |
let dir = repo.tree() | |
catch /^fugitive/ | |
let pre = '}' | |
let dir = getbufvar(buf, 'projectionist_file', '') | |
if dir == fnamemodify(bufname(buf), ':p') | |
let dir = '' | |
endif | |
endtry | |
if empty(dir) | |
let pre = '$' | |
let dir = getcwd(-1) | |
endif | |
" if !empty(pre) | |
" let label .= pre . ' ' | |
" endif | |
let label .= fnamemodify(dir, get(a:, 1, ':t')) | |
if !empty(etc) | |
let label .= ' [' . etc . ']' | |
endif | |
return label | |
FUNCTION statusline#git() | |
Called 9 times | |
Total time: 0.003293 | |
Self time: 0.002211 | |
count total (s) self (s) | |
9 0.003281 0.002200 return statusline#default(s:gitname, s:gitrev) | |
FUNCTION <SNR>81_needle() | |
Called 2 times | |
Total time: 0.000134 | |
Self time: 0.000042 | |
count total (s) self (s) | |
2 0.000132 0.000040 return exists('*b:matchmaker_needle') ? b:matchmaker_needle() : s:default_needle() | |
FUNCTION tabline#render() | |
Called 2 times | |
Total time: 0.000201 | |
Self time: 0.000201 | |
count total (s) self (s) | |
2 0.000034 let curtab = tabpagenr() | |
2 0.000003 let tabline = '' | |
2 0.000004 let tabline .= '%#TabLine#' | |
2 0.000003 let tabline .= '%{tabline#label(tabpagenr(), ":p:~")}' | |
2 0.000006 let tabline .= '%( ⑂ %{tabline#branch()}%)' | |
"" indecisiveness | |
2 0.000003 let tabline .= '%( ⊟ %{tabpagewinnr(tabpagenr(), "$")}%)' | |
" let tabline .= '%( ⊞ %{tabpagewinnr(tabpagenr(), "$")}%)' | |
2 0.000006 let tabline .= '%<' | |
2 0.000002 let tabline .= '%=' | |
2 0.000003 let tab = 0 | |
2 0.000004 let tabs = tabpagenr('$') | |
8 0.000013 for tab in range(tabs) | |
6 0.000006 let tab += 1 | |
6 0.000015 let tabline .= '%' . tab . 'T' | |
6 0.000015 let tabline .= tab == curtab ? '%#TabLineSel#' : '%#TabLine#' | |
6 0.000020 let tabline .= ' %{tabline#label(' . tab . ')} ' | |
6 0.000011 let tabline .= '%#TabLine#' | |
6 0.000005 endfor | |
" let tabline .= '%#TabLineFill#%T' | |
" let tabline .= '%#TabLine#%999XX' | |
2 0.000007 return tabline | |
FUNCTION fugitive#extract_git_dir() | |
Called 2 times | |
Total time: 0.000450 | |
Self time: 0.000256 | |
count total (s) self (s) | |
2 0.000068 0.000021 if s:shellslash(a:path) =~# '^fugitive://.*//' | |
return matchstr(s:shellslash(a:path), '\C^fugitive://\zs.\{-\}\ze//') | |
endif | |
2 0.000056 0.000038 let root = s:shellslash(simplify(fnamemodify(a:path, ':p:s?[\/]$??'))) | |
2 0.000002 let previous = "" | |
4 0.000005 while root !=# previous | |
4 0.000020 if root =~# '\v^//%([^/]+/?)?$' | |
" This is for accessing network shares from Cygwin Vim. There won't be | |
" any git directory called //.git or //serverName/.git so let's avoid | |
" checking for them since such checks are extremely slow. | |
break | |
endif | |
4 0.000017 if index(split($GIT_CEILING_DIRECTORIES, ':'), root) >= 0 | |
break | |
endif | |
4 0.000008 if root ==# $GIT_WORK_TREE && fugitive#is_git_dir($GIT_DIR) | |
return simplify(fnamemodify(expand($GIT_DIR), ':p:s?[\/]$??')) | |
endif | |
4 0.000060 0.000012 if fugitive#is_git_dir($GIT_DIR) | |
" Ensure that we've cached the worktree | |
call s:configured_tree(simplify(fnamemodify(expand($GIT_DIR), ':p:s?[\/]$??'))) | |
if has_key(s:dir_for_worktree, root) | |
return s:dir_for_worktree[root] | |
endif | |
endif | |
4 0.000037 0.000015 let dir = s:sub(root, '[\/]$', '') . '/.git' | |
4 0.000011 let type = getftype(dir) | |
4 0.000040 0.000008 if type ==# 'dir' && fugitive#is_git_dir(dir) | |
2 0.000002 return dir | |
elseif type ==# 'link' && fugitive#is_git_dir(dir) | |
return resolve(dir) | |
elseif type !=# '' && filereadable(dir) | |
let line = get(readfile(dir, '', 1), 0, '') | |
if line =~# '^gitdir: \.' && fugitive#is_git_dir(root.'/'.line[8:-1]) | |
return simplify(root.'/'.line[8:-1]) | |
elseif line =~# '^gitdir: ' && fugitive#is_git_dir(line[8:-1]) | |
return line[8:-1] | |
endif | |
elseif fugitive#is_git_dir(root) | |
return root | |
endif | |
2 0.000002 let previous = root | |
2 0.000004 let root = fnamemodify(root, ':h') | |
2 0.000001 endwhile | |
return '' | |
FUNCTION <SNR>71_buffer_type() | |
Called 27 times | |
Total time: 0.002755 | |
Self time: 0.001352 | |
count total (s) self (s) | |
27 0.000144 0.000074 if self.getvar('fugitive_type') != '' | |
12 0.000071 0.000039 let type = self.getvar('fugitive_type') | |
12 0.000027 elseif fnamemodify(self.spec(),':p') =~# '.\git/refs/\|\.git/\w*HEAD$' | |
let type = 'head' | |
elseif self.getline(1) =~ '^tree \x\{40\}$' && self.getline(2) == '' | |
let type = 'tree' | |
elseif self.getline(1) =~ '^\d\{6\} \w\{4\} \x\{40\}\>\t' | |
let type = 'tree' | |
elseif self.getline(1) =~ '^\d\{6\} \x\{40\}\> \d\t' | |
let type = 'index' | |
elseif isdirectory(self.spec()) | |
let type = 'directory' | |
elseif self.spec() == '' | |
let type = 'null' | |
else | |
15 0.000015 let type = 'file' | |
15 0.000009 endif | |
27 0.000021 if a:0 | |
return !empty(filter(copy(a:000),'v:val ==# type')) | |
else | |
27 0.000023 return type | |
endif | |
FUNCTION <SNR>71_repo_bare() | |
Called 20 times | |
Total time: 0.000199 | |
Self time: 0.000143 | |
count total (s) self (s) | |
20 0.000176 0.000120 if self.dir() =~# '/\.git$' | |
20 0.000014 return 0 | |
else | |
return s:configured_tree(self.git_dir) ==# '' | |
endif | |
FUNCTION <SNR>71_shellslash() | |
Called 175 times | |
Total time: 0.001842 | |
Self time: 0.000986 | |
count total (s) self (s) | |
175 0.001215 0.000360 if s:winshell() | |
return s:gsub(a:path,'\\','/') | |
else | |
175 0.000170 return a:path | |
endif | |
FUNCTION UndotreeUpdate() | |
Called 2 times | |
Total time: 0.000023 | |
Self time: 0.000023 | |
count total (s) self (s) | |
2 0.000013 if !exists('t:undotree') | |
2 0.000006 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 fugitive#repo() | |
Called 2 times | |
Total time: 0.000051 | |
Self time: 0.000007 | |
count total (s) self (s) | |
2 0.000050 0.000007 return call('s:repo', a:000) | |
FUNCTION <SNR>81_default_needle() | |
Called 2 times | |
Total time: 0.000092 | |
Self time: 0.000092 | |
count total (s) self (s) | |
2 0.000010 if mode() == 'v' | |
return '\V\<'.escape(s:get_visual_selection(), '\').'\>' | |
else | |
"Decho 'current char under cursor: '. getline(".")[col(".")-1] | |
2 0.000032 if getline(".")[col(".")-1] =~# '\k' | |
1 0.000010 return '\V\<'.escape(expand('<cword>'), '\').'\>' | |
endif | |
1 0.000002 endif | |
FUNCTION <SNR>71_buffer_repo() | |
Called 138 times | |
Total time: 0.005577 | |
Self time: 0.000568 | |
count total (s) self (s) | |
138 0.005548 0.000538 return s:repo(self.getvar('git_dir')) | |
FUNCTION <SNR>71_repo_head_ref() | |
Called 2 times | |
Total time: 0.000051 | |
Self time: 0.000036 | |
count total (s) self (s) | |
2 0.000022 0.000012 if !filereadable(self.dir('HEAD')) | |
return '' | |
endif | |
2 0.000024 0.000019 return readfile(self.dir('HEAD'))[0] | |
FUNCTION statusline#gitindicator() | |
Called 9 times | |
Total time: 0.001732 | |
Self time: 0.000227 | |
count total (s) self (s) | |
9 0.000016 try | |
9 0.001624 0.000118 let c = get({ 'blob': '', 'commit': 'commit', 'directory': '', 'file': '', 'head': 'head', 'index': 'index', 'null': '', 'tree': '' }, fugitive#buffer('%').type()) | |
9 0.000023 return empty(c) ? '' : c | |
catch /^fugitive:/ | |
return '' | |
endtry | |
FUNCTION <SNR>71_buffer_path() | |
Called 28 times | |
Total time: 0.015505 | |
Self time: 0.001598 | |
count total (s) self (s) | |
28 0.001054 0.000384 let rev = matchstr(self.spec(),'^fugitive://.\{-\}//\zs.*') | |
28 0.000034 if rev != '' | |
8 0.000107 0.000034 let rev = s:sub(rev,'\w*','') | |
8 0.000042 elseif s:cpath(self.spec()[0 : len(self.repo().dir())]) ==# s:cpath(self.repo().dir() . '/') | |
let rev = '/.git'.self.spec()[strlen(self.repo().dir()) : -1] | |
elseif !self.repo().bare() && s:cpath(self.spec()[0 : len(self.repo().tree())]) ==# s:cpath(self.repo().tree() . '/') | |
20 0.005759 0.000167 let rev = self.spec()[strlen(self.repo().tree()) : -1] | |
20 0.000010 endif | |
28 0.000691 0.000143 return s:sub(s:sub(rev,'.\zs/$',''),'^/',a:0 ? a:1 : '') | |
FUNCTION <SNR>71_cpath() | |
Called 80 times | |
Total time: 0.000398 | |
Self time: 0.000398 | |
count total (s) self (s) | |
80 0.000205 if exists('+fileignorecase') && &fileignorecase | |
return tolower(a:path) | |
else | |
80 0.000058 return a:path | |
endif | |
FUNCTION <SNR>71_buffer_rev() | |
Called 18 times | |
Total time: 0.012310 | |
Self time: 0.000614 | |
count total (s) self (s) | |
18 0.000726 0.000257 let rev = matchstr(self.spec(),'^fugitive://.\{-\}//\zs.*') | |
18 0.000051 if rev =~ '^\x/' | |
return ':'.rev[0].':'.rev[2:-1] | |
elseif rev =~ '.' | |
8 0.000081 0.000030 return s:sub(rev,'/',':') | |
elseif self.spec() =~ '\.git/index$' | |
return ':' | |
elseif self.spec() =~ '\.git/refs/\|\.git/.*HEAD$' | |
return self.spec()[strlen(self.repo().dir())+1 : -1] | |
else | |
10 0.010811 0.000027 return self.path('/') | |
endif | |
FUNCTION fugitive#is_git_dir() | |
Called 8 times | |
Total time: 0.000106 | |
Self time: 0.000071 | |
count total (s) self (s) | |
8 0.000059 0.000024 let path = s:sub(a:path, '[\/]$', '') . '/' | |
8 0.000044 return getfsize(path.'HEAD') > 10 && ( isdirectory(path.'objects') && isdirectory(path.'refs') || getftype(path.'commondir') ==# 'file') | |
FUNCTION statusline#customrev() | |
Called 18 times | |
Total time: 0.021202 | |
Self time: 0.001112 | |
count total (s) self (s) | |
18 0.000024 try | |
18 0.000456 0.000048 let buf = fugitive#buffer() | |
18 0.001779 0.000054 let type = buf.type() | |
18 0.012391 0.000081 let rev = buf.rev() | |
18 0.004781 0.000060 let path = buf.path() | |
18 0.000536 0.000053 let repo = buf.repo() | |
18 0.000548 0.000104 let dir = fnamemodify(repo.tree(), ':~') | |
18 0.000023 if type == 'file' | |
10 0.000041 let matches = [rev, '', path] | |
10 0.000008 elseif type == 'directory' | |
let matches = [rev, '', empty(path) ? dir . '/' : path . '/'] | |
elseif type == 'index' | |
let matches = [rev, '', path] | |
else | |
8 0.000194 let matches = matchlist(rev, '\v^%(:?([0-9a-f]*))%(:(\f*))?$') | |
8 0.000020 if matches[1] == '0' | |
let matches[1] = 'HEAD' | |
endif | |
8 0.000033 let matches[2] = empty(matches[2]) ? dir : matches[2] | |
8 0.000005 endif | |
18 0.000045 return get(matches, a:part, '') | |
catch /./ | |
return '' | |
endtry | |
FUNCTION statusline#default() | |
Called 9 times | |
Total time: 0.001082 | |
Self time: 0.001082 | |
count total (s) self (s) | |
9 0.000995 let parts = [ s:indicators ] + (a:0 ? a:000 : [ s:name, ' ' ]) + [ s:icons, s:ruler ] | |
9 0.000071 return join(parts, '') | |
FUNCTION <SNR>81_is_enabled() | |
Called 2 times | |
Total time: 0.000014 | |
Self time: 0.000014 | |
count total (s) self (s) | |
2 0.000013 return exists('s:enabled') && s:enabled | |
FUNCTION neomake#CursorMoved() | |
Called 2 times | |
Total time: 0.000122 | |
Self time: 0.000122 | |
count total (s) self (s) | |
2 0.000014 let l:line = line('.') | |
2 0.000073 if s:last_cursormoved[0] != l:line || s:last_cursormoved[1] != bufnr('%') | |
let s:last_cursormoved = [l:line, bufnr('%')] | |
call neomake#signs#PlaceVisibleSigns() | |
call neomake#EchoCurrentError() | |
endif | |
FUNCTION <SNR>71_repo() | |
Called 142 times | |
Total time: 0.004753 | |
Self time: 0.004753 | |
count total (s) self (s) | |
142 0.000536 let dir = a:0 ? a:1 : (exists('b:git_dir') && b:git_dir !=# '' ? b:git_dir : fugitive#extract_git_dir(expand('%:p'))) | |
142 0.000139 if dir !=# '' | |
142 0.000249 if has_key(g:repos, dir) | |
142 0.000338 let repo = get(g:repos, dir) | |
142 0.000067 else | |
let repo = {'git_dir': dir} | |
let g:repos[dir] = repo | |
endif | |
142 0.000619 return extend(extend(repo, s:repo_prototype, 'keep'), s:abstract_prototype, 'keep') | |
endif | |
call s:throw('not a git repository: '.expand('%:p')) | |
FUNCTION <SNR>12_trim() | |
Called 6 times | |
Total time: 0.000275 | |
Self time: 0.000275 | |
count total (s) self (s) | |
6 0.000268 return substitute(a:str, '\v(^\s*|\s*$)', a:0 ? a:1 : '', 'g') | |
FUNCTION <SNR>71_buffer_getline() | |
Called 45 times | |
Total time: 0.000180 | |
Self time: 0.000180 | |
count total (s) self (s) | |
45 0.000168 return get(getbufline(self['#'], a:lnum), 0, '') | |
FUNCTION MyFoldtext() | |
Called 6 times | |
Total time: 0.000754 | |
Self time: 0.000423 | |
count total (s) self (s) | |
6 0.000023 if &foldmethod ==# 'syntax' | |
let s = s:leader() | |
let num = v:foldend - v:foldstart | |
let lines = filter(range(v:foldstart, v:foldend), 'indent(v:val) == indent(v:foldstart)') | |
let s .= join(map(lines, 's:trim(getline(v:val))'), '…') | |
let s .= ' ' | |
let s .= printf(&commentstring, ' ' . num . ' lines folded ') | |
else | |
6 0.000086 let s = foldtext() | |
6 0.000443 0.000168 let s = substitute(s, '\v.{-}(\d* lines):\s*(.*)', '\=s:trim(printf("%s " . &commentstring, submatch(2), " " . submatch(1) . " folded "))', '') | |
6 0.000083 0.000027 let s = s:leader() . s | |
6 0.000005 endif | |
6 0.000017 if s[strlen(s)-1] !=# ' ' | |
6 0.000008 let s .= ' ' | |
6 0.000003 endif | |
6 0.000005 return s | |
FUNCTIONS SORTED ON TOTAL TIME | |
count total (s) self (s) function | |
18 0.021202 0.001112 statusline#customrev() | |
28 0.015505 0.001598 <SNR>71_buffer_path() | |
18 0.012310 0.000614 <SNR>71_buffer_rev() | |
171 0.008143 0.006366 <SNR>71_buffer_spec() | |
138 0.005577 0.000568 <SNR>71_buffer_repo() | |
142 0.004753 <SNR>71_repo() | |
9 0.003293 0.002211 statusline#git() | |
27 0.002755 0.001352 <SNR>71_buffer_type() | |
175 0.001842 0.000986 <SNR>71_shellslash() | |
78 0.001757 0.001307 <SNR>71_repo_tree() | |
9 0.001732 0.000227 statusline#gitindicator() | |
9 0.001082 statusline#default() | |
27 0.000883 0.000102 fugitive#buffer() | |
175 0.000855 <SNR>71_winshell() | |
27 0.000780 0.000687 <SNR>71_buffer() | |
86 0.000776 <SNR>71_sub() | |
6 0.000754 0.000423 MyFoldtext() | |
4 0.000753 <SNR>31_Highlight_Matching_Pair() | |
2 0.000718 0.000043 tabline#branch() | |
220 0.000642 <SNR>71_repo_dir() | |
FUNCTIONS SORTED ON SELF TIME | |
count total (s) self (s) function | |
171 0.008143 0.006366 <SNR>71_buffer_spec() | |
142 0.004753 <SNR>71_repo() | |
9 0.003293 0.002211 statusline#git() | |
28 0.015505 0.001598 <SNR>71_buffer_path() | |
27 0.002755 0.001352 <SNR>71_buffer_type() | |
78 0.001757 0.001307 <SNR>71_repo_tree() | |
18 0.021202 0.001112 statusline#customrev() | |
9 0.001082 statusline#default() | |
175 0.001842 0.000986 <SNR>71_shellslash() | |
175 0.000855 <SNR>71_winshell() | |
86 0.000776 <SNR>71_sub() | |
4 0.000753 <SNR>31_Highlight_Matching_Pair() | |
27 0.000780 0.000687 <SNR>71_buffer() | |
220 0.000642 <SNR>71_repo_dir() | |
18 0.012310 0.000614 <SNR>71_buffer_rev() | |
138 0.005577 0.000568 <SNR>71_buffer_repo() | |
204 0.000525 <SNR>71_buffer_getvar() | |
6 0.000754 0.000423 MyFoldtext() | |
80 0.000398 <SNR>71_cpath() | |
1 0.000364 repeat#wrap() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment