vim-airline / vim-airline

lean & mean status/tabline for vim that's light as air
MIT License
17.79k stars 1.11k forks source link

Airline Denite support is extremely unresponsive #1460

Closed achilleas-k closed 7 years ago

achilleas-k commented 7 years ago

environment

actual behavior

Extremely unresponsive scrolling of Denite buffer when airline is enabled. This stops happening if airline is rolled back to d46fb524bde7571fe55d15b16665e8eb38d1ffbd (the last commit before denite support was included).

The unresponsiveness is so slow that holding j in the denite buffer for a second and then releasing will continue scrolling the buffer for another few seconds.

Filtering is also much slower.

expected behavior

Responsive scrolling and filtering.

Minimal vimrc and profile.log

With the following minimal vimrc:

call plug#begin('~/.vim/plugged')
Plug 'Shougo/denite.nvim'
Plug 'vim-airline/vim-airline'
call plug#end()

The following profile.log was produced:

Click to expand ``` SCRIPT /usr/share/vim/vim80/scripts.vim Sourced 1 time Total time: 0.000799 Self time: 0.000799 count total (s) self (s) " Vim support file to detect file types in scripts " " Maintainer: Bram Moolenaar " Last change: 2017 Mar 04 " This file is called by an autocommand for every file that has just been " loaded into a buffer. It checks if the type of file can be recognized by " the file contents. The autocommand is in $VIMRUNTIME/filetype.vim. " Only do the rest when the FileType autocommand has not been triggered yet. 1 0.000005 if did_filetype() finish endif " Load the user defined scripts file first " Only do this when the FileType autocommand has not been triggered yet 1 0.000006 if exists("myscriptsfile") && filereadable(expand(myscriptsfile)) execute "source " . myscriptsfile if did_filetype() finish endif endif " Line continuation is used here, remove 'C' from 'cpoptions' 1 0.000014 let s:cpo_save = &cpo 1 0.000013 set cpo&vim 1 0.000008 let s:line1 = getline(1) 1 0.000006 if s:line1 =~ "^#!" " A script that starts with "#!". " Check for a line like "#!/usr/bin/env VAR=val bash". Turn it into " "#!/usr/bin/bash" to make matching easier. if s:line1 =~ '^#!\s*\S*\' let s:name = substitute(s:line1, '^#!.*\\s\+\(\i\+\).*', '\1', '') elseif s:line1 =~ '^#!\s*[^/\\ ]*\>\([^/\\]\|$\)' let s:name = substitute(s:line1, '^#!\s*\([^/\\ ]*\>\).*', '\1', '') else let s:name = substitute(s:line1, '^#!\s*\S*[/\\]\(\i\+\).*', '\1', '') endif " tcl scripts may have #!/bin/sh in the first line and "exec wish" in the " third line. Suggested by Steven Atkinson. if getline(3) =~ '^exec wish' let s:name = 'wish' endif " Bourne-like shell scripts: bash bash2 ksh ksh93 sh if s:name =~ '^\(bash\d*\|\|ksh\d*\|sh\)\>' call SetFileTypeSH(s:line1) " defined in filetype.vim " csh scripts elseif s:name =~ '^csh\>' if exists("g:filetype_csh") call SetFileTypeShell(g:filetype_csh) else call SetFileTypeShell("csh") endif " tcsh scripts elseif s:name =~ '^tcsh\>' call SetFileTypeShell("tcsh") " Z shell scripts elseif s:name =~ '^zsh\>' set ft=zsh " TCL scripts elseif s:name =~ '^\(tclsh\|wish\|expectk\|itclsh\|itkwish\)\>' set ft=tcl " Expect scripts elseif s:name =~ '^expect\>' set ft=expect " Gnuplot scripts elseif s:name =~ '^gnuplot\>' set ft=gnuplot " Makefiles elseif s:name =~ 'make\>' set ft=make " Lua elseif s:name =~ 'lua' set ft=lua " Perl 6 elseif s:name =~ 'perl6' set ft=perl6 " Perl elseif s:name =~ 'perl' set ft=perl " PHP elseif s:name =~ 'php' set ft=php " Python elseif s:name =~ 'python' set ft=python " Groovy elseif s:name =~ '^groovy\>' set ft=groovy " Ruby elseif s:name =~ 'ruby' set ft=ruby " JavaScript elseif s:name =~ 'node\(js\)\=\>' || s:name =~ 'rhino\>' set ft=javascript " BC calculator elseif s:name =~ '^bc\>' set ft=bc " sed elseif s:name =~ 'sed\>' set ft=sed " OCaml-scripts elseif s:name =~ 'ocaml' set ft=ocaml " Awk scripts elseif s:name =~ 'awk\>' set ft=awk " Website MetaLanguage elseif s:name =~ 'wml' set ft=wml " Scheme scripts elseif s:name =~ 'scheme' set ft=scheme " CFEngine scripts elseif s:name =~ 'cfengine' set ft=cfengine " Erlang scripts elseif s:name =~ 'escript' set ft=erlang " Haskell elseif s:name =~ 'haskell' set ft=haskell " Scala elseif s:name =~ 'scala\>' set ft=scala endif unlet s:name else " File does not start with "#!". 1 0.000004 let s:line2 = getline(2) 1 0.000010 let s:line3 = getline(3) 1 0.000004 let s:line4 = getline(4) 1 0.000003 let s:line5 = getline(5) " Bourne-like shell scripts: sh ksh bash bash2 1 0.000005 if s:line1 =~ '^:$' call SetFileTypeSH(s:line1) " defined in filetype.vim " Z shell scripts elseif s:line1 =~ '^#compdef\>' || s:line1 =~ '^#autoload\>' || \ "\n".s:line1."\n".s:line2."\n".s:line3."\n".s:line4."\n".s:line5 =~ '\n\s*emulate\s\+\%(-[LR]\s\+\)\=[ckz]\=sh\>' set ft=zsh " ELM Mail files elseif s:line1 =~ '^From \([a-zA-Z][a-zA-Z_0-9\.=-]*\(@[^ ]*\)\=\|-\) .* \(19\|20\)\d\d$' set ft=mail " Mason elseif s:line1 =~ '^<[%&].*>' set ft=mason " Vim scripts (must have '" vim' as the first line to trigger this) elseif s:line1 =~ '^" *[vV]im$' set ft=vim " MOO elseif s:line1 =~ '^\*\* LambdaMOO Database, Format Version \%([1-3]\>\)\@!\d\+ \*\*$' set ft=moo " Diff file: " - "diff" in first line (context diff) " - "Only in " in first line " - "--- " in first line and "+++ " in second line (unified diff). " - "*** " in first line and "--- " in second line (context diff). " - "# It was generated by makepatch " in the second line (makepatch diff). " - "Index: " in the first line (CVS file) " - "=== ", line of "=", "---", "+++ " (SVK diff) " - "=== ", "--- ", "+++ " (bzr diff, common case) " - "=== (removed|added|renamed|modified)" (bzr diff, alternative) " - "# HG changeset patch" in first line (Mercurial export format) elseif s:line1 =~ '^\(diff\>\|Only in \|\d\+\(,\d\+\)\=[cda]\d\+\>\|# It was generated by makepatch \|Index:\s\+\f\+\r\=$\|===== \f\+ \d\+\.\d\+ vs edited\|==== //\f\+#\d\+\|# HG changeset patch\)' \ || (s:line1 =~ '^--- ' && s:line2 =~ '^+++ ') \ || (s:line1 =~ '^\* looking for ' && s:line2 =~ '^\* comparing to ') \ || (s:line1 =~ '^\*\*\* ' && s:line2 =~ '^--- ') \ || (s:line1 =~ '^=== ' && ((s:line2 =~ '^=\{66\}' && s:line3 =~ '^--- ' && s:line4 =~ '^+++') || (s:line2 =~ '^--- ' && s:line3 =~ '^+++ '))) \ || (s:line1 =~ '^=== \(removed\|added\|renamed\|modified\)') set ft=diff " PostScript Files (must have %!PS as the first line, like a2ps output) elseif s:line1 =~ '^%![ \t]*PS' set ft=postscr " M4 scripts: Guess there is a line that starts with "dnl". elseif s:line1 =~ '^\s*dnl\>' \ || s:line2 =~ '^\s*dnl\>' \ || s:line3 =~ '^\s*dnl\>' \ || s:line4 =~ '^\s*dnl\>' \ || s:line5 =~ '^\s*dnl\>' set ft=m4 " AmigaDos scripts elseif $TERM == "amiga" \ && (s:line1 =~ "^;" || s:line1 =~ '^\.[bB][rR][aA]') set ft=amiga " SiCAD scripts (must have procn or procd as the first line to trigger this) elseif s:line1 =~? '^ *proc[nd] *$' set ft=sicad " Purify log files start with "**** Purify" elseif s:line1 =~ '^\*\*\*\* Purify' set ft=purifylog " XML elseif s:line1 =~ '' set ft=xml " XHTML (e.g.: PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN") elseif s:line1 =~ '\' set ft=html " PDF elseif s:line1 =~ '^%PDF-' set ft=pdf " XXD output elseif s:line1 =~ '^\x\{7}: \x\{2} \=\x\{2} \=\x\{2} \=\x\{2} ' set ft=xxd " RCS/CVS log output elseif s:line1 =~ '^RCS file:' || s:line2 =~ '^RCS file:' set ft=rcslog " CVS commit elseif s:line2 =~ '^CVS:' || getline("$") =~ '^CVS: ' set ft=cvs " Prescribe elseif s:line1 =~ '^!R!' set ft=prescribe " Send-pr elseif s:line1 =~ '^SEND-PR:' set ft=sendpr " SNNS files elseif s:line1 =~ '^SNNS network definition file' set ft=snnsnet elseif s:line1 =~ '^SNNS pattern definition file' set ft=snnspat elseif s:line1 =~ '^SNNS result file' set ft=snnsres " Virata elseif s:line1 =~ '^%.\{-}[Vv]irata' \ || s:line2 =~ '^%.\{-}[Vv]irata' \ || s:line3 =~ '^%.\{-}[Vv]irata' \ || s:line4 =~ '^%.\{-}[Vv]irata' \ || s:line5 =~ '^%.\{-}[Vv]irata' set ft=virata " Strace elseif s:line1 =~ '^\(\[pid \d\+\] \)\=[0-9:.]* *execve(' || s:line1 =~ '^__libc_start_main' set ft=strace " VSE JCL elseif s:line1 =~ '^\* $$ JOB\>' || s:line1 =~ '^// *JOB\>' set ft=vsejcl " TAK and SINDA elseif s:line4 =~ 'K & K Associates' || s:line2 =~ 'TAK 2000' set ft=takout elseif s:line3 =~ 'S Y S T E M S I M P R O V E D ' set ft=sindaout elseif getline(6) =~ 'Run Date: ' set ft=takcmp elseif getline(9) =~ 'Node File 1' set ft=sindacmp " DNS zone files elseif s:line1.s:line2.s:line3.s:line4 =~ '^; <<>> DiG [0-9.]\+ <<>>\|BIND.*named\|$ORIGIN\|$TTL\|IN\s\+SOA' set ft=bindzone " BAAN elseif s:line1 =~ '|\*\{1,80}' && s:line2 =~ 'VRC ' \ || s:line2 =~ '|\*\{1,80}' && s:line3 =~ 'VRC ' set ft=baan " Valgrind elseif s:line1 =~ '^==\d\+== valgrind' || s:line3 =~ '^==\d\+== Using valgrind' set ft=valgrind " Go docs elseif s:line1 =~ '^PACKAGE DOCUMENTATION$' set ft=godoc " Renderman Interface Bytestream elseif s:line1 =~ '^##RenderMan' set ft=rib " Scheme scripts elseif s:line1 =~ 'exec\s\+\S*scheme' || s:line2 =~ 'exec\s\+\S*scheme' set ft=scheme " Git output elseif s:line1 =~ '^\(commit\|tree\|object\) \x\{40\}\>\|^tag \S\+$' set ft=git " Gprof (gnu profiler) elseif s:line1 == 'Flat profile:' \ && s:line2 == '' \ && s:line3 =~ '^Each sample counts as .* seconds.$' set ft=gprof " Erlang terms " (See also: http://www.gnu.org/software/emacs/manual/html_node/emacs/Choosing-Modes.html#Choosing-Modes) elseif s:line1 =~? '-\*-.*erlang.*-\*-' set ft=erlang " CVS diff else 1 0.000004 let s:lnum = 1 1 0.000008 while getline(s:lnum) =~ "^? " && s:lnum < line("$") let s:lnum += 1 endwhile 1 0.000007 if getline(s:lnum) =~ '^Index:\s\+\f\+$' set ft=diff " locale input files: Formal Definitions of Cultural Conventions " filename must be like en_US, fr_FR@euro or en_US.UTF-8 elseif expand("%") =~ '\a\a_\a\a\($\|[.@]\)\|i18n$\|POSIX$\|translit_' let s:lnum = 1 while s:lnum < 100 && s:lnum < line("$") if getline(s:lnum) =~ '^LC_\(IDENTIFICATION\|CTYPE\|COLLATE\|MONETARY\|NUMERIC\|TIME\|MESSAGES\|PAPER\|TELEPHONE\|MEASUREMENT\|NAME\|ADDRESS\)$' setf fdcc break endif let s:lnum += 1 endwhile endif 1 0.000003 unlet s:lnum 1 0.000001 endif 1 0.000003 unlet s:line2 s:line3 s:line4 s:line5 1 0.000001 endif " Restore 'cpoptions' 1 0.000010 let &cpo = s:cpo_save 1 0.000004 unlet s:cpo_save s:line1 SCRIPT /home/achilleas/.vim/plugged/denite.nvim/autoload/denite/helper.vim Sourced 1 time Total time: 0.000441 Self time: 0.000441 count total (s) self (s) "============================================================================= " FILE: helper.vim " AUTHOR: Shougo Matsushita " License: MIT license "============================================================================= 1 0.000024 function! denite#helper#complete(arglead, cmdline, cursorpos) abort let _ = [] if a:arglead =~# ':' " Todo: source arguments completion. elseif a:arglead =~# '^-' " Option names completion. let bool_options = keys(filter(copy(denite#init#_user_options()), \ 'type(v:val) == type(v:true) || type(v:val) == type(v:false)')) let _ += map(copy(bool_options), "'-' . tr(v:val, '_', '-')") let string_options = keys(filter(copy(denite#init#_user_options()), \ 'type(v:val) != type(v:true) && type(v:val) != type(v:false)')) let _ += map(copy(string_options), "'-' . tr(v:val, '_', '-') . '='") " Add "-no-" option names completion. let _ += map(copy(bool_options), "'-no-' . tr(v:val, '_', '-')") else " Source name completion. let _ += filter(map(globpath(&runtimepath, \ 'rplugin/python3/denite/source/*.py', 1, 1), \ "fnamemodify(v:val, ':t:r')"), \ "v:val !=# 'base' && v:val !=# '__init__'") endif return uniq(sort(filter(_, 'stridx(v:val, a:arglead) == 0'))) endfunction 1 0.000012 function! denite#helper#complete_actions(arglead, cmdline, cursorpos) abort return uniq(sort(filter(copy(g:denite#_actions), \ 'stridx(v:val, a:arglead) == 0'))) endfunction 1 0.000009 function! denite#helper#call_denite(command, args, line1, line2) abort let [args, context] = denite#helper#_parse_options_args(a:args) let context.firstline = a:line1 let context.lastline = a:line2 let context.bufnr = bufnr('%') if a:command ==# 'DeniteCursorWord' let context.input = expand('') elseif a:command ==# 'DeniteBufferDir' let context.path = fnamemodify(bufname('%'), ':p:h') elseif a:command ==# 'DeniteProjectDir' let context.path = denite#util#path2project_directory(context.path) endif call denite#start(args, context) endfunction 1 0.000013 function! denite#helper#preview_file(context, filename) abort if a:context.vertical_preview let denite_winwidth = &columns call denite#util#execute_path('silent vertical pedit!', a:filename) wincmd P execute 'vert resize ' . (denite_winwidth / 2) else let previewheight_save = &previewheight try let &previewheight = a:context.previewheight call denite#util#execute_path('silent pedit!', a:filename) finally let &previewheight = previewheight_save endtry endif endfunction 1 0.000013 function! denite#helper#options() abort return map(keys(denite#init#_user_options()), "tr(v:val, '_', '-')") endfunction 1 0.000014 function! denite#helper#_parse_options_args(cmdline) abort let _ = [] let [args, options] = s:parse_options(a:cmdline) for arg in args " Add source name. let source_name = matchstr(arg, '^[^:]*') let source_arg = arg[len(source_name)+1 :] let source_args = source_arg ==# '' ? [] : \ map(split(source_arg, '\\\@= 0 let options[name] = value else call add(args, arg) endif endfor return [args, options] endfunction 1 0.000007 function! s:eval_cmdline(cmdline) abort let cmdline = '' let prev_match = 0 let match = match(a:cmdline, '\\\@= 0 if match - prev_match > 0 let cmdline .= a:cmdline[prev_match : match - 1] endif let prev_match = matchend(a:cmdline, \ '\\\@= 0 let cmdline .= a:cmdline[prev_match :] endif return cmdline endfunction 1 0.000007 function! denite#helper#has_cmdline() abort if !exists('*getcompletion') return 0 endif try call getcompletion('', 'cmdline') catch return 0 endtry return 1 endfunction 1 0.000008 function! denite#helper#_set_oldfiles(oldfiles) abort let v:oldfiles = a:oldfiles endfunction SCRIPT /home/achilleas/.vim/plugged/denite.nvim/autoload/denite/init.vim Sourced 1 time Total time: 0.000274 Self time: 0.000274 count total (s) self (s) "============================================================================= " FILE: init.vim " AUTHOR: Shougo Matsushita " License: MIT license "============================================================================= 1 0.000022 if !exists('s:is_enabled') 1 0.000010 let s:is_enabled = 0 1 0.000004 endif 1 0.000009 function! s:is_initialized() abort return exists('g:denite#_channel_id') endfunction 1 0.000008 function! denite#init#_initialize() abort if s:is_initialized() return endif augroup denite autocmd! augroup END if !has('nvim') return denite#vim#_initialize() endif if !has('python3') call denite#util#print_error( \ 'denite.nvim does not work with this version.') call denite#util#print_error( \ 'It requires Neovim with Python3 support("+python3").') return 1 endif if !exists('*execute') call denite#util#print_error( \ 'denite.nvim does not work with this version.') call denite#util#print_error( \ 'It requires Neovim +v0.1.5.') return 1 endif try if !exists('g:loaded_remote_plugins') runtime! plugin/rplugin.vim endif call _denite_init() catch call denite#util#print_error( \ 'denite.nvim is not registered as Neovim remote plugins.') call denite#util#print_error( \ 'Please execute :UpdateRemotePlugins command and restart Neovim.') return 1 endtry endfunction 1 0.000012 function! denite#init#_context() abort return { \ 'runtimepath': &runtimepath, \ 'encoding': &encoding, \ 'is_windows': has('win32') || has('win64'), \ 'selected_icon': '*', \ 'messages': [], \} endfunction 1 0.000014 function! denite#init#_user_options() abort return { \ 'auto_highlight': v:false, \ 'auto_preview': v:false, \ 'auto_resize': v:false, \ 'buffer_name': 'default', \ 'cursor_pos': '', \ 'cursor_wrap': v:false, \ 'cursorline': v:true, \ 'default_action': 'default', \ 'direction': 'botright', \ 'empty': v:true, \ 'highlight_cursor': 'Cursor', \ 'highlight_matched_range': 'Underlined', \ 'highlight_matched_char': 'Search', \ 'highlight_mode_normal': 'WildMenu', \ 'highlight_mode_insert': 'CursorLine', \ 'ignorecase': v:true, \ 'immediately': v:false, \ 'input': '', \ 'max_candidate_width': 200, \ 'mode': '', \ 'path': getcwd(), \ 'previewheight': &previewheight, \ 'prompt': '#', \ 'prompt_highlight': 'Statement', \ 'quit': v:true, \ 'refresh': v:false, \ 'resume': v:false, \ 'reversed': v:false, \ 'scroll': 0, \ 'short_source_names': v:false, \ 'statusline': v:true, \ 'timeoutlen': 1000, \ 'use_default_mappings': v:true, \ 'vertical_preview': v:false, \ 'winheight': 20, \ 'winminheight': -1, \} endfunction 1 0.000010 function! denite#init#_deprecated_options() abort return { \ 'select': 'cursor_pos', \} endfunction SCRIPT /home/achilleas/.vim/plugged/denite.nvim/autoload/denite.vim Sourced 1 time Total time: 0.000154 Self time: 0.000154 count total (s) self (s) "============================================================================= " FILE: denite.vim " AUTHOR: Shougo Matsushita " License: MIT license "============================================================================= 1 0.000011 function! denite#initialize() abort return denite#init#_initialize() endfunction 1 0.000007 function! denite#start(sources, ...) abort call inputsave() try let user_context = get(a:000, 0, {}) return s:start(a:sources, user_context) finally call inputrestore() endtry endfunction 1 0.000007 function! denite#get_status_mode() abort return b:denite_statusline_mode endfunction 1 0.000007 function! denite#get_status_sources() abort return b:denite_statusline_sources endfunction 1 0.000006 function! denite#get_status_path() abort return b:denite_statusline_path endfunction 1 0.000007 function! denite#get_status_linenr() abort return b:denite_statusline_linenr endfunction 1 0.000008 function! s:start(sources, user_context) abort let buffer_name = get(a:user_context, 'buffer_name', 'default') let context = denite#init#_context() call extend(context, denite#init#_user_options()) let context.custom = denite#custom#get() if has_key(context.custom.option, '_') call extend(context, context.custom.option['_']) endif if has_key(context.custom.option, buffer_name) call extend(context, context.custom.option[buffer_name]) endif call extend(context, a:user_context) " For compatibility(deprecated variables) for [old_option, new_option] in filter(items( \ denite#init#_deprecated_options()), \ 'has_key(context, v:val[0])') let context[new_option] = context[old_option] endfor if denite#initialize() return endif " Add current position to the jumplist. execute line('.') return has('nvim') ? _denite_start(a:sources, context) \ : denite#vim#_start(a:sources, context) endfunction SCRIPT /home/achilleas/.vim/plugged/denite.nvim/autoload/denite/vim.vim Sourced 1 time Total time: 0.000122 Self time: 0.000122 count total (s) self (s) "============================================================================= " FILE: vim.vim " AUTHOR: Shougo Matsushita " License: MIT license "============================================================================= 1 0.000034 let s:denite_path = fnamemodify(expand(''), ':p:h:h:h') \ . '/rplugin/python3' 1 0.000010 function! denite#vim#_initialize() abort if v:version < 800 || !has('python3') call denite#util#print_error( \ 'denite.nvim does not work with this version.') call denite#util#print_error( \ 'It requires Vim 8.0+ with Python3 support("+python3").') return 1 endif python3 << EOF import sys import vim # Add sys.path sys.path.insert(0, vim.eval('s:denite_path')) # Define 'denite__uis' to store UI for individual buffers denite__uis = {} EOF let g:denite#_channel_id = getpid() endfunction 1 0.000009 function! denite#vim#_start(sources, context) abort python3 << EOF def _temporary_scope(): import traceback import vim from denite.util import error from denite.rplugin import Neovim, reform_bytes nvim = Neovim(vim) try: from denite.ui.default import Default buffer_name = nvim.eval('a:context')['buffer_name'] if buffer_name not in denite__uis: denite__uis[buffer_name] = Default(nvim) denite__uis[buffer_name].start( reform_bytes(nvim.bindeval('a:sources')), reform_bytes(nvim.bindeval('a:context')), ) except Exception as e: for line in traceback.format_exc().splitlines(): error(nvim, line) error(nvim, 'Please execute :messages command.') _temporary_scope() if _temporary_scope in dir(): del _temporary_scope EOF return [] endfunction FUNCTION airline#extensions#quickfix#inactive_qf_window() Called 6 times Total time: 0.000091 Self time: 0.000091 count total (s) self (s) 6 0.000057 if getbufvar(a:2.bufnr, '&filetype') is# 'qf' && !empty(airline#util#getwinvar(a:2.winnr, 'quickfix_title', '')) call setwinvar(a:2.winnr, 'airline_section_c', '[%{get(w:, "quickfix_title", "")}] %f %m') endif FUNCTION airline#highlighter#highlight_modified_inactive() Called 4 times Total time: 0.001658 Self time: 0.000196 count total (s) self (s) 4 0.000029 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 4 0.000058 let colors = exists('g:airline#themes#{g:airline_theme}#palette.inactive.airline_c') ? g:airline#themes#{g:airline_theme}#palette.inactive.airline_c : [] 4 0.000007 endif 4 0.000012 if !empty(colors) 4 0.001509 0.000047 call airline#highlighter#exec('airline_c'.(a:bufnr).'_inactive', colors) 4 0.000004 endif FUNCTION 55_build_sections() Called 14 times Total time: 0.005620 Self time: 0.001033 count total (s) self (s) 76 0.000137 for key in a:keys 62 0.000195 if (key == 'warning' || key == 'error') && !a:context.active 12 0.000020 continue endif 50 0.004910 0.000323 call s:add_section(a:builder, a:context, key) 50 0.000055 endfor FUNCTION denite#init#_context() Called 1 time Total time: 0.000036 Self time: 0.000036 count total (s) self (s) 1 0.000034 return { 'runtimepath': &runtimepath, 'encoding': &encoding, 'is_windows': has('win32') || has('win64'), 'selected_icon': '*', 'messages': [],} FUNCTION airline#extensions#load_theme() Called 1 time Total time: 0.000032 Self time: 0.000014 count total (s) self (s) 1 0.000031 0.000013 call airline#util#exec_funcrefs(s:ext._theme_funcrefs, g:airline#themes#{g:airline_theme}#palette) FUNCTION 5() Called 13 times Total time: 0.000069 Self time: 0.000069 count total (s) self (s) 13 0.000065 call add(self._sections, ['|', a:0 ? a:1 : '%=']) FUNCTION 7() Called 64 times Total time: 0.000344 Self time: 0.000344 count total (s) self (s) 64 0.000308 call add(self._sections, [a:group, a:contents]) FUNCTION 9() Called 13 times Total time: 0.055011 Self time: 0.009249 count total (s) self (s) 13 0.000029 let side = 1 13 0.000023 let line = '' 13 0.000020 let i = 0 13 0.000046 let length = len(self._sections) 13 0.000025 let split = 0 13 0.000020 let is_empty = 0 13 0.000024 let prev_group = '' 90 0.000159 while i < length 77 0.000275 let section = self._sections[i] 77 0.000244 let group = section[0] 77 0.000215 let contents = section[1] 77 0.000167 let pgroup = prev_group 77 0.001885 0.000531 let prev_group = s:get_prev_group(self._sections, i) 77 0.000315 if group ==# 'airline_c' && !self._context.active && has_key(self._context, 'bufnr') let group = 'airline_c'. self._context.bufnr elseif prev_group ==# 'airline_c' && !self._context.active && has_key(self._context, 'bufnr') let prev_group = 'airline_c'. self._context.bufnr endif 77 0.000106 if is_empty let prev_group = pgroup endif 77 0.001618 0.000504 let is_empty = s:section_is_empty(self, contents) 77 0.000120 if is_empty " need to fix highlighting groups, since we " have skipped a section, we actually need " the previous previous group and so the " seperator goes from the previous previous group " to the current group let pgroup = group endif 77 0.000121 if group == '' let line .= contents elseif group == '|' 13 0.000020 let side = 0 13 0.000037 let line .= contents 13 0.000021 let split = 1 13 0.000016 else 64 0.000105 if prev_group == '' 13 0.000043 let line .= '%#'.group.'#' 13 0.000017 elseif split 13 0.000020 if !is_empty 13 0.008523 0.000152 let line .= s:get_transitioned_seperator(self, prev_group, group, side) 13 0.000016 endif 13 0.000024 let split = 0 13 0.000013 else 38 0.000049 if !is_empty 38 0.031310 0.000300 let line .= s:get_seperator(self, prev_group, group, side) 38 0.000049 endif 38 0.000034 endif 64 0.004584 0.000671 let line .= is_empty ? '' : s:get_accented_line(self, group, contents) 64 0.000069 endif 77 0.000268 let i = i + 1 77 0.000094 endwhile 13 0.000024 if !self._context.active "let line = substitute(line, '%#airline_c#', '%#airline_c'.self._context.bufnr.'#', '') 6 0.000286 let line = substitute(line, '%#.\{-}\ze#', '\0_inactive', 'g') 6 0.000011 endif 13 0.000024 return line FUNCTION airline#extensions#denite#apply() Called 7 times Total time: 0.000268 Self time: 0.000200 count total (s) self (s) 7 0.000051 if &ft == 'denite' 3 0.000042 0.000026 call a:1.add_section('airline_a', ' Denite %{airline#extensions#denite#check_denite_mode('.a:2['bufnr'].')}') 3 0.000028 0.000014 call a:1.add_section('airline_c', ' %{denite#get_status_sources()}') 3 0.000024 0.000011 call a:1.split() 3 0.000026 0.000013 call a:1.add_section('airline_y', ' %{denite#get_status_path()} ') 3 0.000026 0.000014 call a:1.add_section('airline_z', ' %{denite#get_status_linenr()} ') 3 0.000006 return 1 endif FUNCTION 57_is_initialized() Called 1 time Total time: 0.000012 Self time: 0.000012 count total (s) self (s) 1 0.000010 return exists('g:denite#_channel_id') FUNCTION airline#util#exec_funcrefs() Called 14 times Total time: 0.010165 Self time: 0.000840 count total (s) self (s) 53 0.000122 for Fn in a:list 52 0.009761 0.000436 let code = call(Fn, a:000) 52 0.000092 if code != 0 13 0.000020 return code endif 39 0.000040 endfor 1 0.000002 return 0 FUNCTION airline#highlighter#highlight() Called 651 times Total time: 14.078944 Self time: 2.000231 count total (s) self (s) 651 0.002036 let bufnr = a:0 ? a:1 : '' 651 0.003678 let p = g:airline#themes#{g:airline_theme}#palette " draw the base mode, followed by any overrides 651 0.007257 let mapped = map(a:modes, 'v:val == a:modes[0] ? v:val : a:modes[0]."_".v:val') 651 0.002761 let suffix = a:modes[0] == 'inactive' ? '_inactive' : '' 1303 0.003494 for mode in mapped 652 0.004604 if exists('g:airline#themes#{g:airline_theme}#palette[mode]') 651 0.003016 let dict = g:airline#themes#{g:airline_theme}#palette[mode] 11691 0.030716 for kvp in items(dict) 11040 0.042559 let mode_colors = kvp[1] 11040 0.032188 let name = kvp[0] 11040 0.038043 if name is# 'airline_c' && !empty(bufnr) && suffix is# '_inactive' 1 0.000004 let name = 'airline_c'.bufnr 1 0.000001 endif 11040 2.803219 0.090715 call airline#highlighter#exec(name.suffix, mode_colors) 33120 0.085969 for accent in keys(s:accents) 22080 0.077711 if !has_key(p.accents, accent) continue endif 22080 0.087472 let colors = copy(mode_colors) 22080 0.090819 if p.accents[accent][0] != '' 11040 0.046893 let colors[0] = p.accents[accent][0] 11040 0.012748 endif 22080 0.065357 if p.accents[accent][2] != '' 11040 0.040724 let colors[2] = p.accents[accent][2] 11040 0.012011 endif 22080 0.053920 if len(colors) >= 5 22080 0.103641 let colors[4] = get(p.accents[accent], 4, '') 22080 0.024895 else call add(colors, get(p.accents[accent], 4, '')) endif 22080 6.579791 0.193205 call airline#highlighter#exec(name.suffix.'_'.accent, colors) 22080 0.027672 endfor 11040 0.012430 endfor " TODO: optimize this 6510 0.016476 for sep in items(s:separators) 5859 3.057078 0.077455 call exec_separator(dict, sep[1][0], sep[1][1], sep[1][2], suffix) 5859 0.007924 endfor 651 0.000684 endif 652 0.000676 endfor FUNCTION airline#parts#ffenc() Called 646 times Total time: 0.023585 Self time: 0.023585 count total (s) self (s) 646 0.003671 let expected = get(g:, 'airline#parts#ffenc#skip_expected_string', '') 646 0.002154 let bomb = &l:bomb ? '[BOM]' : '' 646 0.008079 let ff = strlen(&ff) ? '['.&ff.']' : '' 646 0.003832 if expected is# &fenc.bomb.ff return '' else 646 0.002930 return &fenc.bomb.ff endif FUNCTION 10_LoadIndent() Called 1 time Total time: 0.000086 Self time: 0.000086 count total (s) self (s) 1 0.000005 if exists("b:undo_indent") exe b:undo_indent unlet! b:undo_indent b:did_indent endif 1 0.000004 let s = expand("") 1 0.000001 if s != "" 1 0.000002 if exists("b:did_indent") unlet b:did_indent endif " When there is a dot it is used to separate filetype names. Thus for " "aaa.bbb" load "indent/aaa.vim" and then "indent/bbb.vim". 2 0.000008 for name in split(s, '\.') 1 0.000049 exe 'runtime! indent/' . name . '.vim' 1 0.000002 endfor 1 0.000001 endif FUNCTION denite#start() Called 1 time Total time: 16.748301 Self time: 0.000072 count total (s) self (s) 1 0.000012 call inputsave() 1 0.000005 try 1 0.000014 let user_context = get(a:000, 0, {}) 1 16.748257 0.000028 return s:start(a:sources, user_context) finally 1 0.000005 call inputrestore() 1 0.000002 endtry FUNCTION 15_on_colorscheme_changed() Called 1 time Total time: 0.054625 Self time: 0.000082 count total (s) self (s) 1 0.000017 0.000008 call s:init() 1 0.000005 unlet! g:airline#highlighter#normal_fg_hi 1 0.000051 0.000016 let g:airline_gui_mode = airline#init#gui_mode() 1 0.000005 if !s:theme_in_vimrc 1 0.000096 0.000015 call airline#switch_matching_theme() 1 0.000002 endif " couldn't find a match, or theme was defined, just refresh 1 0.054446 0.000028 call airline#load_theme() FUNCTION 54_get_prev_group() Called 77 times Total time: 0.001354 Self time: 0.001354 count total (s) self (s) 77 0.000250 let x = a:i - 1 90 0.000169 while x >= 0 77 0.000295 let group = a:sections[x][0] 77 0.000191 if group != '' && group != '|' 64 0.000110 return group endif 13 0.000033 let x = x - 1 13 0.000015 endwhile 13 0.000017 return '' FUNCTION 50_CheckDefined() Called 39034 times Total time: 0.747919 Self time: 0.747919 count total (s) self (s) " Checks, whether the definition of the colors is valid and is not empty or NONE " e.g. if the colors would expand to this: " hi airline_c ctermfg=NONE ctermbg=NONE " that means to clear that highlighting group, therefore, fallback to Normal " highlighting group for the cterm values " This only works, if the Normal highlighting group is actually defined, so " return early, if it has been cleared 39034 0.162151 if !exists("g:airline#highlighter#normal_fg_hi") 1 0.000023 let g:airline#highlighter#normal_fg_hi = synIDattr(synIDtrans(hlID('Normal')), 'fg', 'cterm') 1 0.000001 endif 39034 0.148894 if empty(g:airline#highlighter#normal_fg_hi) || g:airline#highlighter#normal_fg_hi < 0 39034 0.070517 return a:colors endif for val in a:colors if !empty(val) && val !=# 'NONE' return a:colors endif endfor " this adds the bold attribute to the term argument of the :hi command, " but at least this makes sure, the group will be defined let fg = g:airline#highlighter#normal_fg_hi let bg = synIDattr(synIDtrans(hlID('Normal')), 'bg', 'cterm') if bg < 0 " in case there is no background color defined for Normal let bg = a:colors[3] endif return a:colors[0:1] + [fg, bg] + [a:colors[4]] FUNCTION airline#extensions#wordcount#apply() Called 4 times Total time: 0.000106 Self time: 0.000106 count total (s) self (s) 4 0.000082 if match(&ft, get(g:, 'airline#extensions#wordcount#filetypes')) > -1 call airline#extensions#prepend_to_section('z', '%{get(b:, "airline_wordcount", "")}') endif FUNCTION denite#get_status_path() Called 646 times Total time: 0.002241 Self time: 0.002241 count total (s) self (s) 646 0.001783 return b:denite_statusline_path FUNCTION 54_section_is_empty() Called 77 times Total time: 0.001114 Self time: 0.001114 count total (s) self (s) 77 0.000204 let start=1 " do not check for inactive windows or the tabline 77 0.000173 if a:self._context.active == 0 30 0.000043 return 0 elseif get(a:self._context, 'tabline', 0) return 0 endif " only check, if airline#skip_empty_sections == 1 47 0.000143 if get(g:, 'airline_skip_empty_sections', 0) == 0 47 0.000060 return 0 endif " assume accents sections to be never empty " (avoides, that on startup the mode message becomes empty) if match(a:content, '%#__accent_[^#]*#.*__restore__#') > -1 return 0 endif if empty(a:content) return 1 endif let list=matchlist(a:content, '%{\zs.\{-}\ze}', 1, start) if empty(list) return 0 " no function in statusline text endif while len(list) > 0 let expr = list[0] try " catch all exceptions, just in case if !empty(eval(expr)) return 0 endif catch return 0 endtry let start += 1 let list=matchlist(a:content, '%{\zs.\{-}\ze}', 1, start) endw return 1 FUNCTION 55_get_section() Called 70 times Total time: 0.003403 Self time: 0.003074 count total (s) self (s) 70 0.000296 if has_key(s:section_truncate_width, a:key) 46 0.000192 if winwidth(a:winnr) < s:section_truncate_width[a:key] return '' endif 46 0.000050 endif 70 0.000200 let spc = g:airline_symbols.space 70 0.000354 if !exists('g:airline_section_{a:key}') return '' endif 70 0.000924 0.000595 let text = airline#util#getwinvar(a:winnr, 'airline_section_'.a:key, g:airline_section_{a:key}) 70 0.000535 let [prefix, suffix] = [get(a:000, 0, '%('.spc), get(a:000, 1, spc.'%)')] 70 0.000300 return empty(text) ? '' : prefix.text.suffix FUNCTION airline#highlighter#get_highlight() Called 50930 times Total time: 6.199032 Self time: 1.821001 count total (s) self (s) 50930 2.278992 0.294947 let fg = s:get_syn(a:group, 'fg') 50930 2.253174 0.304246 let bg = s:get_syn(a:group, 'bg') 50930 0.754680 let reverse = g:airline_gui_mode ==# 'gui' ? synIDattr(synIDtrans(hlID(a:group)), 'reverse', 'gui') : synIDattr(synIDtrans(hlID(a:group)), 'reverse', 'cterm')|| synIDattr(synIDtrans(hlID(a:group)), 'reverse', 'term') 50930 0.856825 0.411767 return reverse ? s:get_array(bg, fg, a:000) : s:get_array(fg, bg, a:000) FUNCTION 55_add_section() Called 50 times Total time: 0.004587 Self time: 0.001728 count total (s) self (s) 50 0.000287 let condition = (a:key is# "warning" || a:key is# "error") && (v:version == 704 && !has("patch1511")) " i have no idea why the warning section needs special treatment, but it's " needed to prevent separators from showing up 50 0.000692 0.000314 if ((a:key == 'error' || a:key == 'warning') && empty(s:get_section(a:context.winnr, a:key))) 4 0.000005 return endif 46 0.000063 if condition call a:builder.add_raw('%(') endif 46 0.002941 0.000460 call a:builder.add_section('airline_'.a:key, s:get_section(a:context.winnr, a:key)) 46 0.000075 if condition call a:builder.add_raw('%)') endif FUNCTION airline#extensions#netrw#apply() Called 4 times Total time: 0.000101 Self time: 0.000101 count total (s) self (s) 4 0.000018 if &ft == 'netrw' let spc = g:airline_symbols.space call a:1.add_section('airline_a', spc.'netrw'.spc) if exists('*airline#extensions#branch#get_head') call a:1.add_section('airline_b', spc.'%{airline#extensions#branch#get_head()}'.spc) endif call a:1.add_section('airline_c', spc.'%f'.spc) call a:1.split() call a:1.add_section('airline_y', spc.'%{airline#extensions#netrw#sortstring()}'.spc) return 1 endif FUNCTION airline#load_theme() Called 1 time Total time: 0.054418 Self time: 0.000103 count total (s) self (s) 1 0.000014 if exists('*airline#themes#{g:airline_theme}#refresh') call airline#themes#{g:airline_theme}#refresh() endif 1 0.000005 let palette = g:airline#themes#{g:airline_theme}#palette 1 0.000308 0.000012 call airline#themes#patch(palette) 1 0.000004 if exists('g:airline_theme_patch_func') let Fn = function(g:airline_theme_patch_func) call Fn(palette) endif 1 0.046996 0.000014 call airline#highlighter#load_theme() 1 0.000064 0.000032 call airline#extensions#load_theme() 1 0.007010 0.000005 call airline#update_statusline() FUNCTION 23_Highlight_Matching_Pair() Called 4 times Total time: 0.000397 Self time: 0.000397 count total (s) self (s) " Remove any previous match. 4 0.000020 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.000020 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.000014 let c_lnum = line('.') 4 0.000015 let c_col = col('.') 4 0.000007 let before = 0 4 0.000016 let text = getline(c_lnum) 4 0.000060 let matches = matchlist(text, '\(.\)\=\%'.c_col.'c\(.\=\)') 4 0.000012 if empty(matches) let [c_before, c] = ['', ''] else 4 0.000023 let [c_before, c] = matches[1:2] 4 0.000004 endif 4 0.000053 let plist = split(&matchpairs, '.\zs[:,]') 4 0.000016 let i = index(plist, c) 4 0.000006 if i < 0 " not found, in Insert mode try character before the cursor 4 0.000012 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.000005 if i < 0 " not found, nothing to do 4 0.000005 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 airline#update_statusline() Called 7 times Total time: 0.067130 Self time: 0.000799 count total (s) self (s) 7 0.000107 0.000062 if airline#util#getwinvar(winnr(), 'airline_disabled', 0) return endif 13 0.000100 for nr in filter(range(1, winnr('$')), 'v:val != winnr()') 6 0.000069 0.000033 if airline#util#getwinvar(nr, 'airline_disabled', 0) continue endif 6 0.000033 call setwinvar(nr, 'airline_active', 0) 6 0.000046 let context = { 'winnr': nr, 'active': 0, 'bufnr': winbufnr(nr) } 6 0.026712 0.000074 call s:invoke_funcrefs(context, s:inactive_funcrefs) 6 0.000007 endfor 7 0.000023 unlet! w:airline_render_left w:airline_render_right 7 0.000095 exe 'unlet! ' 'w:airline_section_'. join(s:sections, ' w:airline_section_') 7 0.000016 let w:airline_active = 1 7 0.000043 let context = { 'winnr': winnr(), 'active': 1, 'bufnr': winbufnr(winnr()) } 7 0.039699 0.000087 call s:invoke_funcrefs(context, g:airline_statusline_funcrefs) FUNCTION denite#custom#get() Called 1 time Total time: 0.000046 Self time: 0.000046 count total (s) self (s) 1 0.000008 if !exists('s:custom') let s:custom = {} let s:custom.source = {} let s:custom.source._ = {} let s:custom.map = {} let s:custom.map._ = [] let s:custom.alias_source = {} let s:custom.alias_filter = {} let s:custom.option = {} let s:custom.filter = {} endif 1 0.000003 return s:custom FUNCTION denite#get_status_linenr() Called 646 times Total time: 0.002329 Self time: 0.002329 count total (s) self (s) 646 0.001894 return b:denite_statusline_linenr FUNCTION 50_get_array() Called 50930 times Total time: 0.445058 Self time: 0.445058 count total (s) self (s) 50930 0.416156 return g:airline_gui_mode ==# 'gui' ? [ a:fg, a:bg, '', '', join(a:opts, ',') ] : [ '', '', a:fg, a:bg, join(a:opts, ',') ] FUNCTION denite#helper#_parse_options_args() Called 1 time Total time: 0.001288 Self time: 0.000236 count total (s) self (s) 1 0.000009 let _ = [] 1 0.001094 0.000042 let [args, options] = s:parse_options(a:cmdline) 2 0.000013 for arg in args " Add source name. 1 0.000040 let source_name = matchstr(arg, '^[^:]*') 1 0.000023 let source_arg = arg[len(source_name)+1 :] 1 0.000020 let source_args = source_arg ==# '' ? [] : map(split(source_arg, '\\\@40_sync_active_winnr() Called 1 time Total time: 0.000011 Self time: 0.000011 count total (s) self (s) 1 0.000006 if exists('#airline') && winnr() != s:active_winnr call airline#update_statusline() endif FUNCTION 58_start() Called 1 time Total time: 16.748229 Self time: 0.000302 count total (s) self (s) 1 0.000012 let buffer_name = get(a:user_context, 'buffer_name', 'default') 1 0.000053 0.000017 let context = denite#init#_context() 1 0.000122 0.000039 call extend(context, denite#init#_user_options()) 1 0.000067 0.000021 let context.custom = denite#custom#get() 1 0.000008 if has_key(context.custom.option, '_') 1 0.000009 call extend(context, context.custom.option['_']) 1 0.000002 endif 1 0.000006 if has_key(context.custom.option, buffer_name) call extend(context, context.custom.option[buffer_name]) endif 1 0.000018 call extend(context, a:user_context) " For compatibility(deprecated variables) 1 0.000041 0.000034 for [old_option, new_option] in filter(items( denite#init#_deprecated_options()), 'has_key(context, v:val[0])') let context[new_option] = context[old_option] endfor 1 0.097384 0.000018 if denite#initialize() return endif " Add current position to the jumplist. 1 0.000027 execute line('.') 1 16.650443 0.000054 return has('nvim') ? _denite_start(a:sources, context) : denite#vim#_start(a:sources, context) FUNCTION airline#themes#get_highlight() Called 11820 times Total time: 1.546844 Self time: 0.090188 count total (s) self (s) 11820 1.541605 0.084949 return call('airline#highlighter#get_highlight', [a:group] + a:000) FUNCTION airline#util#getwinvar() Called 103 times Total time: 0.000503 Self time: 0.000503 count total (s) self (s) 103 0.000456 return getwinvar(a:winnr, a:key, a:def) FUNCTION airline#extensions#default#apply() Called 10 times Total time: 0.007321 Self time: 0.000719 count total (s) self (s) 10 0.000033 let winnr = a:context.winnr 10 0.000023 let active = a:context.active 10 0.000125 0.000076 if airline#util#getwinvar(winnr, 'airline_render_left', active || (!active && !g:airline_inactive_collapse)) 4 0.001329 0.000034 call s:build_sections(a:builder, a:context, s:layout[0]) 4 0.000004 else 6 0.000365 0.000044 let text = s:get_section(winnr, 'c') 6 0.000014 if empty(text) let text = ' %f%m ' endif 6 0.000098 0.000059 call a:builder.add_section('airline_c'.(a:context.bufnr), text) 6 0.000008 endif 10 0.000633 0.000104 call a:builder.split(s:get_section(winnr, 'gutter', '', '')) 10 0.000102 0.000058 if airline#util#getwinvar(winnr, 'airline_render_right', 1) 10 0.004421 0.000096 call s:build_sections(a:builder, a:context, s:layout[1]) 10 0.000009 endif 10 0.000011 return 1 FUNCTION 12_SynSet() Called 1 time Total time: 0.000175 Self time: 0.000175 count total (s) self (s) " clear syntax for :set syntax=OFF and any syntax name that doesn't exist 1 0.000008 syn clear 1 0.000004 if exists("b:current_syntax") unlet b:current_syntax endif 1 0.000004 let s = expand("") 1 0.000002 if s == "ON" " :set syntax=ON if &filetype == "" echohl ErrorMsg echo "filetype unknown" echohl None endif let s = &filetype elseif s == "OFF" let s = "" endif 1 0.000001 if s != "" " Load the syntax file(s). When there are several, separated by dots, " load each in sequence. 2 0.000008 for name in split(s, '\.') 1 0.000121 exe "runtime! syntax/" . name . ".vim syntax/" . name . "/*.vim" 1 0.000002 endfor 1 0.000001 endif FUNCTION airline#highlighter#exec() Called 39034 times Total time: 10.271300 Self time: 3.063303 count total (s) self (s) 39034 0.102290 if pumvisible() return endif 39034 0.094218 let colors = a:colors 39034 0.067990 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 39034 4.962728 0.229357 let old_hi = airline#highlighter#get_highlight(a:group) 39034 0.112435 if len(colors) == 4 5912 0.018572 call add(colors, '') 5912 0.006423 endif 39034 0.968670 0.220751 let colors = s:CheckDefined(colors) 39034 0.137020 if old_hi != colors || !hlexists(a:group) 27332 2.648656 0.921949 let cmd = printf('hi %s %s %s %s %s %s %s %s', a:group, s:Get(colors, 0, 'guifg=', ''), s:Get(colors, 1, 'guibg=', ''), s:Get(colors, 2, 'ctermfg=', ''), s:Get(colors, 3, 'ctermbg=', ''), s:Get(colors, 4, 'gui=', ''), s:Get(colors, 4, 'cterm=', ''), s:Get(colors, 4, 'term=', '')) 27332 0.267626 exe cmd 27332 0.030833 endif FUNCTION 50_exec_separator() Called 5910 times Total time: 3.006194 Self time: 0.288602 count total (s) self (s) 5910 0.016264 if pumvisible() return endif 5910 0.838138 0.039967 let l:from = airline#themes#get_highlight(a:from.a:suffix) 5910 0.789588 0.040915 let l:to = airline#themes#get_highlight(a:to.a:suffix) 5910 0.024838 let group = a:from.'_to_'.a:to.a:suffix 5910 0.009391 if a:inverse 1964 0.013169 let colors = [ l:from[1], l:to[1], l:from[3], l:to[3] ] 1964 0.002385 else 3946 0.025703 let colors = [ l:to[1], l:from[1], l:to[3], l:from[3] ] 3946 0.004739 endif 5910 0.023036 let a:dict[group] = colors 5910 1.210616 0.039868 call airline#highlighter#exec(group, colors) FUNCTION 50_get_syn() Called 101860 times Total time: 3.932973 Self time: 3.932973 count total (s) self (s) 101860 0.386952 if !exists("g:airline_gui_mode") let g:airline_gui_mode = airline#init#gui_mode() endif 101860 0.186851 let color = '' 101860 0.358029 if hlexists(a:group) 100426 0.762519 let color = synIDattr(synIDtrans(hlID(a:group)), a:what, g:airline_gui_mode) 100426 0.113234 endif 101860 0.300733 if empty(color) || color == -1 " should always exists 4026 0.067029 let color = synIDattr(synIDtrans(hlID('Normal')), a:what, g:airline_gui_mode) " however, just in case 4026 0.011432 if empty(color) || color == -1 4026 0.007925 let color = 'NONE' 4026 0.004009 endif 4026 0.003459 endif 101860 0.157418 return color FUNCTION airline#extensions#apply() Called 10 times Total time: 0.001298 Self time: 0.000623 count total (s) self (s) 10 0.000041 let s:active_winnr = winnr() 10 0.000729 0.000054 if s:is_excluded_window() return -1 endif 10 0.000024 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 10 0.000015 if &previewwindow let w:airline_section_a = 'Preview' let w:airline_section_b = '' let w:airline_section_c = bufname(winbufnr(winnr())) endif 10 0.000076 if has_key(s:filetype_overrides, &ft) let args = s:filetype_overrides[&ft] call airline#extensions#apply_left_override(args[0], args[1]) endif 10 0.000045 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 15_init() Called 6 times Total time: 0.000037 Self time: 0.000037 count total (s) self (s) 6 0.000019 if s:airline_initialized 6 0.000008 return endif let s:airline_initialized = 1 call airline#extensions#load() call airline#init#sections() let s:theme_in_vimrc = exists('g:airline_theme') if s:theme_in_vimrc try let palette = g:airline#themes#{g:airline_theme}#palette catch echom 'Could not resolve airline theme "' . g:airline_theme . '". Themes have been migrated to github.com/vim-airline/vim-airline-themes.' let g:airline_theme = 'dark' endtry silent call airline#switch_theme(g:airline_theme) else let g:airline_theme = 'dark' silent call s:on_colorscheme_changed() endif silent doautocmd User AirlineAfterInit FUNCTION airline#highlighter#load_theme() Called 1 time Total time: 0.046982 Self time: 0.000076 count total (s) self (s) 1 0.000003 if pumvisible() return endif 2 0.000014 for winnr in filter(range(1, winnr('$')), 'v:val != winnr()') 1 0.000363 0.000008 call airline#highlighter#highlight_modified_inactive(winbufnr(winnr)) 1 0.000001 endfor 1 0.022802 0.000012 call airline#highlighter#highlight(['inactive']) 1 0.000011 if getbufvar( bufnr('%'), '&modified' ) call airline#highlighter#highlight(['normal', 'modified']) else 1 0.023774 0.000013 call airline#highlighter#highlight(['normal']) 1 0.000001 endif FUNCTION 48_update() Called 1 time Total time: 0.000050 Self time: 0.000050 count total (s) self (s) 1 0.000021 if match(&ft, get(g:, 'airline#extensions#wordcount#filetypes')) > -1 let l:mode = mode() if l:mode ==# 'v' || l:mode ==# 'V' || l:mode ==# 's' || l:mode ==# 'S' let b:airline_wordcount = airline#extensions#wordcount#formatters#{s:formatter}#format() let b:airline_change_tick = b:changedtick else if get(b:, 'airline_wordcount_cache', '') is# '' || b:airline_wordcount_cache isnot# get(b:, 'airline_wordcount', '') || get(b:, 'airline_change_tick', 0) != b:changedtick " cache data let b:airline_wordcount = airline#extensions#wordcount#formatters#{s:formatter}#format() let b:airline_wordcount_cache = b:airline_wordcount let b:airline_change_tick = b:changedtick endif endif endif FUNCTION denite#helper#call_denite() Called 1 time Total time: 16.750080 Self time: 0.000294 count total (s) self (s) 1 0.001325 0.000037 let [args, context] = denite#helper#_parse_options_args(a:args) 1 0.000011 let context.firstline = a:line1 1 0.000008 let context.lastline = a:line2 1 0.000017 let context.bufnr = bufnr('%') 1 0.000009 if a:command ==# 'DeniteCursorWord' let context.input = expand('') elseif a:command ==# 'DeniteBufferDir' let context.path = fnamemodify(bufname('%'), ':p:h') elseif a:command ==# 'DeniteProjectDir' let context.path = denite#util#path2project_directory(context.path) endif 1 16.748648 0.000150 call denite#start(args, context) FUNCTION 54_get_transitioned_seperator() Called 51 times Total time: 0.028665 Self time: 0.001242 count total (s) self (s) 51 0.000125 let line = '' 51 0.027776 0.000353 call airline#highlighter#add_separator(a:prev_group, a:group, a:side) 51 0.000254 let line .= '%#'.a:prev_group.'_to_'.a:group.'#' 51 0.000222 let line .= a:side ? a:self._context.left_sep : a:self._context.right_sep 51 0.000146 let line .= '%#'.a:group.'#' 51 0.000079 return line FUNCTION airline#util#wrap() Called 1938 times Total time: 0.016336 Self time: 0.016336 count total (s) self (s) 1938 0.006973 if a:minwidth > 0 && winwidth(0) < a:minwidth return '' endif 1938 0.003177 return a:text FUNCTION denite#init#_user_options() Called 2 times Total time: 0.000201 Self time: 0.000201 count total (s) self (s) 2 0.000196 return { 'auto_highlight': v:false, 'auto_preview': v:false, 'auto_resize': v:false, 'buffer_name': 'default', 'cursor_pos': '', 'cursor_wrap': v:false, 'cursorline': v:true, 'default_action': 'default', 'direction': 'botright', 'empty': v:true, 'highlight_cursor': 'Cursor', 'highlight_matched_range': 'Underlined', 'highlight_matched_char': 'Search', 'highlight_mode_normal': 'WildMenu', 'highlight_mode_insert': 'CursorLine', 'ignorecase': v:true, 'immediately': v:false, 'input': '', 'max_candidate_width': 200, 'mode': '', 'path': getcwd(), 'previewheight': &previewheight, 'prompt': '#', 'prompt_highlight': 'Statement', 'quit': v:true, 'refresh': v:false, 'resume': v:false, 'reversed': v:false, 'scroll': 0, 'short_source_names': v:false, 'statusline': v:true, 'timeoutlen': 1000, 'use_default_mappings': v:true, 'vertical_preview': v:false, 'winheight': 20, 'winminheight': -1,} FUNCTION 24_LocalBrowse() Called 2 times Total time: 0.000115 Self time: 0.000115 count total (s) self (s) " Unfortunate interaction -- only DechoMsg debugging calls can be safely used here. " Otherwise, the BufEnter event gets triggered when attempts to write to " the DBG buffer are made. 2 0.000007 if !exists("s:vimentered") " If s:vimentered doesn't exist, then the VimEnter event hasn't fired. It will, " and so s:VimEnter() will then be calling this routine, but this time with s:vimentered defined. " call Dfunc("s:LocalBrowse(dirname<".a:dirname.">) (s:vimentered doesn't exist)") " call Dret("s:LocalBrowse") return endif " call Dfunc("s:LocalBrowse(dirname<".a:dirname.">) (s:vimentered=".s:vimentered.")") 2 0.000015 if has("amiga") " The check against '' is made for the Amiga, where the empty " string is the current directory and not checking would break " things such as the help command. " call Decho("(LocalBrowse) dirname<".a:dirname."> (isdirectory, amiga)") if a:dirname != '' && isdirectory(a:dirname) sil! call netrw#LocalBrowseCheck(a:dirname) if exists("w:netrw_bannercnt") && line('.') < w:netrw_bannercnt exe w:netrw_bannercnt endif endif elseif isdirectory(a:dirname) " call Decho("(LocalBrowse) dirname<".a:dirname."> ft=".&ft." (isdirectory, not amiga)") " call Dredir("LocalBrowse ft last set: ","verbose set ft") " call Decho("(s:LocalBrowse) COMBAK#23: buf#".bufnr("%")." file<".expand("%")."> line#".line(".")." col#".col(".")) sil! call netrw#LocalBrowseCheck(a:dirname) " call Decho("(s:LocalBrowse) COMBAK#24: buf#".bufnr("%")." file<".expand("%")."> line#".line(".")." col#".col(".")) if exists("w:netrw_bannercnt") && line('.') < w:netrw_bannercnt exe w:netrw_bannercnt " call Decho("(s:LocalBrowse) COMBAK#25: buf#".bufnr("%")." file<".expand("%")."> line#".line(".")." col#".col(".")) endif else " not a directory, ignore it " call Decho("(LocalBrowse) dirname<".a:dirname."> not a directory, ignoring...") 2 0.000002 endif " call Decho("(s:LocalBrowse) COMBAK#26: buf#".bufnr("%")." file<".expand("%")."> line#".line(".")." col#".col(".")) " call Dret("s:LocalBrowse") FUNCTION denite#get_status_sources() Called 646 times Total time: 0.002836 Self time: 0.002836 count total (s) self (s) 646 0.002321 return b:denite_statusline_sources FUNCTION 9_LoadFTPlugin() Called 1 time Total time: 0.000515 Self time: 0.000515 count total (s) self (s) 1 0.000005 if exists("b:undo_ftplugin") exe b:undo_ftplugin unlet! b:undo_ftplugin b:did_ftplugin endif 1 0.000009 let s = expand("") 1 0.000003 if s != "" 1 0.000017 if &cpo =~# "S" && exists("b:did_ftplugin") " In compatible mode options are reset to the global values, need to " set the local values also when a plugin was already used. unlet b:did_ftplugin endif " When there is a dot it is used to separate filetype names. Thus for " "aaa.bbb" load "aaa" and then "bbb". 2 0.000010 for name in split(s, '\.') 1 0.000438 exe 'runtime! ftplugin/' . name . '.vim ftplugin/' . name . '_*.vim ftplugin/' . name . '/*.vim' 1 0.000003 endfor 1 0.000001 endif FUNCTION 54_get_seperator() Called 38 times Total time: 0.031010 Self time: 0.000597 count total (s) self (s) 38 0.010390 0.000271 if s:should_change_group(a:prev_group, a:group) 38 0.020598 0.000304 return s:get_transitioned_seperator(a:self, a:prev_group, a:group, a:side) else return a:side ? a:self._context.left_alt_sep : a:self._context.right_alt_sep endif FUNCTION denite#get_status_mode() Called 646 times Total time: 0.002446 Self time: 0.002446 count total (s) self (s) 646 0.001921 return b:denite_statusline_mode FUNCTION denite#vim#_start() Called 1 time Total time: 16.650389 Self time: 16.531039 count total (s) self (s) 1 0.000005 python3 << EOF def _temporary_scope(): import traceback import vim from denite.util import error from denite.rplugin import Neovim, reform_bytes nvim = Neovim(vim) try: from denite.ui.default import Default buffer_name = nvim.eval('a:context')['buffer_name'] if buffer_name not in denite__uis: denite__uis[buffer_name] = Default(nvim) denite__uis[buffer_name].start( reform_bytes(nvim.bindeval('a:sources')), reform_bytes(nvim.bindeval('a:context')), ) except Exception as e: for line in traceback.format_exc().splitlines(): error(nvim, line) error(nvim, 'Please execute :messages command.') _temporary_scope() if _temporary_scope in dir(): del _temporary_scope EOF 1 0.000005 return [] FUNCTION denite#init#_deprecated_options() Called 2 times Total time: 0.000023 Self time: 0.000023 count total (s) self (s) 2 0.000019 return { 'select': 'cursor_pos',} FUNCTION airline#init#gui_mode() Called 1 time Total time: 0.000035 Self time: 0.000035 count total (s) self (s) 1 0.000033 return ((has('nvim') && exists('$NVIM_TUI_ENABLE_TRUE_COLOR') && !exists("+termguicolors")) || has('gui_running') || (has("termtruecolor") && &guicolors == 1) || (has("termguicolors") && &termguicolors == 1)) ? 'gui' : 'cterm' FUNCTION airline#check_mode() Called 1292 times Total time: 0.190814 Self time: 0.142063 count total (s) self (s) 1292 0.007127 let context = s:contexts[a:winnr] 1292 0.005564 if get(w:, 'airline_active', 1) 646 0.002477 let l:m = mode() 646 0.001432 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'] elseif l:m ==# "t" let l:mode = ['terminal'] else 646 0.001733 let l:mode = ['normal'] 646 0.000701 endif 646 0.003851 let w:airline_current_mode = get(g:airline_mode_map, l:m, l:m) 646 0.000699 else 646 0.001827 let l:mode = ['inactive'] 646 0.003539 let w:airline_current_mode = get(g:airline_mode_map, '__') 646 0.000741 endif 1292 0.004907 if g:airline_detect_modified && &modified call add(l:mode, 'modified') endif 1292 0.002958 if g:airline_detect_paste && &paste call add(l:mode, 'paste') endif 1292 0.006815 if g:airline_detect_crypt && exists("+key") && !empty(&key) call add(l:mode, 'crypt') endif 1292 0.003259 if g:airline_detect_spell && &spell call add(l:mode, 'spell') endif 1292 0.002397 if &readonly || ! &modifiable 1 0.000004 call add(l:mode, 'readonly') 1 0.000001 endif 1292 0.006445 let mode_string = join(l:mode) 1292 0.005659 if get(w:, 'airline_lastmode', '') != mode_string 3 0.001341 0.000038 call airline#highlighter#highlight_modified_inactive(context.bufnr) 3 0.047506 0.000058 call airline#highlighter#highlight(l:mode, context.bufnr) 3 0.000011 let w:airline_lastmode = mode_string 3 0.000003 endif 1292 0.001715 return '' FUNCTION airline#parts#filetype() Called 646 times Total time: 0.006081 Self time: 0.006081 count total (s) self (s) 646 0.005339 return winwidth(0) < 100 && strlen(&filetype) > 3 ? matchstr(&filetype, '...'). (&encoding is? 'utf-8' ? '…' : '>') : &filetype FUNCTION airline#switch_matching_theme() Called 1 time Total time: 0.000081 Self time: 0.000081 count total (s) self (s) 1 0.000007 if exists('g:colors_name') let existing = g:airline_theme let theme = substitute(g:colors_name, '-', '_', 'g') try let palette = g:airline#themes#{theme}#palette call airline#switch_theme(theme) return 1 catch for map in items(g:airline_theme_map) if match(g:colors_name, map[0]) > -1 try let palette = g:airline#themes#{map[1]}#palette call airline#switch_theme(map[1]) catch call airline#switch_theme(existing) endtry return 1 endif endfor endtry endif 1 0.000002 return 0 FUNCTION denite#initialize() Called 1 time Total time: 0.097366 Self time: 0.000018 count total (s) self (s) 1 0.097366 0.000018 return denite#init#_initialize() FUNCTION 56_parse_options() Called 1 time Total time: 0.001052 Self time: 0.000601 count total (s) self (s) 1 0.000007 let args = [] 1 0.000006 let options = {} " Eval 1 0.000035 let cmdline = (a:cmdline =~# '\\\@= 0 let options[name] = value else 1 0.000013 call add(args, arg) 1 0.000004 endif 1 0.000004 endfor 1 0.000008 return [args, options] FUNCTION denite#init#_initialize() Called 1 time Total time: 0.097348 Self time: 0.000582 count total (s) self (s) 1 0.000042 0.000030 if s:is_initialized() return endif 1 0.000005 augroup denite 1 0.000357 autocmd! 1 0.000006 augroup END 1 0.000014 if !has('nvim') 1 0.096912 0.000158 return denite#vim#_initialize() endif if !has('python3') call denite#util#print_error( 'denite.nvim does not work with this version.') call denite#util#print_error( 'It requires Neovim with Python3 support("+python3").') return 1 endif if !exists('*execute') call denite#util#print_error( 'denite.nvim does not work with this version.') call denite#util#print_error( 'It requires Neovim +v0.1.5.') return 1 endif try if !exists('g:loaded_remote_plugins') runtime! plugin/rplugin.vim endif call _denite_init() catch call denite#util#print_error( 'denite.nvim is not registered as Neovim remote plugins.') call denite#util#print_error( 'Please execute :UpdateRemotePlugins command and restart Neovim.') return 1 endtry FUNCTION airline#themes#patch() Called 1 time Total time: 0.000296 Self time: 0.000296 count total (s) self (s) 13 0.000029 for mode in keys(a:palette) 12 0.000054 if !has_key(a:palette[mode], 'airline_warning') let a:palette[mode]['airline_warning'] = [ '#000000', '#df5f00', 232, 166 ] endif 12 0.000043 if !has_key(a:palette[mode], 'airline_error') let a:palette[mode]['airline_error'] = [ '#000000', '#990000', 232, 160 ] endif 12 0.000014 endfor 1 0.000007 let a:palette.accents = get(a:palette, 'accents', {}) 1 0.000007 let a:palette.accents.none = [ '', '', '', '', '' ] 1 0.000004 let a:palette.accents.bold = [ '', '', '', '', 'bold' ] 1 0.000004 let a:palette.accents.italic = [ '', '', '', '', 'italic' ] 1 0.000003 if !has_key(a:palette.accents, 'red') let a:palette.accents.red = [ '#ff0000' , '' , 160 , '' ] endif 1 0.000003 if !has_key(a:palette.accents, 'green') let a:palette.accents.green = [ '#008700' , '' , 22 , '' ] endif 1 0.000003 if !has_key(a:palette.accents, 'blue') let a:palette.accents.blue = [ '#005fff' , '' , 27 , '' ] endif 1 0.000002 if !has_key(a:palette.accents, 'yellow') let a:palette.accents.yellow = [ '#dfff00' , '' , 190 , '' ] endif 1 0.000002 if !has_key(a:palette.accents, 'orange') let a:palette.accents.orange = [ '#df5f00' , '' , 166 , '' ] endif 1 0.000003 if !has_key(a:palette.accents, 'purple') let a:palette.accents.purple = [ '#af00df' , '' , 128 , '' ] endif FUNCTION airline#extensions#denite#check_denite_mode() Called 646 times Total time: 14.009298 Self time: 0.021907 count total (s) self (s) 646 0.009916 0.007470 let l:mode = split(denite#get_status_mode(), ' ') 646 0.004146 let l:mode = tolower(l:mode[1]) 646 13.992947 0.008002 call airline#highlighter#highlight([l:mode], a:bufnr) 646 0.001112 return '' FUNCTION airline#extensions#quickfix#apply() Called 7 times Total time: 0.000097 Self time: 0.000097 count total (s) self (s) 7 0.000027 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 16_invoke_funcrefs() Called 13 times Total time: 0.066250 Self time: 0.000726 count total (s) self (s) 13 0.000451 0.000085 let builder = airline#builder#new(a:context) 13 0.010332 0.000185 let err = airline#util#exec_funcrefs(a:funcrefs + s:core_funcrefs, builder, a:context) 13 0.000023 if err == 1 13 0.055136 0.000125 let a:context.line = builder.build() 13 0.000096 let s:contexts[a:context.winnr] = a:context 13 0.000170 call setwinvar(a:context.winnr, '&statusline', '%!airline#statusline('.a:context.winnr.')') 13 0.000017 endif FUNCTION 50_Get() Called 191324 times Total time: 1.726707 Self time: 1.726707 count total (s) self (s) 191324 0.828230 if get(a:dict, a:key, a:default) isnot# a:default 124872 0.457271 return a:prefix. get(a:dict, a:key) else 66452 0.078625 return '' endif FUNCTION denite#util#execute_path() Called 1 time Total time: 0.029374 Self time: 0.000567 count total (s) self (s) 1 0.000017 try 1 0.029340 0.000533 execute a:command fnameescape(a:path) 1 0.000002 catch /^Vim\%((\a\+)\)\=:E325/ " Ignore swap file error catch call denite#util#print_error(v:throwpoint) call denite#util#print_error(v:exception) endtry FUNCTION denite#vim#_initialize() Called 1 time Total time: 0.096606 Self time: 0.096606 count total (s) self (s) 1 0.002034 if v:version < 800 || !has('python3') call denite#util#print_error( 'denite.nvim does not work with this version.') call denite#util#print_error( 'It requires Vim 8.0+ with Python3 support("+python3").') return 1 endif 1 0.000006 python3 << EOF import sys import vim # Add sys.path sys.path.insert(0, vim.eval('s:denite_path')) # Define 'denite__uis' to store UI for individual buffers denite__uis = {} EOF 1 0.000032 let g:denite#_channel_id = getpid() FUNCTION 40_is_excluded_window() Called 10 times Total time: 0.000675 Self time: 0.000675 count total (s) self (s) 10 0.000034 for matchft in g:airline_exclude_filetypes if matchft ==# &ft return 1 endif endfor 40 0.000072 for matchw in g:airline_exclude_filenames 30 0.000257 if matchstr(expand('%'), matchw) ==# matchw return 1 endif 30 0.000030 endfor 10 0.000024 if g:airline_exclude_preview && &previewwindow return 1 endif 10 0.000012 return 0 FUNCTION airline#highlighter#add_separator() Called 51 times Total time: 0.027423 Self time: 0.000852 count total (s) self (s) 51 0.000341 let s:separators[a:from.a:to] = [a:from, a:to, a:inverse] 51 0.027047 0.000476 call exec_separator({}, a:from, a:to, a:inverse, '') FUNCTION 15_on_window_changed() Called 7 times Total time: 0.052994 Self time: 0.000412 count total (s) self (s) 7 0.000040 if pumvisible() && (!&previewwindow || g:airline_exclude_preview) return endif " Handle each window only once, since we might come here several times for " different autocommands. 7 0.000121 let l:key = [bufnr('%'), winnr(), winnr('$'), tabpagenr(), &ft] 7 0.000081 if get(g:, 'airline_last_window_changed', []) == l:key && &stl is# '%!airline#statusline('.winnr().')' && &ft !~? 'gitcommit' " fugitive is special, it changes names and filetypes several times, " make sure the caching does not get into its way 2 0.000003 return endif 5 0.000025 let g:airline_last_window_changed = l:key 5 0.000067 0.000039 call s:init() 5 0.052592 0.000038 call airline#update_statusline() FUNCTION 54_should_change_group() Called 38 times Total time: 0.010119 Self time: 0.001114 count total (s) self (s) 38 0.000101 if a:group1 == a:group2 return 0 endif 38 0.004797 0.000239 let color1 = airline#highlighter#get_highlight(a:group1) 38 0.004684 0.000237 let color2 = airline#highlighter#get_highlight(a:group2) 38 0.000092 if g:airline_gui_mode ==# 'gui' return color1[1] != color2[1] || color1[0] != color2[0] else 38 0.000166 return color1[3] != color2[3] || color1[2] != color2[2] endif FUNCTION 54_get_accented_line() Called 64 times Total time: 0.003913 Self time: 0.003913 count total (s) self (s) 64 0.000153 if a:self._context.active 40 0.000082 let contents = [] 40 0.000384 let content_parts = split(a:contents, '__accent') 92 0.000193 for cpart in content_parts 52 0.000457 let accent = matchstr(cpart, '_\zs[^#]*\ze') 52 0.000186 call add(contents, cpart) 52 0.000058 endfor 40 0.000187 let line = join(contents, a:group) 40 0.000329 let line = substitute(line, '__restore__', a:group, 'g') 40 0.000050 else 24 0.000442 let line = substitute(a:contents, '%#__accent[^#]*#', '', 'g') 24 0.000205 let line = substitute(line, '%#__restore__#', '', 'g') 24 0.000032 endif 64 0.000099 return line FUNCTION airline#extensions#po#apply() Called 4 times Total time: 0.000043 Self time: 0.000043 count total (s) self (s) 4 0.000019 if &ft ==# 'po' call airline#extensions#prepend_to_section('z', '%{airline#extensions#po#stats()}') autocmd airline BufWritePost * unlet! b:airline_po_stats endif FUNCTION airline#builder#new() Called 13 times Total time: 0.000366 Self time: 0.000366 count total (s) self (s) 13 0.000089 let builder = copy(s:prototype) 13 0.000039 let builder._context = a:context 13 0.000033 let builder._sections = [] 13 0.000157 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') 13 0.000027 return builder FUNCTIONS SORTED ON TOTAL TIME count total (s) self (s) function 1 16.750080 0.000294 denite#helper#call_denite() 1 16.748301 0.000072 denite#start() 1 16.748229 0.000302 58_start() 1 16.650389 16.531039 denite#vim#_start() 651 14.078944 2.000231 airline#highlighter#highlight() 646 14.009298 0.021907 airline#extensions#denite#check_denite_mode() 39034 10.271300 3.063303 airline#highlighter#exec() 50930 6.199032 1.821001 airline#highlighter#get_highlight() 101860 3.932973 50_get_syn() 5910 3.006194 0.288602 50_exec_separator() 191324 1.726707 50_Get() 11820 1.546844 0.090188 airline#themes#get_highlight() 39034 0.747919 50_CheckDefined() 50930 0.445058 50_get_array() 1292 0.190814 0.142063 airline#check_mode() 1 0.097366 0.000018 denite#initialize() 1 0.097348 0.000582 denite#init#_initialize() 1 0.096606 denite#vim#_initialize() 7 0.067130 0.000799 airline#update_statusline() 13 0.066250 0.000726 16_invoke_funcrefs() FUNCTIONS SORTED ON SELF TIME count total (s) self (s) function 1 16.650389 16.531039 denite#vim#_start() 101860 3.932973 50_get_syn() 39034 10.271300 3.063303 airline#highlighter#exec() 651 14.078944 2.000231 airline#highlighter#highlight() 50930 6.199032 1.821001 airline#highlighter#get_highlight() 191324 1.726707 50_Get() 39034 0.747919 50_CheckDefined() 50930 0.445058 50_get_array() 5910 3.006194 0.288602 50_exec_separator() 1292 0.190814 0.142063 airline#check_mode() 1 0.096606 denite#vim#_initialize() 11820 1.546844 0.090188 airline#themes#get_highlight() 1292 0.029225 airline#statusline() 646 0.023585 airline#parts#ffenc() 646 14.009298 0.021907 airline#extensions#denite#check_denite_mode() 1938 0.016336 airline#util#wrap() 13 0.055011 0.009249 9() 646 0.007154 airline#parts#readonly() 646 0.006081 airline#parts#filetype() 64 0.003913 54_get_accented_line() ```
chrisbra commented 7 years ago

it looks like its denite#vim#_start that is so slow. This is a denite function, so please assign there.

achilleas-k commented 7 years ago

The way I read it is that denite#vim#_start takes a few seconds (16), but that only happens once. The scrolling however triggers airline#highlighter#highlight(), which is called 651 times and takes up 14 seconds. Am I reading it wrong?

chrisbra commented 7 years ago

the log file was to long and the denite#vim#_start was the first thing that I noticed. Performance issue is handled separatly in a different issue.

achilleas-k commented 7 years ago

I will go ahead and optn an issue on Denite as well though, since I think you're right that the root cause might be there.

Shougo commented 7 years ago

This is denite asynchronous update problem. I will fix it later.

ozelentok commented 7 years ago

In airline#extensions#denite#check_denite_mode airline highlight is called every time Correct me if I am wrong, but isn't the call to highlight required only if the mode changed? By modifying the function to check the previous mode, it avoids many redundant calls to the highlight function

function! airline#extensions#denite#check_denite_mode(bufnr)
  let l:mode = split(denite#get_status_mode(), ' ')
  let l:mode = tolower(l:mode[1])
  if !exists('b:denite_mode') || l:mode != b:denite_mode
    call airline#highlighter#highlight([l:mode], a:bufnr)
  endif
  let b:denite_mode = l:mode
  return ''
endfunction
Shougo commented 7 years ago

In airline#extensions#denite#check_denite_mode airline highlight is called every time Correct me if I am wrong, but isn't the call to highlight required only if the mode changed?

No. Please read the code. The cache feature is already implemented.

https://github.com/Shougo/denite.nvim/blob/master/rplugin/python3/denite/ui/default.py#L360

:redrawstatus is called if the statusline is changed. You think it should be updated only if the mode changed. It should not. The statusline has more information.

ozelentok commented 7 years ago

The problem was that the airline highlighting function itself should only be called if the mode changed (and not if the sources, path or line number have changed) The airline highlight function doesn't need to be called every time, as the highlighting stays even after airline redraws its status

Shougo commented 7 years ago

The airline highlight function doesn't need to be called every time, as the highlighting stays even after airline redraws its status

Hm. I don't know the airline highlight implementation. It is the airline extention problem.

chrisbra commented 7 years ago

so is this still a problem, considering that I just merged the mentioned improvement to the denite extension #1489?

tek commented 6 years ago

there is another extension, tmuxline, that causes the same delay when leaving the denite buffer.