Advertisement
Guest User

profile buffer.vim

a guest
Oct 22nd, 2014
16
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 31.93 KB | None | 0 0
  1. SCRIPT C:\Users\mbakiev\.vim\bundle\unite.vim\autoload\unite\sources\buffer.vim
  2. Sourced 1 time
  3. Total time: 0.000349
  4. Self time: 0.000331
  5.  
  6. count total (s) self (s)
  7. "=============================================================================
  8. " FILE: buffer.vim
  9. " AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
  10. " License: MIT license {{{
  11. " Permission is hereby granted, free of charge, to any person obtaining
  12. " a copy of this software and associated documentation files (the
  13. " "Software"), to deal in the Software without restriction, including
  14. " without limitation the rights to use, copy, modify, merge, publish,
  15. " distribute, sublicense, and/or sell copies of the Software, and to
  16. " permit persons to whom the Software is furnished to do so, subject to
  17. " the following conditions:
  18. "
  19. " The above copyright notice and this permission notice shall be included
  20. " in all copies or substantial portions of the Software.
  21. "
  22. " THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  23. " OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  24. " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  25. " IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  26. " CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  27. " TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  28. " SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  29. " }}}
  30. "=============================================================================
  31.  
  32. 1 0.000011 let s:save_cpo = &cpo
  33. 1 0.000008 set cpo&vim
  34.  
  35. " Variables "{{{
  36. 1 0.000031 0.000014 call unite#util#set_default(
  37. \ 'g:unite_source_buffer_time_format',
  38. \ '(%Y/%m/%d %H:%M:%S) ')
  39. "}}}
  40.  
  41. 1 0.000004 function! unite#sources#buffer#define() "{{{
  42. return [s:source_buffer_all, s:source_buffer_tab]
  43. endfunction"}}}
  44.  
  45. 1 0.000010 let s:source_buffer_all = {
  46. \ 'name' : 'buffer',
  47. \ 'description' : 'candidates from buffer list',
  48. \ 'syntax' : 'uniteSource__Buffer',
  49. \ 'hooks' : {},
  50. \ 'default_kind' : 'buffer',
  51. \}
  52.  
  53. 1 0.000003 function! s:source_buffer_all.hooks.on_init(args, context) "{{{
  54. let a:context.source__is_bang =
  55. \ (get(a:args, 0, '') ==# '!')
  56. let a:context.source__is_question =
  57. \ (get(a:args, 0, '') ==# '?')
  58. let a:context.source__is_plus =
  59. \ (get(a:args, 0, '') ==# '+')
  60. let a:context.source__is_minus =
  61. \ (get(a:args, 0, '') ==# '-')
  62. let a:context.source__buffer_list =
  63. \ s:get_buffer_list(a:context.source__is_bang,
  64. \ a:context.source__is_question,
  65. \ a:context.source__is_plus,
  66. \ a:context.source__is_minus)
  67. endfunction"}}}
  68. 1 0.000002 function! s:source_buffer_all.hooks.on_syntax(args, context) "{{{
  69. syntax match uniteSource__Buffer_Name /[^/ \[\]]\+\s/
  70. \ contained containedin=uniteSource__Buffer
  71. highlight default link uniteSource__Buffer_Name Function
  72. syntax match uniteSource__Buffer_Prefix /\s\d\+\s\%(\S\+\)\?/
  73. \ contained containedin=uniteSource__Buffer
  74. highlight default link uniteSource__Buffer_Prefix Constant
  75. syntax match uniteSource__Buffer_Info /\[.\{-}\] /
  76. \ contained containedin=uniteSource__Buffer
  77. highlight default link uniteSource__Buffer_Info PreProc
  78. syntax match uniteSource__Buffer_Modified /\[.\{-}+\]/
  79. \ contained containedin=uniteSource__Buffer
  80. highlight default link uniteSource__Buffer_Modified Statement
  81. syntax match uniteSource__Buffer_NoFile /\[nofile\]/
  82. \ contained containedin=uniteSource__Buffer
  83. highlight default link uniteSource__Buffer_NoFile Function
  84. syntax match uniteSource__Buffer_Time /(.\{-}) /
  85. \ contained containedin=uniteSource__Buffer
  86. highlight default link uniteSource__Buffer_Time Statement
  87. endfunction"}}}
  88. 1 0.000001 function! s:source_buffer_all.hooks.on_post_filter(args, context) "{{{
  89. for candidate in a:context.candidates
  90. let candidate.action__path =
  91. \ unite#util#substitute_path_separator(
  92. \ fnamemodify(s:make_word(candidate.action__buffer_nr), ':p'))
  93. let candidate.action__directory =
  94. \ unite#helper#get_buffer_directory(candidate.action__buffer_nr)
  95. endfor
  96. endfunction"}}}
  97.  
  98. 1 0.000003 function! s:source_buffer_all.gather_candidates(args, context) "{{{
  99. if a:context.is_redraw
  100. " Recaching.
  101. let a:context.source__buffer_list =
  102. \ s:get_buffer_list(a:context.source__is_bang,
  103. \ a:context.source__is_question,
  104. \ a:context.source__is_plus,
  105. \ a:context.source__is_minus)
  106. endif
  107.  
  108. let candidates = map(a:context.source__buffer_list, "{
  109. \ 'word' : unite#util#substitute_path_separator(
  110. \ filereadable(s:make_word(v:val.action__buffer_nr)) ?
  111. \ fnamemodify(s:make_word(v:val.action__buffer_nr), ':p') :
  112. \ s:make_word(v:val.action__buffer_nr)),
  113. \ 'abbr' : s:make_abbr(v:val.action__buffer_nr, v:val.source__flags)
  114. \ . s:format_time(v:val.source__time),
  115. \ 'action__buffer_nr' : v:val.action__buffer_nr,
  116. \}")
  117.  
  118. return candidates
  119. endfunction"}}}
  120. 1 0.000003 function! s:source_buffer_all.complete(args, context, arglead, cmdline, cursorpos) "{{{
  121. return ['!', '?', '+', '-']
  122. endfunction"}}}
  123.  
  124. 1 0.000007 let s:source_buffer_tab = deepcopy(s:source_buffer_all)
  125. 1 0.000003 let s:source_buffer_tab.name = 'buffer_tab'
  126. 1 0.000003 let s:source_buffer_tab.description =
  127. \ 'candidates from buffer list in current tab'
  128.  
  129. 1 0.000001 function! s:source_buffer_tab.gather_candidates(args, context) "{{{
  130. if a:context.is_redraw
  131. " Recaching.
  132. let a:context.source__buffer_list =
  133. \ s:get_buffer_list(a:context.source__is_bang,
  134. \ a:context.source__is_question,
  135. \ a:context.source__is_plus,
  136. \ a:context.source__is_minus)
  137. endif
  138.  
  139. if !exists('g:loaded_tabpagebuffer')
  140. call unite#print_source_message(
  141. \ 'tabpagebuffer plugin is not installed.', self.name)
  142. return []
  143. endif
  144.  
  145. if !exists('t:tabpagebuffer')
  146. return []
  147. endif
  148.  
  149. let list = filter(copy(a:context.source__buffer_list),
  150. \ 'has_key(t:tabpagebuffer, v:val.action__buffer_nr)')
  151.  
  152. let candidates = map(list, "{
  153. \ 'word' : unite#util#substitute_path_separator(
  154. \ fnamemodify(s:make_word(v:val.action__buffer_nr), ':p')),
  155. \ 'abbr' : s:make_abbr(v:val.action__buffer_nr, v:val.source__flags)
  156. \ . s:format_time(v:val.source__time),
  157. \ 'action__buffer_nr' : v:val.action__buffer_nr,
  158. \}")
  159.  
  160. return candidates
  161. endfunction"}}}
  162.  
  163. " Misc
  164. 1 0.000002 function! s:make_word(bufnr) "{{{
  165. let filetype = getbufvar(a:bufnr, '&filetype')
  166. if filetype ==# 'vimfiler'
  167. let path = getbufvar(a:bufnr, 'vimfiler').current_dir
  168. let path = printf('*vimfiler* [%s]',
  169. \ unite#util#substitute_path_separator(simplify(path)))
  170. elseif filetype ==# 'vimshell'
  171. let vimshell = getbufvar(a:bufnr, 'vimshell')
  172. let path = printf('*vimshell*: [%s]',
  173. \ unite#util#substitute_path_separator(simplify(vimshell.current_dir)))
  174. else
  175. let path = unite#util#substitute_path_separator(simplify(bufname(a:bufnr)))
  176. endif
  177.  
  178. return path
  179. endfunction"}}}
  180. 1 0.000002 function! s:make_abbr(bufnr, flags) "{{{
  181. let bufname = fnamemodify(bufname(a:bufnr), ':t')
  182. if bufname == ''
  183. let bufname = bufname(a:bufnr)
  184. endif
  185.  
  186. let filetype = getbufvar(a:bufnr, '&filetype')
  187. if filetype ==# 'vimfiler' || filetype ==# 'vimshell'
  188. if filetype ==# 'vimfiler'
  189. let vimfiler = getbufvar(a:bufnr, 'vimfiler')
  190. let path = vimfiler.current_dir
  191. if vimfiler.source !=# 'file'
  192. let path = vimfiler.source . ':' . path
  193. endif
  194. else
  195. let path = simplify(getbufvar(a:bufnr, 'vimshell').current_dir)
  196. endif
  197.  
  198. let path = printf('%s [%s : %s]', bufname, path, filetype)
  199. else
  200. let path = bufname(a:bufnr) == '' ? 'No Name' :
  201. \ simplify(fnamemodify(bufname(a:bufnr), ':~:.'))
  202. if a:flags != ''
  203. " Format flags so that buffer numbers are aligned on the left.
  204. " example: '42 a% +' => ' 42 a%+ '
  205. " '3 h +' => ' 3 h+ '
  206. let nowhitespace = substitute(a:flags, '\s*', '', 'g')
  207. let path = substitute(nowhitespace, '\v(\d+)(.*)',
  208. \ '\=printf("%*s %-*s", 3, submatch(1), 4, submatch(2))', 'g') . path
  209. endif
  210.  
  211. if filetype != ''
  212. let path .= ' [' . filetype . ']'
  213. endif
  214. endif
  215.  
  216. return (getbufvar(a:bufnr, '&buftype') =~# 'nofile' ? '[nofile] ' : '' ) .
  217. \ unite#util#substitute_path_separator(path) . ' '
  218. endfunction"}}}
  219. 1 0.000003 function! s:compare(candidate_a, candidate_b) "{{{
  220. return a:candidate_b.source__time - a:candidate_a.source__time
  221. endfunction"}}}
  222. 1 0.000003 function! s:get_buffer_list(is_bang, is_question, is_plus, is_minus) "{{{
  223. " Get :ls flags.
  224. redir => output
  225. silent! ls
  226. redir END
  227.  
  228. let flag_dict = {}
  229. for out in map(split(output, '\n'), 'split(v:val)')
  230. let flag_dict[out[0]] = matchstr(join(out), '^.*\ze\s\+"')
  231. endfor
  232.  
  233. " Make buffer list.
  234. let list = []
  235. let bufnr = 1
  236. let buffer_list = unite#sources#buffer#variables#get_buffer_list()
  237. while bufnr <= bufnr('$')
  238. if s:is_listed(a:is_bang, a:is_question, a:is_plus, a:is_minus, bufnr)
  239. \ && bufnr != bufnr('%')
  240. let dict = get(buffer_list, bufnr, {
  241. \ 'action__buffer_nr' : bufnr,
  242. \ 'source__time' : 0,
  243. \ })
  244. let dict.source__flags = get(flag_dict, bufnr, '')
  245.  
  246. call add(list, dict)
  247. endif
  248. let bufnr += 1
  249. endwhile
  250.  
  251. call sort(list, 's:compare')
  252.  
  253. if s:is_listed(a:is_bang, a:is_question, a:is_plus, a:is_minus, bufnr('%'))
  254. " Add current buffer.
  255. let dict = get(unite#sources#buffer#variables#get_buffer_list(),
  256. \ bufnr('%'), {
  257. \ 'action__buffer_nr' : bufnr('%'),
  258. \ 'source__time' : 0,
  259. \ })
  260. let dict.source__flags = get(flag_dict, bufnr('%'), '')
  261.  
  262. call add(list, dict)
  263. endif
  264.  
  265. return list
  266. endfunction"}}}
  267.  
  268. 1 0.000003 function! s:is_listed(is_bang, is_question, is_plus, is_minus, bufnr) "{{{
  269. return bufexists(a:bufnr) &&
  270. \ (a:is_question ? !buflisted(a:bufnr) :
  271. \ (a:is_bang || buflisted(a:bufnr)))
  272. \ && (!a:is_plus || getbufvar(a:bufnr, '&mod'))
  273. \ && (!a:is_minus || getbufvar(a:bufnr, '&buftype') !~# 'nofile')
  274. \ && (getbufvar(a:bufnr, '&filetype') !=# 'unite'
  275. \ || getbufvar(a:bufnr, 'unite').buffer_name !=#
  276. \ unite#get_current_unite().buffer_name)
  277. endfunction"}}}
  278.  
  279. 1 0.000003 function! s:format_time(time) "{{{
  280. if empty(a:time)
  281. return ''
  282. endif
  283. return strftime(g:unite_source_buffer_time_format, a:time)
  284. endfunction"}}}
  285.  
  286. 1 0.000007 let &cpo = s:save_cpo
  287. 1 0.000002 unlet s:save_cpo
  288.  
  289. " vim: foldmethod=marker
  290.  
  291. FUNCTION <SNR>124_is_listed()
  292. Called 4 times
  293. Total time: 0.000040
  294. Self time: 0.000040
  295.  
  296. count total (s) self (s)
  297. 4 0.000038 return bufexists(a:bufnr) && (a:is_question ? !buflisted(a:bufnr) : (a:is_bang || buflisted(a:bufnr))) && (!a:is_plus || getbufvar(a:bufnr, '&mod')) && (!a:is_minus || getbufvar(a:bufnr, '&buftype') !~# 'nofile') && (getbufvar(a:bufnr, '&filetype') !=# 'unite' || getbufvar(a:bufnr, 'unite').buffer_name !=# unite#get_current_unite().buffer_name)
  298.  
  299. FUNCTION <SNR>124_get_buffer_list()
  300. Called 1 time
  301. Total time: 0.000294
  302. Self time: 0.000245
  303.  
  304. count total (s) self (s)
  305. " Get :ls flags.
  306. 1 0.000003 redir => output
  307. 1 0.000031 silent! ls
  308. 1 0.000002 redir END
  309.  
  310. 1 0.000005 let flag_dict = {}
  311. 4 0.000053 for out in map(split(output, '\n'), 'split(v:val)')
  312. 3 0.000036 let flag_dict[out[0]] = matchstr(join(out), '^.*\ze\s\+"')
  313. 3 0.000003 endfor
  314.  
  315. " Make buffer list.
  316. 1 0.000001 let list = []
  317. 1 0.000001 let bufnr = 1
  318. 1 0.000008 0.000005 let buffer_list = unite#sources#buffer#variables#get_buffer_list()
  319. 4 0.000007 while bufnr <= bufnr('$')
  320. 3 0.000050 0.000019 if s:is_listed(a:is_bang, a:is_question, a:is_plus, a:is_minus, bufnr) && bufnr != bufnr('%')
  321. 2 0.000008 let dict = get(buffer_list, bufnr, { 'action__buffer_nr' : bufnr, 'source__time' : 0, })
  322. 2 0.000005 let dict.source__flags = get(flag_dict, bufnr, '')
  323.  
  324. 2 0.000004 call add(list, dict)
  325. 2 0.000001 endif
  326. 3 0.000004 let bufnr += 1
  327. 3 0.000002 endwhile
  328.  
  329. 1 0.000012 0.000008 call sort(list, 's:compare')
  330.  
  331. 1 0.000014 0.000005 if s:is_listed(a:is_bang, a:is_question, a:is_plus, a:is_minus, bufnr('%'))
  332. " Add current buffer.
  333. 1 0.000010 0.000008 let dict = get(unite#sources#buffer#variables#get_buffer_list(), bufnr('%'), { 'action__buffer_nr' : bufnr('%'), 'source__time' : 0, })
  334. 1 0.000003 let dict.source__flags = get(flag_dict, bufnr('%'), '')
  335.  
  336. 1 0.000002 call add(list, dict)
  337. 1 0.000001 endif
  338.  
  339. 1 0.000001 return list
  340.  
  341. FUNCTION 510()
  342. Called 1 time
  343. Total time: 0.000401
  344. Self time: 0.000106
  345.  
  346. count total (s) self (s)
  347. 1 0.000027 let a:context.source__is_bang = (get(a:args, 0, '') ==# '!')
  348. 1 0.000010 let a:context.source__is_question = (get(a:args, 0, '') ==# '?')
  349. 1 0.000055 let a:context.source__is_plus = (get(a:args, 0, '') ==# '+')
  350. 1 0.000003 let a:context.source__is_minus = (get(a:args, 0, '') ==# '-')
  351. 1 0.000304 0.000010 let a:context.source__buffer_list = s:get_buffer_list(a:context.source__is_bang, a:context.source__is_question, a:context.source__is_plus, a:context.source__is_minus)
  352.  
  353. FUNCTION 512()
  354. Called 1 time
  355. Total time: 0.024335
  356. Self time: 0.011775
  357.  
  358. count total (s) self (s)
  359. 4 0.000007 for candidate in a:context.candidates
  360. 3 0.011996 0.011730 let candidate.action__path = unite#util#substitute_path_separator( fnamemodify(s:make_word(candidate.action__buffer_nr), ':p'))
  361. 3 0.012316 0.000022 let candidate.action__directory = unite#helper#get_buffer_directory(candidate.action__buffer_nr)
  362. 3 0.000003 endfor
  363.  
  364. FUNCTION 513()
  365. Called 1 time
  366. Total time: 1.375129
  367. Self time: 1.343592
  368.  
  369. count total (s) self (s)
  370. 1 0.000001 if a:context.is_redraw
  371. " Recaching.
  372. let a:context.source__buffer_list = s:get_buffer_list(a:context.source__is_bang, a:context.source__is_question, a:context.source__is_plus, a:context.source__is_minus)
  373. endif
  374.  
  375. 1 1.375116 1.343579 let candidates = map(a:context.source__buffer_list, "{ 'word' : unite#util#substitute_path_separator( filereadable(s:make_word(v:val.action__buffer_nr)) ? fnamemodify(s:make_word(v:val.action__buffer_nr), ':p') : s:make_word(v:val.action__buffer_nr)), 'abbr' : s:make_abbr(v:val.action__buffer_nr, v:val.source__flags) . s:format_time(v:val.source__time), 'action__buffer_nr' : v:val.action__buffer_nr,}")
  376.  
  377. 1 0.000003 return candidates
  378.  
  379. FUNCTION 514()
  380. Called 0 times
  381. Total time: 0.000000
  382. Self time: 0.000000
  383.  
  384. count total (s) self (s)
  385. return ['!', '?', '+', '-']
  386.  
  387. FUNCTION 511()
  388. Called 1 time
  389. Total time: 0.000066
  390. Self time: 0.000066
  391.  
  392. count total (s) self (s)
  393. 1 0.000011 syntax match uniteSource__Buffer_Name /[^/ \[\]]\+\s/ contained containedin=uniteSource__Buffer
  394. 1 0.000003 highlight default link uniteSource__Buffer_Name Function
  395. 1 0.000008 syntax match uniteSource__Buffer_Prefix /\s\d\+\s\%(\S\+\)\?/ contained containedin=uniteSource__Buffer
  396. 1 0.000003 highlight default link uniteSource__Buffer_Prefix Constant
  397. 1 0.000008 syntax match uniteSource__Buffer_Info /\[.\{-}\] / contained containedin=uniteSource__Buffer
  398. 1 0.000003 highlight default link uniteSource__Buffer_Info PreProc
  399. 1 0.000007 syntax match uniteSource__Buffer_Modified /\[.\{-}+\]/ contained containedin=uniteSource__Buffer
  400. 1 0.000002 highlight default link uniteSource__Buffer_Modified Statement
  401. 1 0.000007 syntax match uniteSource__Buffer_NoFile /\[nofile\]/ contained containedin=uniteSource__Buffer
  402. 1 0.000002 highlight default link uniteSource__Buffer_NoFile Function
  403. 1 0.000007 syntax match uniteSource__Buffer_Time /(.\{-}) / contained containedin=uniteSource__Buffer
  404. 1 0.000002 highlight default link uniteSource__Buffer_Time Statement
  405.  
  406. FUNCTION 515()
  407. Called 0 times
  408. Total time: 0.000000
  409. Self time: 0.000000
  410.  
  411. count total (s) self (s)
  412. if a:context.is_redraw
  413. " Recaching.
  414. let a:context.source__buffer_list = s:get_buffer_list(a:context.source__is_bang, a:context.source__is_question, a:context.source__is_plus, a:context.source__is_minus)
  415. endif
  416.  
  417. if !exists('g:loaded_tabpagebuffer')
  418. call unite#print_source_message( 'tabpagebuffer plugin is not installed.', self.name)
  419. return []
  420. endif
  421.  
  422. if !exists('t:tabpagebuffer')
  423. return []
  424. endif
  425.  
  426. let list = filter(copy(a:context.source__buffer_list), 'has_key(t:tabpagebuffer, v:val.action__buffer_nr)')
  427.  
  428. let candidates = map(list, "{ 'word' : unite#util#substitute_path_separator( fnamemodify(s:make_word(v:val.action__buffer_nr), ':p')), 'abbr' : s:make_abbr(v:val.action__buffer_nr, v:val.source__flags) . s:format_time(v:val.source__time), 'action__buffer_nr' : v:val.action__buffer_nr,}")
  429.  
  430. return candidates
  431.  
  432. FUNCTION <SNR>124_make_abbr()
  433. Called 3 times
  434. Total time: 0.030298
  435. Self time: 0.030102
  436.  
  437. count total (s) self (s)
  438. 3 0.000045 let bufname = fnamemodify(bufname(a:bufnr), ':t')
  439. 3 0.000016 if bufname == ''
  440. let bufname = bufname(a:bufnr)
  441. endif
  442.  
  443. 3 0.000031 let filetype = getbufvar(a:bufnr, '&filetype')
  444. 3 0.000018 if filetype ==# 'vimfiler' || filetype ==# 'vimshell'
  445. if filetype ==# 'vimfiler'
  446. let vimfiler = getbufvar(a:bufnr, 'vimfiler')
  447. let path = vimfiler.current_dir
  448. if vimfiler.source !=# 'file'
  449. let path = vimfiler.source . ':' . path
  450. endif
  451. else
  452. let path = simplify(getbufvar(a:bufnr, 'vimshell').current_dir)
  453. endif
  454.  
  455. let path = printf('%s [%s : %s]', bufname, path, filetype)
  456. else
  457. 3 0.029358 let path = bufname(a:bufnr) == '' ? 'No Name' : simplify(fnamemodify(bufname(a:bufnr), ':~:.'))
  458. 3 0.000042 if a:flags != ''
  459. " Format flags so that buffer numbers are aligned on the left.
  460. " example: '42 a% +' => ' 42 a%+ '
  461. " '3 h +' => ' 3 h+ '
  462. 3 0.000146 let nowhitespace = substitute(a:flags, '\s*', '', 'g')
  463. 3 0.000129 let path = substitute(nowhitespace, '\v(\d+)(.*)', '\=printf("%*s %-*s", 3, submatch(1), 4, submatch(2))', 'g') . path
  464. 3 0.000008 endif
  465.  
  466. 3 0.000011 if filetype != ''
  467. 1 0.000007 let path .= ' [' . filetype . ']'
  468. 1 0.000001 endif
  469. 3 0.000004 endif
  470.  
  471. 3 0.000306 0.000110 return (getbufvar(a:bufnr, '&buftype') =~# 'nofile' ? '[nofile] ' : '' ) . unite#util#substitute_path_separator(path) . ' '
  472.  
  473. FUNCTION <SNR>124_format_time()
  474. Called 3 times
  475. Total time: 0.000059
  476. Self time: 0.000059
  477.  
  478. count total (s) self (s)
  479. 3 0.000015 if empty(a:time)
  480. 2 0.000004 return ''
  481. endif
  482. 1 0.000029 return strftime(g:unite_source_buffer_time_format, a:time)
  483.  
  484. FUNCTION unite#sources#buffer#define()
  485. Called 1 time
  486. Total time: 0.000005
  487. Self time: 0.000005
  488.  
  489. count total (s) self (s)
  490. 1 0.000004 return [s:source_buffer_all, s:source_buffer_tab]
  491.  
  492. FUNCTION <SNR>124_make_word()
  493. Called 9 times
  494. Total time: 0.001004
  495. Self time: 0.000563
  496.  
  497. count total (s) self (s)
  498. 9 0.000121 let filetype = getbufvar(a:bufnr, '&filetype')
  499. 9 0.000037 if filetype ==# 'vimfiler'
  500. let path = getbufvar(a:bufnr, 'vimfiler').current_dir
  501. let path = printf('*vimfiler* [%s]', unite#util#substitute_path_separator(simplify(path)))
  502. elseif filetype ==# 'vimshell'
  503. let vimshell = getbufvar(a:bufnr, 'vimshell')
  504. let path = printf('*vimshell*: [%s]', unite#util#substitute_path_separator(simplify(vimshell.current_dir)))
  505. else
  506. 9 0.000581 0.000140 let path = unite#util#substitute_path_separator(simplify(bufname(a:bufnr)))
  507. 9 0.000014 endif
  508.  
  509. 9 0.000017 return path
  510.  
  511. FUNCTION <SNR>124_compare()
  512. Called 2 times
  513. Total time: 0.000004
  514. Self time: 0.000004
  515.  
  516. count total (s) self (s)
  517. 2 0.000004 return a:candidate_b.source__time - a:candidate_a.source__time
  518.  
  519. FUNCTIONS SORTED ON TOTAL TIME
  520. count total (s) self (s) function
  521. 1 1.375129 1.343592 513()
  522. 3 0.030298 0.030102 <SNR>124_make_abbr()
  523. 1 0.024335 0.011775 512()
  524. 9 0.001004 0.000563 <SNR>124_make_word()
  525. 1 0.000401 0.000106 510()
  526. 1 0.000294 0.000245 <SNR>124_get_buffer_list()
  527. 1 0.000066 511()
  528. 3 0.000059 <SNR>124_format_time()
  529. 4 0.000040 <SNR>124_is_listed()
  530. 1 0.000005 unite#sources#buffer#define()
  531. 2 0.000004 <SNR>124_compare()
  532. 514()
  533. 515()
  534.  
  535. FUNCTIONS SORTED ON SELF TIME
  536. count total (s) self (s) function
  537. 1 1.375129 1.343592 513()
  538. 3 0.030298 0.030102 <SNR>124_make_abbr()
  539. 1 0.024335 0.011775 512()
  540. 9 0.001004 0.000563 <SNR>124_make_word()
  541. 1 0.000294 0.000245 <SNR>124_get_buffer_list()
  542. 1 0.000401 0.000106 510()
  543. 1 0.000066 511()
  544. 3 0.000059 <SNR>124_format_time()
  545. 4 0.000040 <SNR>124_is_listed()
  546. 1 0.000005 unite#sources#buffer#define()
  547. 2 0.000004 <SNR>124_compare()
  548. 515()
  549. 514()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement