Skip to content

Instantly share code, notes, and snippets.

@madnight
Created October 8, 2017 20:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save madnight/b31b67444f83cb0541772c2fe6ff93ec to your computer and use it in GitHub Desktop.
Save madnight/b31b67444f83cb0541772c2fe6ff93ec to your computer and use it in GitHub Desktop.
SCRIPT /home/x/.vim/plugged/vim-misc/autoload/xolox/misc/cursorhold.vim
Sourced 1 time
Total time: 0.000191
Self time: 0.000191
count total (s) self (s)
" Rate limiting for Vim's CursorHold event.
"
" Author: Peter Odding <peter@peterodding.com>
" Last Change: June 22, 2014
" URL: http://peterodding.com/code/vim/misc/
"
" Several of my Vim plug-ins (e.g. [vim-easytags][], [vim-notes][] and
" [vim-session][]) use Vim's [CursorHold][] and [CursorHoldI][] events to
" perform periodic tasks when the user doesn't press any keys for a couple of
" seconds. These events by default fire after four seconds, this is
" configurable using Vim's ['updatetime'][] option. The problem that this
" script solves is that there are Vim plug-ins which set the ['updatetime'][]
" option to unreasonably low values, thereby breaking my Vim plug-ins and
" probably a lot of other Vim plug-ins out there. When users complain about
" this I can tell them that another Vim plug-in is to blame, but users don't
" care for the difference, their Vim is broken! So I implemented a workaround.
" This script enables registration of [CursorHold][] event handlers with a
" configurable interval (expressed in seconds). The event handlers will be
" called no more than once every interval.
"
" ['updatetime']: http://vimdoc.sourceforge.net/htmldoc/options.html#'updatetime'
" [CursorHold]: http://vimdoc.sourceforge.net/htmldoc/autocmd.html#CursorHold
" [CursorHoldI]: http://vimdoc.sourceforge.net/htmldoc/autocmd.html#CursorHoldI
" [vim-easytags]: http://peterodding.com/code/vim/easytags/
" [vim-notes]: http://peterodding.com/code/vim/notes/
" [vim-session]: http://peterodding.com/code/vim/session/
1 0.000013 if !exists('g:xolox#misc#cursorhold#handlers')
1 0.000011 let g:xolox#misc#cursorhold#handlers = []
1 0.000003 endif
1 0.000012 function! xolox#misc#cursorhold#register(options)
" Register a [CursorHold][] event handler with a custom interval. This
" function takes a single argument which is a dictionary with the following
" fields:
"
" - **function** (required): The name of the event handler function (a
" string).
"
" - **arguments** (optional): A list of arguments to pass to the event
" handler function (defaults to an empty list).
"
" - **interval** (optional): The number of seconds between calls to the
" event handler (defaults to 4).
call add(g:xolox#misc#cursorhold#handlers, copy(a:options))
endfunction
1 0.000010 function! xolox#misc#cursorhold#autocmd()
" The 'top level event handler' that's called by Vim whenever the
" [CursorHold][] or [CursorHoldI][] event fires. It iterates through the
" event handlers registered using `xolox#misc#cursorhold#register()` and
" calls each event handler at the appropriate interval, keeping track of
" the time when each event handler was last run.
for handler in g:xolox#misc#cursorhold#handlers
let function = handler['function']
let last_run = get(handler, 'last_run', 0)
let interval = get(handler, 'interval', 4)
call xolox#misc#msg#debug("vim-misc %s: Checking handler %s with interval %i and last run %i ..", g:xolox#misc#version, function, interval, last_run)
" Rate limit in case &updatetime is set (very) low.
let time_until_next_run = (last_run + interval) - localtime()
if time_until_next_run > 0
call xolox#misc#msg#debug("vim-misc %s: Rate limiting handler %s (time until next run: %i seconds).", g:xolox#misc#version, function, time_until_next_run)
else
call xolox#misc#msg#debug("vim-misc %s: Running handler %s ..", g:xolox#misc#version, function)
call call(function, get(handler, 'arguments', []))
let handler['last_run'] = localtime()
endif
endfor
endfunction
" vim: ts=2 sw=2 et
SCRIPT /home/x/.vim/plugged/incsearch.vim/autoload/incsearch.vim
Sourced 1 time
Total time: 0.001339
Self time: 0.000962
count total (s) self (s)
"=============================================================================
" FILE: autoload/incsearch.vim
" AUTHOR: haya14busa
" License: MIT license {{{
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the
" "Software"), to deal in the Software without restriction, including
" without limitation the rights to use, copy, modify, merge, publish,
" distribute, sublicense, and/or sell copies of the Software, and to
" permit persons to whom the Software is furnished to do so, subject to
" the following conditions:
"
" The above copyright notice and this permission notice shall be included
" in all copies or substantial portions of the Software.
"
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
" IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
" CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
" TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
" SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
" }}}
"
" vimlint:
" @vimlint(EVL103, 1, a:cmdline)
" @vimlint(EVL102, 1, v:errmsg)
" @vimlint(EVL102, 1, v:warningmsg)
" @vimlint(EVL102, 1, v:searchforward)
"=============================================================================
1 0.000003 scriptencoding utf-8
" Saving 'cpoptions' {{{
1 0.000013 let s:save_cpo = &cpo
1 0.000017 set cpo&vim
" }}}
1 0.000002 let s:TRUE = !0
1 0.000002 let s:FALSE = 0
1 0.000003 let s:DIRECTION = { 'forward': 1, 'backward': 0 } " see :h v:searchforward
" based on: https://github.com/deris/vim-magicalize/blob/433e38c1e83b1bdea4f83ab99dc19d070932380c/autoload/magicalize.vim#L52-L53
" improve to work with repetitive espaced slash like \V\V
" NOTE: \@1<= doesn't work to detect \v\v\v\v
1 0.000003 let s:escaped_backslash = '\m\%(^\|[^\\]\)\%(\\\\\)*'
1 0.000002 let s:non_escaped_backslash = '\m\%(\%(^\|[^\\]\)\%(\\\\\)*\)\@<=\\'
" Option:
1 0.000005 let g:incsearch#emacs_like_keymap = get(g: , 'incsearch#emacs_like_keymap' , s:FALSE)
1 0.000004 let g:incsearch#highlight = get(g: , 'incsearch#highlight' , {})
1 0.000005 let g:incsearch#separate_highlight = get(g: , 'incsearch#separate_highlight' , s:FALSE)
1 0.000004 let g:incsearch#consistent_n_direction = get(g: , 'incsearch#consistent_n_direction' , s:FALSE)
1 0.000004 let g:incsearch#vim_cmdline_keymap = get(g: , 'incsearch#vim_cmdline_keymap' , s:TRUE)
1 0.000005 let g:incsearch#smart_backward_word = get(g: , 'incsearch#smart_backward_word' , s:TRUE)
1 0.000004 let g:incsearch#no_inc_hlsearch = get(g: , 'incsearch#no_inc_hlsearch' , s:FALSE)
" This changes error and warning emulation way slightly
1 0.000006 let g:incsearch#do_not_save_error_message_history =
\ get(g:, 'incsearch#do_not_save_error_message_history', s:FALSE)
1 0.000003 let g:incsearch#auto_nohlsearch = get(g: , 'incsearch#auto_nohlsearch' , s:FALSE)
" assert g:incsearch#magic =~# \\[mMvV]
1 0.000003 let g:incsearch#magic = get(g: , 'incsearch#magic' , '')
" Debug:
1 0.000004 let g:incsearch#debug = get(g:, 'incsearch#debug', s:FALSE)
" Utility:
1 0.000047 let s:U = incsearch#util#import()
" Main: {{{
" @return vital-over command-line interface object. [experimental]
1 0.000003 function! incsearch#cli() abort
return incsearch#cli#get()
endfunction
"" Make vital-over command-line interface object and return it [experimental]
1 0.000003 function! incsearch#make(...) abort
return incsearch#cli#make(incsearch#config#make(get(a:, 1, {})))
endfunction
"" NOTE: this global variable is only for handling config from go_wrap func
" It avoids to make config string temporarily
1 0.000002 let g:incsearch#_go_config = {}
"" This is main API assuming used by <expr> mappings
" ARGS:
" @config See autoload/incsearch/config.vim
" RETURN:
" Return primitive search commands (like `3/pattern<CR>`) if config.is_expr
" is TRUE, return excute command to call incsearch.vim's inner API.
" To handle dot repeat, make sure that config.is_expr is true. If you do not
" specify config.is_expr, it automatically set config.is_expr TRUE for
" operator-pending mode
" USAGE:
" :noremap <silent><expr> <Plug>(incsearch-forward) incsearch#go({'command': '/'})
" " FIXME?: Calling this with feedkeys() is ugly... Reason: incsearch#go()
" is optimize the situation which calling from <expr> mappings, and do not
" take care from calling directly or some defined command.
" :call feedkeys(incsearch#go(), 'n')
" @api
1 0.000003 function! incsearch#go(...) abort
let config = incsearch#config#make(get(a:, 1, {}))
" FIXME?: this condition should not be config.is_expr?
if config.is_expr
return incsearch#_go(config)
else
let g:incsearch#_go_config = config
let esc = s:U.is_visual(g:incsearch#_go_config.mode) ? "\<ESC>" : ''
return printf("%s:\<C-u>call incsearch#_go(g:incsearch#_go_config)\<CR>", esc)
endif
endfunction
"" Debuggin incsearch.vim interface for calling from function call
" USAGE:
" :call incsearch#call({'pattern': @/})
" @api for debugging
1 0.000003 function! incsearch#call(...) abort
return incsearch#_go(incsearch#config#make(get(a:, 1, {})))
endfunction
" IMPORTANT NOTE:
" Calling `incsearch#go()` and executing command which returned from
" `incsearch#go()` have to result in the same cursor move.
" @return command: String to search
1 0.000003 function! incsearch#_go(config) abort
if s:U.is_visual(a:config.mode) && !a:config.is_expr
normal! gv
endif
let cli = incsearch#cli#make(a:config)
let input = s:get_input(cli)
if cli._does_exit_from_incsearch
" Outer incsearch-plugin handle it so do not something in paticular
return cli._return_cmd
else
" After getting input, generate command, take aftercare, and return
" command.
let l:F = function(cli._flag is# 'n' ? 's:stay' : 's:search')
let cmd = l:F(cli, input)
if !a:config.is_expr
let should_set_jumplist = (cli._flag !=# 'n')
call s:set_search_related_stuff(cli, cmd, should_set_jumplist)
if a:config.mode is# 'no'
call s:set_vimrepeat(cmd)
endif
endif
return cmd
endif
endfunction
"" To handle recursive mapping, map command to <Plug>(_incsearch-dotrepeat)
" temporarily
" https://github.com/tpope/vim-repeat
" https://github.com/kana/vim-repeat
1 0.000003 function! s:set_vimrepeat(cmd) abort
execute 'noremap' '<Plug>(_incsearch-dotrepeat)' a:cmd
silent! call repeat#set("\<Plug>(_incsearch-dotrepeat)")
endfunction
1 0.000005 let g:incsearch#_view = get(g:, 'incsearch#_view', {})
1 0.000070 noremap <silent> <Plug>(_incsearch-winrestview) <Nop>
1 0.000018 noremap! <silent> <Plug>(_incsearch-winrestview) <Nop>
1 0.000026 nnoremap <silent> <Plug>(_incsearch-winrestview) :<C-u>call winrestview(g:incsearch#_view)<CR>
1 0.000025 xnoremap <silent> <Plug>(_incsearch-winrestview) :<C-u>call winrestview(g:incsearch#_view)<CR>gv
1 0.000003 function! s:stay(cli, input) abort
let [raw_pattern, offset] = a:cli._parse_pattern()
let pattern = a:cli._convert(raw_pattern)
" NOTE: do not move cursor but need to handle {offset} for n & N ...! {{{
" FIXME: cannot set {offset} if in operator-pending mode because this
" have to use feedkeys()
let is_cancel = a:cli.exit_code()
if is_cancel
call s:cleanup_cmdline()
elseif !empty(offset) && mode(1) !=# 'no'
let cmd = incsearch#with_ignore_foldopen(
\ s:U.dictfunction(a:cli._generate_command, a:cli), a:input)
call feedkeys(cmd, 'n')
let g:incsearch#_view = a:cli._w
call feedkeys("\<Plug>(_incsearch-winrestview)", 'm')
call incsearch#autocmd#auto_nohlsearch(2)
else
" Handle last-pattern
if a:input isnot# ''
call histadd('/', a:input)
call s:set_search_reg(pattern, a:cli._base_key)
endif
call incsearch#autocmd#auto_nohlsearch(0)
endif
" }}}
return s:U.is_visual(a:cli._mode) ? "\<ESC>gv" : "\<ESC>" " just exit
endfunction
1 0.000002 function! s:search(cli, input) abort
call incsearch#autocmd#auto_nohlsearch(1) " NOTE: `.` repeat doesn't handle this
return a:cli._generate_command(a:input)
endfunction
1 0.000002 function! s:get_input(cli) abort
" Handle visual mode highlight
if s:U.is_visual(a:cli._mode)
let visual_hl = incsearch#highlight#get_visual_hlobj()
try
call incsearch#highlight#turn_off(visual_hl)
call incsearch#highlight#emulate_visual_highlight(a:cli._mode, visual_hl)
let input = a:cli.get(a:cli._pattern)
finally
call incsearch#highlight#turn_on(visual_hl)
endtry
else
let input = a:cli.get(a:cli._pattern)
endif
return input
endfunction
" Assume the cursor move is already done.
" This function handle search related stuff which doesn't be set by :execute
" in function like @/, hisory, jumplist, offset, error & warning emulation.
1 0.000003 function! s:set_search_related_stuff(cli, cmd, ...) abort
" For stay motion
let should_set_jumplist = get(a:, 1, s:TRUE)
let is_cancel = a:cli.exit_code()
if is_cancel
" Restore cursor position and return
" NOTE: Should I request on_cancel event to vital-over and use it?
call winrestview(a:cli._w)
call s:cleanup_cmdline()
return
endif
let [raw_pattern, offset] = a:cli._parse_pattern()
let should_execute = !empty(offset) || empty(raw_pattern)
if should_execute
" Execute with feedkeys() to work with
" 1. :h {offset} for `n` and `N`
" 2. empty input (:h last-pattern)
" NOTE: Don't use feedkeys() as much as possible to avoid flickering
call winrestview(a:cli._w)
call feedkeys(a:cmd, 'n')
if g:incsearch#consistent_n_direction
call feedkeys("\<Plug>(_incsearch-searchforward)", 'm')
endif
else
" Add history if necessary
" Do not save converted pattern to history
let pattern = a:cli._convert(raw_pattern)
let input = a:cli._combine_pattern(raw_pattern, offset)
call histadd(a:cli._base_key, input)
call s:set_search_reg(pattern, a:cli._base_key)
let target_view = winsaveview()
call winrestview(a:cli._w) " Get back start position temporarily for emulation
" Set jump list
if should_set_jumplist
normal! m`
endif
" Emulate errors, and handling `n` and `N` preparation
call s:emulate_search_error(a:cli._direction, a:cli._w)
" winrestview() between error and wraning emulation to avoid flickering
call winrestview(target_view)
" Emulate warning
call s:emulate_search_warning(a:cli._direction, a:cli._w, target_view)
call s:silent_after_search()
" Open fold
if &foldopen =~# '\vsearch|all'
normal! zv
endif
endif
endfunction
"}}}
" Helper: {{{
" @return [pattern, offset]
1 0.000003 function! incsearch#parse_pattern(expr, search_key) abort
" search_key : '/' or '?'
" expr : {pattern\/pattern}/{offset}
" expr : {pattern}/;/{newpattern} :h //;
" return : [{pattern\/pattern}, {offset}]
let very_magic = '\v'
let pattern = '(%(\\.|.){-})'
let slash = '(\' . a:search_key . '&[^\\"|[:alnum:][:blank:]])'
let offset = '(.*)'
let parse_pattern = very_magic . pattern . '%(' . slash . offset . ')?$'
let result = matchlist(a:expr, parse_pattern)[1:3]
if type(result) == type(0) || empty(result)
return []
endif
unlet result[1]
return result
endfunction
1 0.000003 function! incsearch#detect_case(pattern) abort
" Ignore \%C, \%U, \%V for smartcase detection
let p = substitute(a:pattern, s:non_escaped_backslash . '%[CUV]', '', 'g')
" Explicit \c has highest priority
if p =~# s:non_escaped_backslash . 'c'
return '\c'
endif
if p =~# s:non_escaped_backslash . 'C' || &ignorecase == s:FALSE
return '\C' " noignorecase or explicit \C
endif
if &smartcase == s:FALSE
return '\c' " ignorecase & nosmartcase
endif
" Find uppercase letter which isn't escaped
if p =~# s:escaped_backslash . '[A-Z]'
return '\C' " smartcase with [A-Z]
else
return '\c' " smartcase without [A-Z]
endif
endfunction
1 0.000003 function! s:silent_after_search(...) abort " arg: mode(1)
" :h function-search-undo
let m = get(a:, 1, mode(1))
if m !=# 'no' " guard for operator-mapping
let cmd = join([
\ (s:U.is_visual(m) ? "\<Plug>(_incsearch-esc)" : ''),
\ "\<Plug>(_incsearch-hlsearch)",
\ "\<Plug>(_incsearch-searchforward)",
\ (s:U.is_visual(m) ? "\<Plug>(_incsearch-gv)" : '')
\ ], '')
call feedkeys(cmd, 'm')
endif
endfunction
1 0.000021 noremap <silent> <Plug>(_incsearch-gv) <Nop>
1 0.000016 noremap! <silent> <Plug>(_incsearch-gv) <Nop>
1 0.000019 nnoremap <silent> <Plug>(_incsearch-gv) gv
1 0.000020 noremap <silent> <Plug>(_incsearch-esc) <Nop>
1 0.000019 noremap! <silent> <Plug>(_incsearch-esc) <Nop>
1 0.000018 xnoremap <silent> <Plug>(_incsearch-esc) <Esc>
1 0.000021 noremap <silent> <Plug>(_incsearch-hlsearch) <Nop>
1 0.000017 noremap! <silent> <Plug>(_incsearch-hlsearch) <Nop>
1 0.000023 nnoremap <silent> <Plug>(_incsearch-hlsearch) :<C-u>let &hlsearch=&hlsearch<CR>
1 0.000022 xnoremap <silent> <Plug>(_incsearch-hlsearch) :<C-u>let &hlsearch=&hlsearch<CR>gv
1 0.000022 noremap <silent> <Plug>(_incsearch-searchforward) <Nop>
1 0.000017 noremap! <silent> <Plug>(_incsearch-searchforward) <Nop>
1 0.000023 nnoremap <silent><expr> <Plug>(_incsearch-searchforward) <SID>_searchforward_cmd()
1 0.000023 xnoremap <silent><expr> <Plug>(_incsearch-searchforward) <SID>_searchforward_cmd()
1 0.000002 function! s:_searchforward_cmd() abort
let d = (g:incsearch#consistent_n_direction ? s:DIRECTION.forward : (incsearch#cli()._base_key is# '/' ? 1 : 0))
return printf(":\<C-u>let v:searchforward=%d\<CR>", d)
endfunction
1 0.000002 function! s:emulate_search_error(direction, ...) abort
let from = get(a:, 1, winsaveview())
let keyseq = (a:direction == s:DIRECTION.forward ? '/' : '?')
let old_errmsg = v:errmsg
let v:errmsg = ''
" NOTE:
" - XXX: Handle `n` and `N` preparation with s:silent_after_search()
" - silent!: Do not show error and warning message, because it also
" echo v:throwpoint for error and save messages in message-history
" - Unlike v:errmsg, v:warningmsg doesn't set if it use :silent!
" Get first error
silent! call incsearch#execute_search(keyseq . "\<CR>")
call winrestview(from)
if g:incsearch#do_not_save_error_message_history
if v:errmsg !=# ''
call s:Error(v:errmsg)
else
let v:errmsg = old_errmsg
endif
else
" NOTE: show more than two errors e.g. `/\za`
let last_error = v:errmsg
try
" Do not use silent! to show warning
call incsearch#execute_search(keyseq . "\<CR>")
catch /^Vim\%((\a\+)\)\=:E/
let first_error = matchlist(v:exception, '\v^Vim%(\(\a+\))=:(E.*)$')[1]
call s:Error(first_error, 'echom')
if last_error !=# '' && last_error !=# first_error
call s:Error(last_error, 'echom')
endif
finally
call winrestview(from)
endtry
if v:errmsg ==# ''
let v:errmsg = old_errmsg
endif
endif
endfunction
1 0.000003 function! s:emulate_search_warning(direction, from, to) abort
" NOTE:
" - It should use :h echomsg considering emulation of default
" warning messages remain in the :h message-history, but it'll mess
" up the message-history unnecessary, so it use :h echo
" - See :h shortmess
" if &shortmess !~# 's' && g:incsearch#do_not_save_error_message_history
if &shortmess !~# 's' && g:incsearch#do_not_save_error_message_history
let from = [a:from.lnum, a:from.col]
let to = [a:to.lnum, a:to.col]
let old_warningmsg = v:warningmsg
let v:warningmsg =
\ ( a:direction == s:DIRECTION.forward && !s:U.is_pos_less_equal(from, to)
\ ? 'search hit BOTTOM, continuing at TOP'
\ : a:direction == s:DIRECTION.backward && s:U.is_pos_less_equal(from, to)
\ ? 'search hit TOP, continuing at BOTTOM'
\ : '' )
if v:warningmsg !=# ''
call s:Warning(v:warningmsg)
else
let v:warningmsg = old_warningmsg
endif
endif
endfunction
1 0.000002 function! s:cleanup_cmdline() abort
redraw | echo ''
endfunction
" Should I use :h echoerr ? But it save the messages in message-history
1 0.000002 function! s:Error(msg, ...) abort
return call(function('s:_echohl'), [a:msg, 'ErrorMsg'] + a:000)
endfunction
1 0.000002 function! s:Warning(msg, ...) abort
return call(function('s:_echohl'), [a:msg, 'WarningMsg'] + a:000)
endfunction
1 0.000002 function! s:_echohl(msg, hlgroup, ...) abort
let echocmd = get(a:, 1, 'echo')
redraw | echo ''
exec 'echohl' a:hlgroup
exec echocmd string(a:msg)
echohl None
endfunction
" Not to generate command with zv
1 0.000004 function! incsearch#with_ignore_foldopen(F, ...) abort
let foldopen_save = &foldopen
let &foldopen=''
try
return call(a:F, a:000)
finally
let &foldopen = foldopen_save
endtry
endfunction
" Try to avoid side-effect as much as possible except cursor movement
1 0.000004 let s:has_keeppattern = v:version > 704 || v:version == 704 && has('patch083')
1 0.000004 let s:keeppattern = (s:has_keeppattern ? 'keeppattern' : '')
1 0.000002 function! s:_execute_search(cmd) abort
" :nohlsearch
" Please do not highlight at the first place if you set back
" info! I'll handle it myself :h function-search-undo
execute s:keeppattern 'keepjumps' 'normal!' a:cmd | nohlsearch
endfunction
1 0.000002 if s:has_keeppattern
1 0.000003 function! incsearch#execute_search(...) abort
return call(function('s:_execute_search'), a:000)
endfunction
1 0.000001 else
function! incsearch#execute_search(...) abort
" keeppattern emulation
let p = @/
let r = call(function('s:_execute_search'), a:000)
" NOTE: `let @/ = p` reset v:searchforward
let d = v:searchforward
let @/ = p
let v:searchforward = d
return r
endfunction
endif
1 0.000002 function! incsearch#magic() abort
let m = g:incsearch#magic
return (len(m) == 2 && m =~# '\\[mMvV]' ? m : '')
endfunction
" s:set_search_reg() set pattern to @/ with ?\? handling
" @command '/' or '?'
1 0.000008 function! s:set_search_reg(pattern, command) abort
let @/ = a:command is# '?'
\ ? substitute(a:pattern, '\\?', '?', 'g') : a:pattern
endfunction
"}}}
" Restore 'cpoptions' {{{
1 0.000014 let &cpo = s:save_cpo
1 0.000002 unlet s:save_cpo
" }}}
" __END__ {{{
" vim: expandtab softtabstop=2 shiftwidth=2
" vim: foldmethod=marker
" }}}
SCRIPT /home/x/.vim/plugged/incsearch.vim/autoload/incsearch/util.vim
Sourced 1 time
Total time: 0.000258
Self time: 0.000258
count total (s) self (s)
"=============================================================================
" FILE: autoload/incsearch/util.vim
" AUTHOR: haya14busa
" License: MIT license {{{
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the
" "Software"), to deal in the Software without restriction, including
" without limitation the rights to use, copy, modify, merge, publish,
" distribute, sublicense, and/or sell copies of the Software, and to
" permit persons to whom the Software is furnished to do so, subject to
" the following conditions:
"
" The above copyright notice and this permission notice shall be included
" in all copies or substantial portions of the Software.
"
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
" IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
" CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
" TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
" SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
" }}}
"=============================================================================
1 0.000002 scriptencoding utf-8
" Saving 'cpoptions' {{{
1 0.000007 let s:save_cpo = &cpo
1 0.000008 set cpo&vim
" }}}
1 0.000002 let s:TRUE = !0
1 0.000002 let s:FALSE = 0
" Public Utilities:
1 0.000003 function! incsearch#util#deepextend(...) abort
return call(function('s:deepextend'), a:000)
endfunction
" Utilities:
1 0.000003 function! incsearch#util#import() abort
let prefix = '<SNR>' . s:SID() . '_'
let module = {}
for func in s:functions
let module[func] = function(prefix . func)
endfor
return copy(module)
endfunction
1 0.000002 function! s:SID() abort
return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze_SID$')
endfunction
1 0.000008 let s:functions = [
\ 'is_visual'
\ , 'get_max_col'
\ , 'is_pos_less_equal'
\ , 'is_pos_more_equal'
\ , 'sort_num'
\ , 'sort_pos'
\ , 'count_pattern'
\ , 'silent_feedkeys'
\ , 'deepextend'
\ , 'dictfunction'
\ , 'regexp_join'
\ ]
1 0.000002 function! s:is_visual(mode) abort
return a:mode =~# "[vV\<C-v>]"
endfunction
" Return max column number of given line expression
" expr: similar to line(), col()
1 0.000003 function! s:get_max_col(expr) abort
return strlen(getline(a:expr)) + 1
endfunction
" return (x <= y)
1 0.000003 function! s:is_pos_less_equal(x, y) abort
return (a:x[0] == a:y[0]) ? a:x[1] <= a:y[1] : a:x[0] < a:y[0]
endfunction
" return (x > y)
1 0.000003 function! s:is_pos_more_equal(x, y) abort
return ! s:is_pos_less_equal(a:x, a:y)
endfunction
" x < y -> -1
" x = y -> 0
" x > y -> 1
1 0.000003 function! s:compare_pos(x, y) abort
return max([-1, min([1,(a:x[0] == a:y[0]) ? a:x[1] - a:y[1] : a:x[0] - a:y[0]])])
endfunction
1 0.000002 function! s:sort_num(xs) abort
" 7.4.341
" http://ftp.vim.org/vim/patches/7.4/7.4.341
if v:version > 704 || v:version == 704 && has('patch341')
return sort(a:xs, 'n')
else
return sort(a:xs, 's:_sort_num_func')
endif
endfunction
1 0.000003 function! s:_sort_num_func(x, y) abort
return a:x - a:y
endfunction
1 0.000002 function! s:sort_pos(pos_list) abort
" pos_list: [ [x1, y1], [x2, y2] ]
return sort(a:pos_list, 's:compare_pos')
endfunction
" Return the number of matched patterns in the current buffer or the specified
" region with `from` and `to` positions
" parameter: pattern, from, to
1 0.000002 function! s:count_pattern(pattern, ...) abort
let w = winsaveview()
let [from, to] = [
\ get(a:, 1, [1, 1]),
\ get(a:, 2, [line('$'), s:get_max_col('$')])
\ ]
let ignore_at_cursor_pos = get(a:, 3, 0)
" direction flag
let d_flag = s:compare_pos(from, to) > 0 ? 'b' : ''
call cursor(from)
let cnt = 0
let base_flag = d_flag . 'W'
try
" first: accept a match at the cursor position
let pos = searchpos(a:pattern, (ignore_at_cursor_pos ? '' : 'c' ) . base_flag)
while (pos != [0, 0] && s:compare_pos(pos, to) isnot# (d_flag is# 'b' ? -1 : 1))
let cnt += 1
let pos = searchpos(a:pattern, base_flag)
endwhile
finally
call winrestview(w)
endtry
return cnt
endfunction
" NOTE: support vmap?
" It doesn't handle feedkeys() on incsert or command-line mode
1 0.000003 function! s:silent_feedkeys(expr, name, ...) abort
" Ref:
" https://github.com/osyo-manga/vim-over/blob/d51b028c29661d4a5f5b79438ad6d69266753711/autoload/over.vim#L6
let mode = get(a:, 1, 'm')
let name = 'incsearch-' . a:name
let map = printf('<Plug>(%s)', name)
if mode ==# 'n'
let command = 'nnoremap'
else
let command = 'nmap'
endif
execute command '<silent>' map printf('%s:nunmap %s<CR>', a:expr, map)
if mode(1) !=# 'ce'
" FIXME: mode(1) !=# 'ce' exists only for the test
" :h feedkeys() doesn't work while runnning a test script
" https://github.com/kana/vim-vspec/issues/27
call feedkeys(printf("\<Plug>(%s)", name))
endif
endfunction
" deepextend (nest: 1)
1 0.000002 function! s:deepextend(expr1, expr2) abort
let expr2 = copy(a:expr2)
for [k, V] in items(a:expr1)
if (type(V) is type({}) || type(V) is type([])) && has_key(expr2, k)
let a:expr1[k] = extend(a:expr1[k], expr2[k])
unlet expr2[k]
endif
unlet V
endfor
return extend(a:expr1, expr2)
endfunction
1 0.000003 let s:funcmanage = {}
1 0.000002 function! s:funcmanage() abort
return s:funcmanage
endfunction
1 0.000002 function! s:dictfunction(dictfunc, dict) abort
if has('patch-7.4.1842')
let funcname = '_' . get(a:dictfunc, 'name')
else
let funcname = '_' . matchstr(string(a:dictfunc), '\d\+')
endif
let s:funcmanage[funcname] = {
\ 'func': a:dictfunc,
\ 'dict': a:dict
\ }
let prefix = '<SNR>' . s:SID() . '_'
let fm = printf("%sfuncmanage()['%s']", prefix, funcname)
execute join([
\ printf('function! s:%s(...) abort', funcname),
\ printf(" return call(%s['func'], a:000, %s['dict'])", fm, fm),
\ 'endfunction'
\ ], "\n")
return function(printf('%s%s', prefix, funcname))
endfunction
"--- regexp
1 0.000003 let s:escaped_backslash = '\m\%(^\|[^\\]\)\%(\\\\\)*\zs'
1 0.000002 function! s:regexp_join(ps) abort
let rs = map(filter(copy(a:ps), 's:_is_valid_regexp(v:val)'), 's:escape_unbalanced_left_r(v:val)')
return printf('\m\%%(%s\m\)', join(rs, '\m\|'))
endfunction
1 0.000002 function! s:_is_valid_regexp(pattern) abort
try
if '' =~# a:pattern
endif
return s:TRUE
catch
return s:FALSE
endtry
endfunction
" \m,\v: [ -> \[
" \M,\V: \[ -> [
1 0.000003 function! s:escape_unbalanced_left_r(pattern) abort
let rs = []
let cs = split(a:pattern, '\zs')
" escape backslash (\, \\\, \\\\\, ...)
let escape_bs = s:FALSE
let flag = &magic ? 'm' : 'M'
let i = 0
while i < len(cs)
let c = cs[i]
" characters to add to rs
let addcs = [c]
if escape_bs && s:_is_flag(c)
let flag = c
elseif c is# '[' && s:_may_replace_left_r_cond(escape_bs, flag)
let idx = s:_find_right_r(cs, i)
if idx is# -1
if s:_is_flag(flag, 'MV')
" Remove `\` before unbalanced `[`
let rs = rs[:-2]
else
" Escape unbalanced `[`
let addcs = ['\' . c]
endif
else
let addcs = cs[(i):(i+idx)]
let i += idx
endif
endif
let escape_bs = (escape_bs || c isnot# '\') ? s:FALSE : s:TRUE
let rs += addcs
let i += 1
endwhile
return join(rs, '')
endfunction
" @ return boolean
1 0.000002 function! s:_is_flag(flag, ...) abort
let chars = get(a:, 1, 'mMvV')
return a:flag =~# printf('\m[%s]', chars)
endfunction
" @ return boolean
1 0.000003 function! s:_may_replace_left_r_cond(escape_bs, flag) abort
return (a:escape_bs && s:_is_flag(a:flag, 'MV')) || (!a:escape_bs && s:_is_flag(a:flag, 'mv'))
endfunction
" @return index
1 0.000003 function! s:_find_right_r(cs, i) abort
return match(join(a:cs[(a:i+1):], ''), s:escaped_backslash . ']')
endfunction
"--- end of regexp
" Restore 'cpoptions' {{{
1 0.000009 let &cpo = s:save_cpo
1 0.000002 unlet s:save_cpo
" }}}
" __END__ {{{
" vim: expandtab softtabstop=2 shiftwidth=2
" vim: foldmethod=marker
" }}}
SCRIPT /home/x/.vim/plugged/incsearch.vim/autoload/incsearch/config.vim
Sourced 1 time
Total time: 0.000222
Self time: 0.000123
count total (s) self (s)
"=============================================================================
" FILE: autoload/incsearch/config.vim
" AUTHOR: haya14busa
" License: MIT license
"=============================================================================
1 0.000002 scriptencoding utf-8
1 0.000011 let s:save_cpo = &cpo
1 0.000013 set cpo&vim
1 0.000002 let s:TRUE = !0
1 0.000002 let s:FALSE = 0
1 0.000002 lockvar s:TRUE s:FALSE
1 0.000107 0.000008 let s:U = incsearch#util#import()
"" incsearch config
" TODO: more detail documentation
" @command is equivalent with base_key TODO: fix this inconsistence
" @count default: v:count secret
" @mode default: mode(1) secret
1 0.000009 let s:config = {
\ 'command': '/',
\ 'is_stay': s:FALSE,
\ 'is_expr': s:FALSE,
\ 'pattern': '',
\ 'mode': 'n',
\ 'count': 0,
\ 'prompt': '',
\ 'modules': [],
\ 'converters': [],
\ 'keymap': {}
\ }
" @return config for lazy value
1 0.000003 function! s:lazy_config() abort
let m = mode(1)
return {
\ 'count': v:count,
\ 'mode': m,
\ 'is_expr': (m is# 'no'),
\ 'keymap': s:keymap()
\ }
endfunction
" @return config with default value
1 0.000004 function! incsearch#config#make(additional) abort
let default = extend(deepcopy(s:config), s:lazy_config())
let c = s:U.deepextend(default, a:additional)
if c.prompt is# ''
let c.prompt = c.command
endif
return c
endfunction
1 0.000020 let s:default_keymappings = {
\ "\<Tab>" : {
\ 'key' : '<Over>(incsearch-next)',
\ 'noremap' : 1,
\ },
\ "\<S-Tab>" : {
\ 'key' : '<Over>(incsearch-prev)',
\ 'noremap' : 1,
\ },
\ "\<C-j>" : {
\ 'key' : '<Over>(incsearch-scroll-f)',
\ 'noremap' : 1,
\ },
\ "\<C-k>" : {
\ 'key' : '<Over>(incsearch-scroll-b)',
\ 'noremap' : 1,
\ },
\ "\<C-l>" : {
\ 'key' : '<Over>(buffer-complete)',
\ 'noremap' : 1,
\ },
\ "\<CR>" : {
\ 'key': "\<CR>",
\ 'noremap': 1
\ },
\ }
" https://github.com/haya14busa/incsearch.vim/issues/35
1 0.000004 if has('mac')
call extend(s:default_keymappings, {
\ '"+gP' : {
\ 'key': "\<C-r>+",
\ 'noremap': 1
\ },
\ })
endif
1 0.000002 function! s:keymap() abort
return extend(copy(s:default_keymappings), g:incsearch_cli_key_mappings)
endfunction
1 0.000008 let &cpo = s:save_cpo
1 0.000002 unlet s:save_cpo
" __END__
" vim: expandtab softtabstop=2 shiftwidth=2 foldmethod=marker
SCRIPT /home/x/.vim/plugged/incsearch.vim/autoload/incsearch/cli.vim
Sourced 1 time
Total time: 0.035324
Self time: 0.000916
count total (s) self (s)
"=============================================================================
" FILE: autoload/incsearch/cli.vim
" AUTHOR: haya14busa
" License: MIT license
"=============================================================================
1 0.000002 scriptencoding utf-8
1 0.000011 let s:save_cpo = &cpo
1 0.000008 set cpo&vim
1 0.000004 let s:DIRECTION = { 'forward': 1, 'backward': 0 } " see :h v:searchforward
1 0.000004 function! incsearch#cli#get() abort
try
" It returns current cli object
return s:Doautocmd.get_cmdline()
catch /vital-over(_incsearch) Exception/
" If there are no current cli object, return default one
return incsearch#cli#make(incsearch#config#make({}))
endtry
endfunction
" @config: whole configuration
1 0.000003 function! incsearch#cli#make(config) abort
let cli = deepcopy(s:cli)
call incsearch#cli#set(cli, a:config)
return cli
endfunction
" To reuse cli object, you should re-set configuration
" @config: whole configuration
1 0.000003 function! incsearch#cli#set(cli, config) abort
let a:cli._base_key = a:config.command
let a:cli._vcount1 = max([1, a:config.count])
let a:cli._has_count = a:config.count > 0
let a:cli._is_expr = a:config.is_expr
let a:cli._mode = a:config.mode
let a:cli._pattern = a:config.pattern
let a:cli._prompt = a:config.prompt
let a:cli._keymap = a:config.keymap
let a:cli._converters = a:config.converters
let a:cli._flag = a:config.is_stay ? 'n'
\ : a:config.command is# '/' ? ''
\ : a:config.command is# '?' ? 'b'
\ : ''
let a:cli._direction =
\ (a:cli._base_key is# '/' ? s:DIRECTION.forward : s:DIRECTION.backward)
" TODO: provide config? but it may conflict with <expr> mapping
" NOTE: _w: default cursor view
let a:cli._w = winsaveview()
for module in a:config.modules
call a:cli.connect(module)
endfor
call a:cli.set_prompt(a:cli._prompt)
return a:cli
endfunction
1 0.000051 let s:cli = vital#incsearch#import('Over.Commandline').make_default('/')
1 0.000062 0.000007 let s:modules = vital#incsearch#import('Over.Commandline.Modules')
" Add modules
1 0.000906 0.000003 call s:cli.connect('BufferComplete')
1 0.000659 0.000004 call s:cli.connect('Cancel')
1 0.000677 0.000004 call s:cli.connect('CursorMove')
1 0.000827 0.000005 call s:cli.connect('Digraphs')
1 0.000698 0.000003 call s:cli.connect('Delete')
1 0.000862 0.000003 call s:cli.connect('DrawCommandline')
1 0.000691 0.000004 call s:cli.connect('ExceptionExit')
1 0.000629 0.000004 call s:cli.connect('LiteralInsert')
1 0.000061 call s:cli.connect(incsearch#over#modules#exit#make())
1 0.000055 call s:cli.connect(incsearch#over#modules#insert_register#make())
1 0.000603 0.000004 call s:cli.connect('Paste')
1 0.001502 0.000005 let s:Doautocmd = s:modules.get('Doautocmd')
1 0.000323 0.000011 call s:cli.connect(s:Doautocmd.make('IncSearch'))
1 0.000677 0.000014 call s:cli.connect(s:modules.get('ExceptionMessage').make('incsearch.vim: ', 'echom'))
1 0.000652 0.000014 call s:cli.connect(s:modules.get('History').make('/'))
1 0.000654 0.000018 call s:cli.connect(s:modules.get('NoInsert').make_special_chars())
" Dynamic Module Loading Management
1 0.002051 0.000004 let s:KeyMapping = s:modules.get('KeyMapping')
1 0.000015 0.000011 let s:emacs_like = s:KeyMapping.make_emacs()
1 0.000019 0.000014 let s:vim_cmap = s:KeyMapping.make_vim_cmdline_mapping()
1 0.000579 0.000011 let s:smartbackword = s:modules.get('IgnoreRegexpBackwardWord').make()
1 0.000003 function! s:emacs_like._condition() abort
return g:incsearch#emacs_like_keymap
endfunction
1 0.000002 function! s:vim_cmap._condition() abort
return g:incsearch#vim_cmdline_keymap
endfunction
1 0.000001 function! s:smartbackword._condition() abort
return g:incsearch#smart_backward_word
endfunction
1 0.000060 call s:cli.connect(incsearch#over#modules#module_management#make([s:emacs_like, s:vim_cmap, s:smartbackword]))
1 0.000003 unlet s:KeyMapping s:emacs_like s:vim_cmap s:smartbackword
1 0.000054 call s:cli.connect(incsearch#over#modules#pattern_saver#make())
1 0.000056 call s:cli.connect(incsearch#over#modules#bulk_input_char#make())
1 0.000058 call s:cli.connect(incsearch#over#modules#bracketed_paste#make())
1 0.000053 call s:cli.connect(incsearch#over#modules#incsearch#make())
1 0.000001 function! s:cli.__keymapping__() abort
return copy(self._keymap)
endfunction
1 0.000065 call incsearch#over#extend#enrich(s:cli)
1 0.000008 let &cpo = s:save_cpo
1 0.000002 unlet s:save_cpo
" __END__
" vim: expandtab softtabstop=2 shiftwidth=2 foldmethod=marker
SCRIPT /home/x/.vim/plugged/incsearch.vim/autoload/vital/incsearch.vim
Sourced 1 time
Total time: 0.000450
Self time: 0.000409
count total (s) self (s)
let s:plugin_name = expand('<sfile>:t:r')
1 0.000004 let s:vital_base_dir = expand('<sfile>:h')
1 0.000004 let s:project_root = expand('<sfile>:h:h:h')
1 0.000003 let s:is_vital_vim = s:plugin_name is# 'vital'
1 0.000002 let s:loaded = {}
1 0.000002 let s:cache_sid = {}
" function() wrapper
1 0.000003 if v:version > 703 || v:version == 703 && has('patch1170')
1 0.000002 function! s:_function(fstr) abort
return function(a:fstr)
endfunction
1 0.000001 else
function! s:_SID() abort
return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze__SID$')
endfunction
let s:_s = '<SNR>' . s:_SID() . '_'
function! s:_function(fstr) abort
return function(substitute(a:fstr, 's:', s:_s, 'g'))
endfunction
endif
1 0.000005 function! vital#{s:plugin_name}#of() abort
return s:new(s:plugin_name)
endfunction
1 0.000004 function! vital#{s:plugin_name}#import(...) abort
if !exists('s:V')
let s:V = s:new(s:plugin_name)
endif
return call(s:V.import, a:000, s:V)
endfunction
1 0.000002 let s:Vital = {}
1 0.000002 function! s:new(plugin_name) abort
let base = deepcopy(s:Vital)
let base._plugin_name = a:plugin_name
return base
endfunction
1 0.000002 function! s:vital_files() abort
if !exists('s:vital_files')
let s:vital_files = map(
\ s:is_vital_vim ? s:_global_vital_files() : s:_self_vital_files(),
\ 'fnamemodify(v:val, ":p:gs?[\\\\/]?/?")')
endif
return copy(s:vital_files)
endfunction
1 0.000014 0.000009 let s:Vital.vital_files = s:_function('s:vital_files')
1 0.000002 function! s:import(name, ...) abort dict
let target = {}
let functions = []
for a in a:000
if type(a) == type({})
let target = a
elseif type(a) == type([])
let functions = a
endif
unlet a
endfor
let module = self._import(a:name)
if empty(functions)
call extend(target, module, 'keep')
else
for f in functions
if has_key(module, f) && !has_key(target, f)
let target[f] = module[f]
endif
endfor
endif
return target
endfunction
1 0.000010 0.000006 let s:Vital.import = s:_function('s:import')
1 0.000002 function! s:load(...) abort dict
for arg in a:000
let [name; as] = type(arg) == type([]) ? arg[: 1] : [arg, arg]
let target = split(join(as, ''), '\W\+')
let dict = self
let dict_type = type({})
while !empty(target)
let ns = remove(target, 0)
if !has_key(dict, ns)
let dict[ns] = {}
endif
if type(dict[ns]) == dict_type
let dict = dict[ns]
else
unlet dict
break
endif
endwhile
if exists('dict')
call extend(dict, self._import(name))
endif
unlet arg
endfor
return self
endfunction
1 0.000009 0.000004 let s:Vital.load = s:_function('s:load')
1 0.000002 function! s:unload() abort dict
let s:loaded = {}
let s:cache_sid = {}
unlet! s:vital_files
endfunction
1 0.000010 0.000006 let s:Vital.unload = s:_function('s:unload')
1 0.000002 function! s:exists(name) abort dict
if a:name !~# '\v^\u\w*%(\.\u\w*)*$'
throw 'vital: Invalid module name: ' . a:name
endif
return s:_module_path(a:name) isnot# ''
endfunction
1 0.000009 0.000004 let s:Vital.exists = s:_function('s:exists')
1 0.000002 function! s:search(pattern) abort dict
let paths = s:_extract_files(a:pattern, self.vital_files())
let modules = sort(map(paths, 's:_file2module(v:val)'))
return s:_uniq(modules)
endfunction
1 0.000009 0.000005 let s:Vital.search = s:_function('s:search')
1 0.000003 function! s:plugin_name() abort dict
return self._plugin_name
endfunction
1 0.000009 0.000005 let s:Vital.plugin_name = s:_function('s:plugin_name')
1 0.000002 function! s:_self_vital_files() abort
let builtin = printf('%s/__%s__/', s:vital_base_dir, s:plugin_name)
let installed = printf('%s/_%s/', s:vital_base_dir, s:plugin_name)
let base = builtin . ',' . installed
return split(globpath(base, '**/*.vim', 1), "\n")
endfunction
1 0.000002 function! s:_global_vital_files() abort
let pattern = 'autoload/vital/__*__/**/*.vim'
return split(globpath(&runtimepath, pattern, 1), "\n")
endfunction
1 0.000003 function! s:_extract_files(pattern, files) abort
let tr = {'.': '/', '*': '[^/]*', '**': '.*'}
let target = substitute(a:pattern, '\.\|\*\*\?', '\=tr[submatch(0)]', 'g')
let regexp = printf('autoload/vital/[^/]\+/%s.vim$', target)
return filter(a:files, 'v:val =~# regexp')
endfunction
1 0.000005 function! s:_file2module(file) abort
let filename = fnamemodify(a:file, ':p:gs?[\\/]?/?')
let tail = matchstr(filename, 'autoload/vital/_\w\+/\zs.*\ze\.vim$')
return join(split(tail, '[\\/]\+'), '.')
endfunction
" @param {string} name e.g. Data.List
1 0.000002 function! s:_import(name) abort dict
if has_key(s:loaded, a:name)
return copy(s:loaded[a:name])
endif
let module = self._get_module(a:name)
if has_key(module, '_vital_created')
call module._vital_created(module)
endif
let export_module = filter(copy(module), 'v:key =~# "^\\a"')
" Cache module before calling module.vital_loaded() to avoid cyclic
" dependences but remove the cache if module._vital_loaded() fails.
" let s:loaded[a:name] = export_module
let s:loaded[a:name] = export_module
if has_key(module, '_vital_loaded')
try
call module._vital_loaded(vital#{s:plugin_name}#of())
catch
unlet s:loaded[a:name]
throw 'vital: fail to call ._vital_loaded(): ' . v:exception
endtry
endif
return copy(s:loaded[a:name])
endfunction
1 0.000010 0.000005 let s:Vital._import = s:_function('s:_import')
" s:_get_module() returns module object wihch has all script local functions.
1 0.000002 function! s:_get_module(name) abort dict
let funcname = s:_import_func_name(self.plugin_name(), a:name)
if s:_exists_autoload_func_with_source(funcname)
return call(funcname, [])
else
return s:_get_builtin_module(a:name)
endif
endfunction
1 0.000002 function! s:_get_builtin_module(name) abort
return s:sid2sfuncs(s:_module_sid(a:name))
endfunction
1 0.000002 if s:is_vital_vim
" For vital.vim, we can use s:_get_builtin_module directly
let s:Vital._get_module = s:_function('s:_get_builtin_module')
else
1 0.000009 0.000004 let s:Vital._get_module = s:_function('s:_get_module')
1 0.000001 endif
1 0.000003 function! s:_import_func_name(plugin_name, module_name) abort
return printf('vital#_%s#%s#import', a:plugin_name, s:_dot_to_sharp(a:module_name))
endfunction
1 0.000003 function! s:_module_sid(name) abort
let path = s:_module_path(a:name)
if !filereadable(path)
throw 'vital: module not found: ' . a:name
endif
let vital_dir = s:is_vital_vim ? '__\w\+__' : printf('_\{1,2}%s\%%(__\)\?', s:plugin_name)
let base = join([vital_dir, ''], '[/\\]\+')
let p = base . substitute('' . a:name, '\.', '[/\\\\]\\+', 'g')
let sid = s:_sid(path, p)
if !sid
call s:_source(path)
let sid = s:_sid(path, p)
if !sid
throw printf('vital: cannot get <SID> from path: %s', path)
endif
endif
return sid
endfunction
1 0.000002 function! s:_module_path(name) abort
return get(s:_extract_files(a:name, s:vital_files()), 0, '')
endfunction
1 0.000002 function! s:_module_sid_base_dir() abort
return s:is_vital_vim ? &rtp : s:project_root
endfunction
1 0.000002 function! s:_dot_to_sharp(name) abort
return substitute(a:name, '\.', '#', 'g')
endfunction
" It will sources autoload file if a given func is not already defined.
1 0.000003 function! s:_exists_autoload_func_with_source(funcname) abort
if exists('*' . a:funcname)
" Return true if a given func is already defined
return 1
endif
" source a file which may include a given func definition and try again.
let path = 'autoload/' . substitute(substitute(a:funcname, '#[^#]*$', '.vim', ''), '#', '/', 'g')
call s:_runtime(path)
return exists('*' . a:funcname)
endfunction
1 0.000003 function! s:_runtime(path) abort
execute 'runtime' fnameescape(a:path)
endfunction
1 0.000002 function! s:_source(path) abort
execute 'source' fnameescape(a:path)
endfunction
" @vimlint(EVL102, 1, l:_)
" @vimlint(EVL102, 1, l:__)
1 0.000002 function! s:_sid(path, filter_pattern) abort
let unified_path = s:_unify_path(a:path)
if has_key(s:cache_sid, unified_path)
return s:cache_sid[unified_path]
endif
for line in filter(split(s:_redir(':scriptnames'), "\n"), 'v:val =~# a:filter_pattern')
let [_, sid, path; __] = matchlist(line, '^\s*\(\d\+\):\s\+\(.\+\)\s*$')
if s:_unify_path(path) is# unified_path
let s:cache_sid[unified_path] = sid
return s:cache_sid[unified_path]
endif
endfor
return 0
endfunction
1 0.000002 function! s:_redir(cmd) abort
let [save_verbose, save_verbosefile] = [&verbose, &verbosefile]
set verbose=0 verbosefile=
redir => res
silent! execute a:cmd
redir END
let [&verbose, &verbosefile] = [save_verbose, save_verbosefile]
return res
endfunction
1 0.000009 if filereadable(expand('<sfile>:r') . '.VIM') " is case-insensitive or not
let s:_unify_path_cache = {}
" resolve() is slow, so we cache results.
" Note: On windows, vim can't expand path names from 8.3 formats.
" So if getting full path via <sfile> and $HOME was set as 8.3 format,
" vital load duplicated scripts. Below's :~ avoid this issue.
function! s:_unify_path(path) abort
if has_key(s:_unify_path_cache, a:path)
return s:_unify_path_cache[a:path]
endif
let value = tolower(fnamemodify(resolve(fnamemodify(
\ a:path, ':p')), ':~:gs?[\\/]?/?'))
let s:_unify_path_cache[a:path] = value
return value
endfunction
else
1 0.000002 function! s:_unify_path(path) abort
return resolve(fnamemodify(a:path, ':p:gs?[\\/]?/?'))
endfunction
1 0.000001 endif
" copied and modified from Vim.ScriptLocal
1 0.000032 let s:SNR = join(map(range(len("\<SNR>")), '"[\\x" . printf("%0x", char2nr("\<SNR>"[v:val])) . "]"'), '')
1 0.000002 function! s:sid2sfuncs(sid) abort
let fs = split(s:_redir(printf(':function /^%s%s_', s:SNR, a:sid)), "\n")
let r = {}
let pattern = printf('\m^function\s<SNR>%d_\zs\w\{-}\ze(', a:sid)
for fname in map(fs, 'matchstr(v:val, pattern)')
let r[fname] = function(s:_sfuncname(a:sid, fname))
endfor
return r
endfunction
"" Return funcname of script local functions with SID
1 0.000003 function! s:_sfuncname(sid, funcname) abort
return printf('<SNR>%s_%s', a:sid, a:funcname)
endfunction
1 0.000003 if exists('*uniq')
1 0.000002 function! s:_uniq(list) abort
return uniq(a:list)
endfunction
1 0.000001 else
function! s:_uniq(list) abort
let i = len(a:list) - 1
while 0 < i
if a:list[i] ==# a:list[i - 1]
call remove(a:list, i)
endif
let i -= 1
endwhile
return a:list
endfunction
endif
SCRIPT /home/x/.vim/plugged/incsearch.vim/autoload/vital/_incsearch/Over/Commandline.vim
Sourced 2 times
Total time: 1507493888.698029
Self time: 1507493888.697928
count total (s) self (s)
" ___vital___
" NOTE: lines between '" ___vital___' is generated by :Vitalize.
" Do not mofidify the code nor insert new lines before '" ___vital___'
2 0.000006 if v:version > 703 || v:version == 703 && has('patch1170')
2 0.000060 function! vital#_incsearch#Over#Commandline#import() abort
return map({'_vital_depends': '', 'make_standard_search_back': '', 'get_module': '', 'make_standard_search': '', 'make_standard': '', 'make_module': '', 'make_default': '', '_vital_loaded': ''}, 'function("s:" . v:key)')
endfunction
2 0.000004 else
function! s:_SID() abort
return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze__SID$')
endfunction
execute join(['function! vital#_incsearch#Over#Commandline#import() abort', printf("return map({'_vital_depends': '', 'make_standard_search_back': '', 'get_module': '', 'make_standard_search': '', 'make_standard': '', 'make_module': '', 'make_default': '', '_vital_loaded': ''}, \"function('<SNR>%s_' . v:key)\")", s:_SID()), 'endfunction'], "\n")
delfunction s:_SID
endif
" ___vital___
2 0.000003 scriptencoding utf-8
2 0.000022 let s:save_cpo = &cpo
2 0.000015 set cpo&vim
2 0.000005 function! s:_vital_loaded(V)
let s:V = a:V
let s:Maker = s:V.import("Over.Commandline.Maker")
let s:Modules = s:V.import("Over.Commandline.Modules")
endfunction
2 0.000004 function! s:_vital_depends()
return [
\ "Over.Commandline.Maker",
\ "Over.Commandline.Modules",
\ "Over.Commandline.Modules.All",
\ ]
endfunction
2 0.000004 function! s:make_module(...)
return call(s:Modules.make, a:000, s:Modules)
endfunction
2 0.000003 function! s:get_module(...)
return call(s:Modules.get, a:000, s:Modules)
endfunction
2 0.000004 function! s:make_default(...)
return call(s:Maker.default, a:000, s:Maker)
endfunction
2 0.000003 function! s:make_standard(...)
return call(s:Maker.standard, a:000, s:Maker)
endfunction
2 0.000004 function! s:make_standard_search(...)
return call(s:Maker.standard_search, a:000, s:Maker)
endfunction
2 0.000005 function! s:make_standard_search_back(...)
return call(s:Maker.standard_search_back, a:000, s:Maker)
endfunction
2 0.000015 let &cpo = s:save_cpo
2 0.000006 unlet s:save_cpo
SCRIPT /home/x/.vim/plugged/incsearch.vim/autoload/vital/_incsearch/Over/Commandline/Maker.vim
Sourced 2 times
Total time: 1507493888.698633
Self time: 1507493888.698514
count total (s) self (s)
" ___vital___
" NOTE: lines between '" ___vital___' is generated by :Vitalize.
" Do not mofidify the code nor insert new lines before '" ___vital___'
2 0.000008 if v:version > 703 || v:version == 703 && has('patch1170')
2 0.000058 function! vital#_incsearch#Over#Commandline#Maker#import() abort
return map({'plain': '', '_vital_depends': '', 'standard_search': '', 'standard': '', 'standard_search_back': '', 'default': '', '_vital_loaded': ''}, 'function("s:" . v:key)')
endfunction
2 0.000002 else
function! s:_SID() abort
return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze__SID$')
endfunction
execute join(['function! vital#_incsearch#Over#Commandline#Maker#import() abort', printf("return map({'plain': '', '_vital_depends': '', 'standard_search': '', 'standard': '', 'standard_search_back': '', 'default': '', '_vital_loaded': ''}, \"function('<SNR>%s_' . v:key)\")", s:_SID()), 'endfunction'], "\n")
delfunction s:_SID
endif
" ___vital___
2 0.000003 scriptencoding utf-8
2 0.000014 let s:save_cpo = &cpo
2 0.000016 set cpo&vim
2 0.000018 let s:modules = [
\ "Scroll",
\ "CursorMove",
\ "Delete",
\ "HistAdd",
\ "History",
\ "Cancel",
\ "Execute",
\ "NoInsert",
\ "InsertRegister",
\ "Redraw",
\ "DrawCommandline",
\ "ExceptionExit",
\ "ExceptionMessage",
\]
2 0.000005 function! s:_vital_loaded(V)
let s:V = a:V
let s:Cmdline = s:V.import("Over.Commandline.Base")
let s:Modules = s:V.import("Over.Commandline.Modules")
endfunction
2 0.000004 function! s:_vital_depends()
return [
\ "Over.Commandline.Base",
\ "Over.Commandline.Modules",
\ ] + map(copy(s:modules), "'Over.Commandline.Modules.' . v:val")
endfunction
2 0.000004 function! s:default(...)
return call(s:Cmdline.make, a:000, s:Cmdline)
endfunction
2 0.000004 function! s:plain()
return s:Cmdline.plain()
endfunction
2 0.000003 function! s:standard(...)
let result = call(s:Cmdline.make, a:000, s:Cmdline)
call result.connect("Execute")
call result.connect("Cancel")
call result.connect("Delete")
call result.connect("CursorMove")
call result.connect("HistAdd")
call result.connect("History")
call result.connect("InsertRegister")
call result.connect(s:Modules.get("NoInsert").make_special_chars())
call result.connect("Redraw")
call result.connect("DrawCommandline")
call result.connect("ExceptionExit")
call result.connect("ExceptionMessage")
call result.connect(s:Modules.get("KeyMapping").make_vim_cmdline_mapping())
call result.connect("Digraphs")
call result.connect("LiteralInsert")
return result
endfunction
2 0.000004 function! s:standard_search(...)
let result = s:standard(get(a:, 1, "/"))
call result.connect(s:Modules.get("Execute").make_search("/"))
call result.connect(s:Modules.make("HistAdd", "/"))
call result.connect(s:Modules.make("History", "/"))
return result
endfunction
2 0.000004 function! s:standard_search_back(...)
let result = s:standard(get(a:, 1, "?"))
call result.connect(s:Modules.get("Execute").make_search("?"))
call result.connect(s:Modules.make("HistAdd", "/"))
call result.connect(s:Modules.make("History", "/"))
return result
endfunction
2 0.000016 let &cpo = s:save_cpo
2 0.000005 unlet s:save_cpo
SCRIPT /home/x/.vim/plugged/incsearch.vim/autoload/vital/_incsearch/Over/Commandline/Base.vim
Sourced 2 times
Total time: 1507493888.700089
Self time: 1507493888.699549
count total (s) self (s)
" ___vital___
" NOTE: lines between '" ___vital___' is generated by :Vitalize.
" Do not mofidify the code nor insert new lines before '" ___vital___'
2 0.000007 if v:version > 703 || v:version == 703 && has('patch1170')
2 0.000061 function! vital#_incsearch#Over#Commandline#Base#import() abort
return map({'_vital_depends': '', 'make_plain': '', 'is_input_waiting': '', 'make': '', '_vital_loaded': ''}, 'function("s:" . v:key)')
endfunction
2 0.000002 else
function! s:_SID() abort
return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze__SID$')
endfunction
execute join(['function! vital#_incsearch#Over#Commandline#Base#import() abort', printf("return map({'_vital_depends': '', 'make_plain': '', 'is_input_waiting': '', 'make': '', '_vital_loaded': ''}, \"function('<SNR>%s_' . v:key)\")", s:_SID()), 'endfunction'], "\n")
delfunction s:_SID
endif
" ___vital___
2 0.000017 scriptencoding utf-8
2 0.000018 let s:save_cpo = &cpo
2 0.000016 set cpo&vim
2 0.000005 function! s:_vital_loaded(V)
let s:V = a:V
let s:String = s:V.import("Over.String")
let s:Signals = s:V.import("Over.Signals")
let s:Input = s:V.import("Over.Input")
let s:Keymapping = s:V.import("Over.Keymapping")
let s:Module = s:V.import("Over.Commandline.Modules")
let s:base.variables.modules = s:Signals.make()
function! s:base.variables.modules.get_slot(val)
return a:val.slot.module
endfunction
let s:Highlight = s:V.import("Palette.Highlight")
endfunction
2 0.000004 function! s:_vital_depends()
return [
\ "Over.String",
\ "Over.Signals",
\ "Over.Input",
\ "Over.Keymapping",
\ "Over.Commandline.Modules",
\ "Palette.Highlight",
\ ]
endfunction
2 0.000003 function! s:make(...)
let result = deepcopy(s:base)
call result.set_prompt(get(a:, 1, ":"))
call result.connect(result, "_")
return result
endfunction
2 0.000002 function! s:make_plain()
return deepcopy(s:base)
endfunction
2 0.000057 let s:base = {
\ "line" : {},
\ "variables" : {
\ "prompt" : "",
\ "char" : "",
\ "input" : "",
\ "tap_key" : "",
\ "exit" : 0,
\ "keymapping" : {},
\ "suffix" : "",
\ "is_setted" : 0,
\ },
\ "highlights" : {
\ "prompt" : "NONE",
\ "cursor" : "VitalOverCommandLineCursor",
\ "cursor_on" : "VitalOverCommandLineCursorOn",
\ "cursor_insert" : "VitalOverCommandLineOnCursor",
\ },
\}
2 0.000005 if exists("s:Signals")
let s:base.variables.modules = s:Signals.make()
function! s:base.variables.modules.get_slot(val)
return a:val.slot.module
endfunction
endif
2 0.000003 function! s:base.getline()
return self.line.str()
endfunction
2 0.000003 function! s:base.setline(line)
return self.line.set(a:line)
endfunction
2 0.000004 function! s:base.char()
return self.variables.char
endfunction
2 0.000003 function! s:base.setchar(char, ...)
" 1 の場合は既に設定されていても上書きする
" 0 の場合は既に設定されていれば上書きしない
let overwrite = get(a:, 1, 1)
if overwrite || self.variables.is_setted == 0
let self.variables.input = a:char
let self.variables.is_setted = 1
endif
endfunction
2 0.000003 function! s:base.getpos()
return self.line.pos()
endfunction
2 0.000004 function! s:base.setpos(pos)
return self.line.set_pos(a:pos)
endfunction
2 0.000003 function! s:base.tap_keyinput(key)
let self.variables.tap_key = a:key
endfunction
2 0.000004 function! s:base.untap_keyinput(key)
if self.variables.tap_key == a:key
let self.variables.tap_key = ""
return 1
endif
endfunction
2 0.000004 function! s:base.get_tap_key()
return self.variables.tap_key
endfunction
2 0.000003 function! s:base.is_input(key, ...)
let prekey = get(a:, 1, "")
return self.get_tap_key() ==# prekey
\ && self.char() ==# a:key
" \ && self.char() == (prekey . a:key)
endfunction
2 0.000002 function! s:base.input_key()
return self.variables.input_key
endfunction
2 0.000004 function! s:base.set_prompt(prompt)
let self.variables.prompt = a:prompt
endfunction
2 0.000002 function! s:base.get_prompt()
return self.variables.prompt
endfunction
2 0.000004 function! s:base.set_suffix(str)
let self.variables.suffix = a:str
endfunction
2 0.000003 function! s:base.get_suffix()
return self.variables.suffix
endfunction
2 0.000003 function! s:base.insert(word, ...)
if a:0
call self.line.set(a:1)
endif
call self.line.input(a:word)
endfunction
2 0.000003 function! s:base.forward()
return self.line.forward()
endfunction
2 0.000002 function! s:base.backward()
return self.line.backward()
endfunction
2 0.000003 function! s:base.backward_word(...)
let pat = get(a:, 1, '\k\+\s*\|.')
return matchstr(self.backward(), '\%(' . pat . '\)$')
endfunction
2 0.000003 function! s:base.connect(module, ...)
if type(a:module) == type("")
return call(self.connect, [s:Module.make(a:module)] + a:000, self)
endif
if empty(a:module)
return
endif
let name = a:0 > 0 ? a:1 : a:module.name
let slot = self.variables.modules.find_first_by("get(v:val.slot, 'name', '') == " . string(name))
if empty(slot)
call self.variables.modules.connect({ "name" : name, "module" : a:module })
else
let slot.slot.module = a:module
endif
" let self.variables.modules[name] = a:module
endfunction
2 0.000004 function! s:base.disconnect(name)
return self.variables.modules.disconnect_by(
\ "get(v:val.slot, 'name', '') == " . string(a:name)
\ )
" unlet self.variables.modules[a:name]
endfunction
2 0.000004 function! s:base.get_module(name)
let slot = self.variables.modules.find_first_by("get(v:val.slot, 'name', '') == " . string(a:name))
return empty(slot) ? {} : slot.slot.module
endfunction
2 0.000003 function! s:base.callevent(event)
call self.variables.modules.sort_by("has_key(v:val.slot.module, 'priority') ? v:val.slot.module.priority('" . a:event . "') : 0")
return self.variables.modules.call(a:event, [self])
" call map(filter(copy(self.variables.modules), "has_key(v:val, a:event)"), "v:val." . a:event . "(self)")
endfunction
2 0.000004 function! s:base.cmap(lhs, rhs)
let self.variables.keymapping[a:lhs] = a:rhs
endfunction
2 0.000004 function! s:base.cnoremap(lhs, rhs)
let key = s:Keymapping.as_key_config(a:rhs)
let key.noremap = 1
let self.variables.keymapping[a:lhs] = key
endfunction
2 0.000003 function! s:base.cunmap(lhs)
unlet self.variables.keymapping[a:lhs]
endfunction
2 0.000003 function! s:base.keymapping()
return self.__keymapping__()
endfunction
2 0.000003 function! s:base.__keymapping__()
return {}
endfunction
2 0.000003 function! s:base.execute(...)
let command = get(a:, 1, self.getline())
call self.__execute(command)
endfunction
2 0.000002 function! s:base.draw()
call self.callevent("on_draw_pre")
call self.callevent("on_draw")
endfunction
2 0.000003 function! s:base.exit(...)
let self.variables.exit = 1
let self.variables.exit_code = get(a:, 1, 0)
endfunction
2 0.000003 function! s:base.enable_keymapping()
let self.variables.enable_keymapping = 1
endfunction
2 0.000004 function! s:base.disable_keymapping()
let self.variables.enable_keymapping = 0
endfunction
2 0.000003 function! s:base.is_enable_keymapping()
return self.variables.enable_keymapping
endfunction
" function! s:base.cancel()
" call self.exit(1)
" call self.__on_cancel()
" endfunction
2 0.000002 function! s:base.exit_code()
return self.variables.exit_code
endfunction
2 0.000003 function! s:base.hl_cursor_on()
if exists("self.variables.old_guicursor")
set guicursor&
let &guicursor = self.variables.old_guicursor
unlet self.variables.old_guicursor
endif
if exists("self.variables.old_t_ve")
let &t_ve = self.variables.old_t_ve
unlet self.variables.old_t_ve
endif
endfunction
2 0.000002 function! s:base.hl_cursor_off()
if exists("self.variables.old_t_ve")
return
endif
let self.variables.old_guicursor = &guicursor
set guicursor=n:block-NONE
let self.variables.old_t_ve = &t_ve
set t_ve=
endfunction
2 0.000003 function! s:base.start(...)
let exit_code = call(self.__main, a:000, self)
return exit_code
endfunction
2 0.000003 function! s:base.__empty(...)
endfunction
2 0.000003 function! s:base.get(...)
let Old_execute = self.execute
let self.execute = self.__empty
try
let exit_code = call(self.start, a:000, self)
if exit_code == 0
return self.getline()
endif
finally
let self.execute = Old_execute
endtry
return ""
endfunction
2 0.000004 function! s:base.input_key_stack()
return self.variables.input_key_stack
endfunction
2 0.000003 function! s:base.input_key_stack_string()
return join(self.variables.input_key_stack, "")
endfunction
2 0.000003 function! s:base.set_input_key_stack(stack)
let self.variables.input_key_stack = a:stack
return self.variables.input_key_stack
endfunction
2 0.000006 function! s:base.input_key_stack_pop()
return remove(self.input_key_stack(), 0)
endfunction
2 0.000003 function! s:base.getchar(...)
if empty(self.input_key_stack())
return call(s:Input.getchar, a:000, s:Input)
endif
return self.input_key_stack_pop()
endfunction
2 0.000004 function! s:base.__init_variables()
let self.variables.tap_key = ""
let self.variables.char = ""
let self.variables.input = ""
let self.variables.exit = 0
let self.variables.exit_code = 1
let self.variables.enable_keymapping = 1
let self.variables.input_key_stack = []
let self.line = deepcopy(s:String.make())
endfunction
2 0.000012 function! s:_is_valid_highlight(name)
let highlight = s:Highlight.get(a:name)
if empty(highlight)
return 0
endif
if has("gui_running")
\ && (has_key(highlight, "guifg") || has_key(highlight, "guibg"))
return 1
elseif (has_key(highlight, "ctermfg") || has_key(highlight, "ctermbg"))
return 1
endif
return 0
endfunction
2 0.000004 function! s:base.__init()
call self.__init_variables()
call self.hl_cursor_off()
if !hlexists(self.highlights.cursor)
if s:_is_valid_highlight("Cursor")
execute "highlight link " . self.highlights.cursor . " Cursor"
else
" Workaround by CUI Vim Cursor Highlight
" issues #92
" https://github.com/osyo-manga/vital-over/issues/92
execute "highlight " . self.highlights.cursor . " term=reverse cterm=reverse gui=reverse"
endif
endif
if !hlexists(self.highlights.cursor_on)
execute "highlight link " . self.highlights.cursor_on . " " . self.highlights.cursor
endif
if !hlexists(self.highlights.cursor_insert)
execute "highlight " . self.highlights.cursor_insert . " cterm=underline term=underline gui=underline"
endif
endfunction
2 0.000004 function! s:base.__execute(command)
call self.callevent("on_execute_pre")
try
call self.__execute__(a:command)
catch
echohl ErrorMsg
echom matchstr(v:exception, 'Vim\((\w*)\)\?:\zs.*\ze')
echohl None
call self.callevent("on_execute_failed")
finally
call self.callevent("on_execute")
endtry
endfunction
2 0.000003 function! s:base.__execute__(cmd)
execute a:cmd
endfunction
2 0.000003 function! s:base.__input_char(char)
let char = a:char
let self.variables.input_key = char
let self.variables.char = char
call self.setchar(self.variables.char)
let self.variables.is_setted = 0
call self.callevent("on_char_pre")
call self.insert(self.variables.input)
call self.callevent("on_char")
endfunction
2 0.000003 function! s:base.__input(input, ...)
if a:input == ""
return
endif
let self.variables.input_key = a:input
if a:0 == 0
let keymapping = self.__get_keymapping()
else
let keymapping = a:1
endif
if self.is_enable_keymapping()
let key = s:Keymapping.unmapping(keymapping, a:input)
else
let key = a:input
endif
if key == ""
return
endif
call self.set_input_key_stack(s:String.split_by_keys(key))
while !(empty(self.input_key_stack()) || self.is_exit())
call self.__input_char(self.input_key_stack_pop())
endwhile
endfunction
2 0.000004 function! s:is_input_waiting(keymapping, input)
let num = len(filter(copy(a:keymapping), 'stridx(v:key, a:input) == 0'))
return num > 1 || (num == 1 && !has_key(a:keymapping, a:input))
endfunction
2 0.000004 function! s:base.__inputting()
if !self.is_enable_keymapping()
return self.__input(s:Input.getchar())
endif
let input = s:Input.getchar()
let old_line = self.getline()
let old_pos = self.getpos()
let keymapping = self.__get_keymapping()
try
let t = reltime()
while s:is_input_waiting(keymapping, input)
\ && str2nr(reltimestr(reltime(t))) * 1000 < &timeoutlen
call self.setline(old_line)
call self.insert(input)
call self.setpos(old_pos)
call self.draw()
let input .= s:Input.getchar(0)
endwhile
finally
call self.setline(old_line)
call self.setpos(old_pos)
endtry
call self.__input(input, keymapping)
endfunction
2 0.000002 function! s:base.__update()
" call self.callevent("on_update")
" if !getchar(1)
" continue
" endif
"
" call self.__input(s:getchar(0))
" call self.draw()
call self.callevent("on_update")
call self.__inputting()
" call self.__input(s:Input.getchar())
if self.is_exit()
return -1
endif
call self.draw()
endfunction
2 0.000006 function! s:base.__main(...)
try
call self.__init()
call self.callevent("on_enter")
call self.__input(get(a:, 1, ""))
call self.draw()
while !self.is_exit()
try
if self.__update()
break
endif
catch
call self.callevent("on_exception")
endtry
endwhile
catch
echohl ErrorMsg | echom v:throwpoint . " " . v:exception | echohl None
let self.variables.exit_code = -1
finally
call self.__finish()
call self.callevent("on_leave")
endtry
return self.exit_code()
endfunction
2 0.000003 function! s:base.__finish()
call self.hl_cursor_on()
endfunction
2 0.000002 function! s:base.__is_exit()
return self.is_exit()
endfunction
2 0.000002 function! s:base.is_exit()
return self.variables.exit
endfunction
2 0.000002 function! s:base.__get_keymapping()
let result = {}
" for module in values(self.variables.modules)
for module in self.variables.modules.slots()
if has_key(module, "keymapping")
if module isnot self
call extend(result, module.keymapping(self))
endif
endif
endfor
return extend(extend(result, self.variables.keymapping), self.keymapping())
endfunction
2 0.000017 let &cpo = s:save_cpo
2 0.000005 unlet s:save_cpo
SCRIPT /home/x/.vim/plugged/incsearch.vim/autoload/vital/_incsearch/Over/String.vim
Sourced 2 times
Total time: 1507493888.700813
Self time: 1507493888.700611
count total (s) self (s)
" ___vital___
" NOTE: lines between '" ___vital___' is generated by :Vitalize.
" Do not mofidify the code nor insert new lines before '" ___vital___'
2 0.000008 if v:version > 703 || v:version == 703 && has('patch1170')
2 0.000056 function! vital#_incsearch#Over#String#import() abort
return map({'_vital_depends': '', 'length': '', 'index': '', 'split_by_keys': '', 'make': '', '_vital_loaded': ''}, 'function("s:" . v:key)')
endfunction
2 0.000002 else
function! s:_SID() abort
return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze__SID$')
endfunction
execute join(['function! vital#_incsearch#Over#String#import() abort', printf("return map({'_vital_depends': '', 'length': '', 'index': '', 'split_by_keys': '', 'make': '', '_vital_loaded': ''}, \"function('<SNR>%s_' . v:key)\")", s:_SID()), 'endfunction'], "\n")
delfunction s:_SID
endif
" ___vital___
2 0.000002 scriptencoding utf-8
2 0.000022 let s:save_cpo = &cpo
2 0.000015 set cpo&vim
2 0.000004 function! s:_vital_loaded(V)
let s:V = a:V
let s:List = s:V.import("Data.List")
endfunction
2 0.000004 function! s:_vital_depends()
return [
\ "Data.List",
\ ]
endfunction
2 0.000005 function! s:_clamp(x, max, min)
return min([max([a:x, a:max]), a:min])
endfunction
2 0.000011 let s:base = {}
2 0.000004 function! s:base.set(item)
return type(a:item) == type("") ? self.set_str(a:item)
\ : type(a:item) == type(0) ? self.set_pos(a:item)
\ : self
endfunction
2 0.000004 function! s:base.str()
return join(self.list, "")
endfunction
2 0.000004 function! s:base.set_pos(pos)
let self.col = s:_clamp(a:pos, 0, self.length())
return self
endfunction
2 0.000004 function! s:base.backward()
return self.col > 0 ? join(self.list[ : self.col-1], '') : ""
endfunction
2 0.000002 function! s:base.forward()
return join(self.list[self.col+1 : ], '')
endfunction
2 0.000003 function! s:base.pos_char()
return get(self.list, self.col, "")
endfunction
2 0.000004 function! s:base.set_str(str)
let self.list = split(a:str, '\zs')
let self.col = strchars(a:str)
return self
endfunction
2 0.000003 function! s:base.pos()
return self.col
endfunction
2 0.000004 function! s:base.input(str)
call extend(self.list, split(a:str, '\zs'), self.col)
let self.col += len(split(a:str, '\zs'))
return self
endfunction
2 0.000002 function! s:base.length()
return len(self.list)
endfunction
2 0.000003 function! s:base.next()
return self.set_pos(self.col + 1)
endfunction
2 0.000003 function! s:base.prev()
return self.set_pos(self.col - 1)
endfunction
2 0.000004 function! s:base.remove(index)
if a:index < 0 || self.length() <= a:index
return ""
endif
let result = self.list[a:index]
unlet self.list[a:index]
if a:index < self.col
call self.set(self.col - 1)
endif
return result
endfunction
2 0.000007 function! s:base.remove_pos()
return self.remove(self.col)
endfunction
2 0.000003 function! s:base.remove_prev()
return self.remove(self.col - 1)
endfunction
2 0.000004 function! s:base.remove_next()
return self.remove(self.col + 1)
endfunction
2 0.000004 function! s:make(...)
let default = get(a:, 1, "")
let result = deepcopy(s:base)
call result.set(default)
return result
endfunction
" NOTE: old regexpengine has a bug with string which contains binary
" :echo "\x80" =~ "\\%#=1\x80" | " => 0
" But it matches correctly with :h /collection
" :echo "\x80" =~ "\\%#=1[\x80]" | " => 1
" http://lingr.com/room/vim/archives/2015/02/13#message-21261450
2 0.000009 let s:_engine = exists("+regexpengine") ? '\%#=2' : ''
" \<A-]> => Û\xfdQ
" \<A-@> => À\xfeX
2 0.000012 let s:_regex = exists("+regexpengine")
\ ? "\\%(Û\xfdQ\\|À\xfeX\\|\x80\xfc.\\%(\x80..\\|.\\)\\|\x80..\\|.\\)\\zs"
\ : "\\%(Û[\xfd]Q\\|À[\xfe]X\\|[\x80][\xfc].\\%([\x80]..\\|.\\)\\|[\x80]..\\|.\\)\\zs"
2 0.000005 function! s:_split_keystring(str, ...)
return split(a:str, s:_engine . '\m\%(' . get(a:, 1, '') . s:_regex . '\)')
endfunction
2 0.000004 function! s:split_by_keys(str)
return s:_split_keystring(a:str, "\\%(\<Plug>\\|<Over>\\)(.\\{-})\\zs\\|")
endfunction
2 0.000004 function! s:index(haystack, needle, ...)
let start = get(a:, 1, 0)
let ignorecase = get(a:, 2, &ignorecase)
if ignorecase
return stridx(tolower(a:haystack), tolower(a:needle), start)
else
return stridx(a:haystack, a:needle, start)
endif
endfunction
2 0.000004 function! s:length(str)
return len(s:split_by_keys(a:str))
endfunction
2 0.000018 let &cpo = s:save_cpo
2 0.000005 unlet s:save_cpo
SCRIPT /home/x/.vim/plugged/incsearch.vim/autoload/vital/_incsearch/Data/List.vim
Sourced 2 times
Total time: 1507493888.701943
Self time: 1507493888.701521
count total (s) self (s)
" ___vital___
" NOTE: lines between '" ___vital___' is generated by :Vitalize.
" Do not mofidify the code nor insert new lines before '" ___vital___'
2 0.000012 if v:version > 703 || v:version == 703 && has('patch1170')
2 0.000054 function! vital#_incsearch#Data#List#import() abort
return map({'combinations': '', 'and': '', 'sort_by': '', 'foldr1': '', 'sort': '', 'flatten': '', 'has_index': '', 'find_indices': '', 'any': '', 'unshift': '', 'span': '', 'pop': '', 'binary_search': '', 'uniq_by': '', 'or': '', 'all': '', 'zip': '', 'find_last_index': '', 'find': '', 'partition': '', 'map_accum': '', 'permutations': '', 'break': '', 'max_by': '', 'foldl': '', 'foldr': '', 'find_index': '', 'group_by': '', 'take_while': '', 'conj': '', 'push': '', 'char_range': '', 'cons': '', 'foldl1': '', 'intersect': '', 'concat': '', 'shift': '', 'clear': '', 'has_common_items': '', 'product': '', 'zip_fill': '', 'uniq': '', 'has': '', 'min_by': '', 'with_index': ''}, 'function("s:" . v:key)')
endfunction
2 0.000002 else
function! s:_SID() abort
return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze__SID$')
endfunction
execute join(['function! vital#_incsearch#Data#List#import() abort', printf("return map({'combinations': '', 'and': '', 'sort_by': '', 'foldr1': '', 'sort': '', 'flatten': '', 'has_index': '', 'find_indices': '', 'any': '', 'unshift': '', 'span': '', 'pop': '', 'binary_search': '', 'uniq_by': '', 'or': '', 'all': '', 'zip': '', 'find_last_index': '', 'find': '', 'partition': '', 'map_accum': '', 'permutations': '', 'break': '', 'max_by': '', 'foldl': '', 'foldr': '', 'find_index': '', 'group_by': '', 'take_while': '', 'conj': '', 'push': '', 'char_range': '', 'cons': '', 'foldl1': '', 'intersect': '', 'concat': '', 'shift': '', 'clear': '', 'has_common_items': '', 'product': '', 'zip_fill': '', 'uniq': '', 'has': '', 'min_by': '', 'with_index': ''}, \"function('<SNR>%s_' . v:key)\")", s:_SID()), 'endfunction'], "\n")
delfunction s:_SID
endif
" ___vital___
" Utilities for list.
2 0.000018 let s:save_cpo = &cpo
2 0.000015 set cpo&vim
2 0.000004 function! s:pop(list) abort
return remove(a:list, -1)
endfunction
2 0.000004 function! s:push(list, val) abort
call add(a:list, a:val)
return a:list
endfunction
2 0.000004 function! s:shift(list) abort
return remove(a:list, 0)
endfunction
2 0.000004 function! s:unshift(list, val) abort
return insert(a:list, a:val)
endfunction
2 0.000004 function! s:cons(x, xs) abort
return [a:x] + a:xs
endfunction
2 0.000004 function! s:conj(xs, x) abort
return a:xs + [a:x]
endfunction
" Removes duplicates from a list.
2 0.000004 function! s:uniq(list) abort
return s:uniq_by(a:list, 'v:val')
endfunction
" Removes duplicates from a list.
2 0.000004 function! s:uniq_by(list, f) abort
let list = map(copy(a:list), printf('[v:val, %s]', a:f))
let i = 0
let seen = {}
while i < len(list)
let key = string(list[i][1])
if has_key(seen, key)
call remove(list, i)
else
let seen[key] = 1
let i += 1
endif
endwhile
return map(list, 'v:val[0]')
endfunction
2 0.000004 function! s:clear(list) abort
if !empty(a:list)
unlet! a:list[0 : len(a:list) - 1]
endif
return a:list
endfunction
" Concatenates a list of lists.
" XXX: Should we verify the input?
2 0.000003 function! s:concat(list) abort
let memo = []
for Value in a:list
let memo += Value
endfor
return memo
endfunction
" Take each elements from lists to a new list.
2 0.000004 function! s:flatten(list, ...) abort
let limit = a:0 > 0 ? a:1 : -1
let memo = []
if limit == 0
return a:list
endif
let limit -= 1
for Value in a:list
let memo +=
\ type(Value) == type([]) ?
\ s:flatten(Value, limit) :
\ [Value]
unlet! Value
endfor
return memo
endfunction
" Sorts a list with expression to compare each two values.
" a:a and a:b can be used in {expr}.
2 0.000005 function! s:sort(list, expr) abort
if type(a:expr) == type(function('function'))
return sort(a:list, a:expr)
endif
let s:expr = a:expr
return sort(a:list, 's:_compare')
endfunction
2 0.000004 function! s:_compare(a, b) abort
return eval(s:expr)
endfunction
" Sorts a list using a set of keys generated by mapping the values in the list
" through the given expr.
" v:val is used in {expr}
2 0.000004 function! s:sort_by(list, expr) abort
let pairs = map(a:list, printf('[v:val, %s]', a:expr))
return map(s:sort(pairs,
\ 'a:a[1] ==# a:b[1] ? 0 : a:a[1] ># a:b[1] ? 1 : -1'), 'v:val[0]')
endfunction
" Returns a maximum value in {list} through given {expr}.
" Returns 0 if {list} is empty.
" v:val is used in {expr}
2 0.000003 function! s:max_by(list, expr) abort
if empty(a:list)
return 0
endif
let list = map(copy(a:list), a:expr)
return a:list[index(list, max(list))]
endfunction
" Returns a minimum value in {list} through given {expr}.
" Returns 0 if {list} is empty.
" v:val is used in {expr}
" FIXME: -0x80000000 == 0x80000000
2 0.000004 function! s:min_by(list, expr) abort
return s:max_by(a:list, '-(' . a:expr . ')')
endfunction
" Returns List of character sequence between [a:from, a:to]
" e.g.: s:char_range('a', 'c') returns ['a', 'b', 'c']
2 0.000005 function! s:char_range(from, to) abort
return map(
\ range(char2nr(a:from), char2nr(a:to)),
\ 'nr2char(v:val)'
\)
endfunction
" Returns true if a:list has a:value.
" Returns false otherwise.
2 0.000004 function! s:has(list, value) abort
return index(a:list, a:value) isnot -1
endfunction
" Returns true if a:list[a:index] exists.
" Returns false otherwise.
" NOTE: Returns false when a:index is negative number.
2 0.000004 function! s:has_index(list, index) abort
" Return true when negative index?
" let index = a:index >= 0 ? a:index : len(a:list) + a:index
return 0 <= a:index && a:index < len(a:list)
endfunction
" similar to Haskell's Data.List.span
2 0.000003 function! s:span(f, xs) abort
let border = len(a:xs)
for i in range(len(a:xs))
if !eval(substitute(a:f, 'v:val', string(a:xs[i]), 'g'))
let border = i
break
endif
endfor
return border == 0 ? [[], copy(a:xs)] : [a:xs[: border - 1], a:xs[border :]]
endfunction
" similar to Haskell's Data.List.break
2 0.000004 function! s:break(f, xs) abort
return s:span(printf('!(%s)', a:f), a:xs)
endfunction
" similar to Haskell's Data.List.takeWhile
2 0.000004 function! s:take_while(f, xs) abort
return s:span(a:f, a:xs)[0]
endfunction
" similar to Haskell's Data.List.partition
2 0.000005 function! s:partition(f, xs) abort
return [filter(copy(a:xs), a:f), filter(copy(a:xs), '!(' . a:f . ')')]
endfunction
" similar to Haskell's Prelude.all
2 0.000004 function! s:all(f, xs) abort
return !s:any(printf('!(%s)', a:f), a:xs)
endfunction
" similar to Haskell's Prelude.any
2 0.000004 function! s:any(f, xs) abort
return !empty(filter(map(copy(a:xs), a:f), 'v:val'))
endfunction
" similar to Haskell's Prelude.and
2 0.000004 function! s:and(xs) abort
return s:all('v:val', a:xs)
endfunction
" similar to Haskell's Prelude.or
2 0.000004 function! s:or(xs) abort
return s:any('v:val', a:xs)
endfunction
2 0.000005 function! s:map_accum(expr, xs, init) abort
let memo = []
let init = a:init
for x in a:xs
let expr = substitute(a:expr, 'v:memo', init, 'g')
let expr = substitute(expr, 'v:val', x, 'g')
let [tmp, init] = eval(expr)
call add(memo, tmp)
endfor
return memo
endfunction
" similar to Haskell's Prelude.foldl
2 0.000004 function! s:foldl(f, init, xs) abort
let memo = a:init
for x in a:xs
let expr = substitute(a:f, 'v:val', string(x), 'g')
let expr = substitute(expr, 'v:memo', string(memo), 'g')
unlet memo
let memo = eval(expr)
endfor
return memo
endfunction
" similar to Haskell's Prelude.foldl1
2 0.000004 function! s:foldl1(f, xs) abort
if len(a:xs) == 0
throw 'vital: Data.List: foldl1'
endif
return s:foldl(a:f, a:xs[0], a:xs[1:])
endfunction
" similar to Haskell's Prelude.foldr
2 0.000005 function! s:foldr(f, init, xs) abort
return s:foldl(a:f, a:init, reverse(copy(a:xs)))
endfunction
" similar to Haskell's Prelude.fold11
2 0.000006 function! s:foldr1(f, xs) abort
if len(a:xs) == 0
throw 'vital: Data.List: foldr1'
endif
return s:foldr(a:f, a:xs[-1], a:xs[0:-2])
endfunction
" similar to python's zip()
2 0.000004 function! s:zip(...) abort
return map(range(min(map(copy(a:000), 'len(v:val)'))), "map(copy(a:000), 'v:val['.v:val.']')")
endfunction
" similar to zip(), but goes until the longer one.
2 0.000006 function! s:zip_fill(xs, ys, filler) abort
if empty(a:xs) && empty(a:ys)
return []
elseif empty(a:ys)
return s:cons([a:xs[0], a:filler], s:zip_fill(a:xs[1 :], [], a:filler))
elseif empty(a:xs)
return s:cons([a:filler, a:ys[0]], s:zip_fill([], a:ys[1 :], a:filler))
else
return s:cons([a:xs[0], a:ys[0]], s:zip_fill(a:xs[1 :], a:ys[1: ], a:filler))
endif
endfunction
" Inspired by Ruby's with_index method.
2 0.000004 function! s:with_index(list, ...) abort
let base = a:0 > 0 ? a:1 : 0
return map(copy(a:list), '[v:val, v:key + base]')
endfunction
" similar to Ruby's detect or Haskell's find.
2 0.000004 function! s:find(list, default, f) abort
for x in a:list
if eval(substitute(a:f, 'v:val', string(x), 'g'))
return x
endif
endfor
return a:default
endfunction
" Returns the index of the first element which satisfies the given expr.
2 0.000004 function! s:find_index(xs, f, ...) abort
let len = len(a:xs)
let start = a:0 > 0 ? (a:1 < 0 ? len + a:1 : a:1) : 0
let default = a:0 > 1 ? a:2 : -1
if start >=# len || start < 0
return default
endif
for i in range(start, len - 1)
if eval(substitute(a:f, 'v:val', string(a:xs[i]), 'g'))
return i
endif
endfor
return default
endfunction
" Returns the index of the last element which satisfies the given expr.
2 0.000005 function! s:find_last_index(xs, f, ...) abort
let len = len(a:xs)
let start = a:0 > 0 ? (a:1 < 0 ? len + a:1 : a:1) : len - 1
let default = a:0 > 1 ? a:2 : -1
if start >=# len || start < 0
return default
endif
for i in range(start, 0, -1)
if eval(substitute(a:f, 'v:val', string(a:xs[i]), 'g'))
return i
endif
endfor
return default
endfunction
" Similar to find_index but returns the list of indices satisfying the given expr.
2 0.000005 function! s:find_indices(xs, f, ...) abort
let len = len(a:xs)
let start = a:0 > 0 ? (a:1 < 0 ? len + a:1 : a:1) : 0
let result = []
if start >=# len || start < 0
return result
endif
for i in range(start, len - 1)
if eval(substitute(a:f, 'v:val', string(a:xs[i]), 'g'))
call add(result, i)
endif
endfor
return result
endfunction
" Return non-zero if a:list1 and a:list2 have any common item(s).
" Return zero otherwise.
2 0.000005 function! s:has_common_items(list1, list2) abort
return !empty(filter(copy(a:list1), 'index(a:list2, v:val) isnot -1'))
endfunction
2 0.000003 function! s:intersect(list1, list2) abort
let items = []
" for funcref
for X in a:list1
if index(a:list2, X) != -1 && index(items, X) == -1
let items += [X]
endif
endfor
return items
endfunction
" similar to Ruby's group_by.
2 0.000004 function! s:group_by(xs, f) abort
let result = {}
let list = map(copy(a:xs), printf('[v:val, %s]', a:f))
for x in list
let Val = x[0]
let key = type(x[1]) !=# type('') ? string(x[1]) : x[1]
if has_key(result, key)
call add(result[key], Val)
else
let result[key] = [Val]
endif
unlet Val
endfor
return result
endfunction
2 0.000005 function! s:_default_compare(a, b) abort
return a:a <# a:b ? -1 : a:a ># a:b ? 1 : 0
endfunction
2 0.000004 function! s:binary_search(list, value, ...) abort
let Predicate = a:0 >= 1 ? a:1 : 's:_default_compare'
let dic = a:0 >= 2 ? a:2 : {}
let start = 0
let end = len(a:list) - 1
while 1
if start > end
return -1
endif
let middle = (start + end) / 2
let compared = call(Predicate, [a:value, a:list[middle]], dic)
if compared < 0
let end = middle - 1
elseif compared > 0
let start = middle + 1
else
return middle
endif
endwhile
endfunction
2 0.000004 function! s:product(lists) abort
let result = [[]]
for pool in a:lists
let tmp = []
for x in result
let tmp += map(copy(pool), 'x + [v:val]')
endfor
let result = tmp
endfor
return result
endfunction
2 0.000004 function! s:permutations(list, ...) abort
if a:0 > 1
throw 'vital: Data.List: too many arguments'
endif
let r = a:0 == 1 ? a:1 : len(a:list)
if r > len(a:list)
return []
elseif r < 0
throw 'vital: Data.List: {r} must be non-negative integer'
endif
let n = len(a:list)
let result = []
for indices in s:product(map(range(r), 'range(n)'))
if len(s:uniq(indices)) == r
call add(result, map(indices, 'a:list[v:val]'))
endif
endfor
return result
endfunction
2 0.000005 function! s:combinations(list, r) abort
if a:r > len(a:list)
return []
elseif a:r < 0
throw 'vital: Data:List: {r} must be non-negative integer'
endif
let n = len(a:list)
let result = []
for indices in s:permutations(range(n), a:r)
if s:sort(copy(indices), 'a:a - a:b') == indices
call add(result, map(indices, 'a:list[v:val]'))
endif
endfor
return result
endfunction
2 0.000020 let &cpo = s:save_cpo
2 0.000004 unlet s:save_cpo
" vim:set et ts=2 sts=2 sw=2 tw=0:
SCRIPT /home/x/.vim/plugged/incsearch.vim/autoload/vital/_incsearch/Over/Signals.vim
Sourced 2 times
Total time: 1507493888.702842
Self time: 1507493888.702696
count total (s) self (s)
" ___vital___
" NOTE: lines between '" ___vital___' is generated by :Vitalize.
" Do not mofidify the code nor insert new lines before '" ___vital___'
2 0.000007 if v:version > 703 || v:version == 703 && has('patch1170')
2 0.000054 function! vital#_incsearch#Over#Signals#import() abort
return map({'_vital_depends': '', 'call': '', 'make': '', '_vital_loaded': ''}, 'function("s:" . v:key)')
endfunction
2 0.000002 else
function! s:_SID() abort
return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze__SID$')
endfunction
execute join(['function! vital#_incsearch#Over#Signals#import() abort', printf("return map({'_vital_depends': '', 'call': '', 'make': '', '_vital_loaded': ''}, \"function('<SNR>%s_' . v:key)\")", s:_SID()), 'endfunction'], "\n")
delfunction s:_SID
endif
" ___vital___
2 0.000004 scriptencoding utf-8
2 0.000021 let s:save_cpo = &cpo
2 0.000014 set cpo&vim
2 0.000005 function! s:_vital_loaded(V)
let s:V = a:V
let s:L = s:V.import("Data.List")
endfunction
2 0.000004 function! s:_vital_depends()
return ["Data.List"]
endfunction
2 0.000015 let s:base = {
\ "variables" : {
\ "slots" : [],
\ "counter" : 0,
\ }
\}
2 0.000003 function! s:base.connect(slot)
let self.variables.counter += 1
let slot = { "id" : self.variables.counter, "slot" : a:slot }
call add(self.variables.slots, slot)
return slot
endfunction
2 0.000003 function! s:base.disconnect(slot)
if empty(a:slot)
return -1
endif
for i in range(len(self.variables.slots))
if self.variables.slots[i].id == a:slot.id
unlet self.variables.slots[i]
return
endif
endfor
return -1
endfunction
2 0.000004 function! s:base.disconnect_by(expr)
return self.disconnect(self.find_first_by(a:expr))
endfunction
2 0.000004 function! s:call(list, func, ...)
let args = get(a:, 1, [])
let def = get(a:, 2, 0)
return map(copy(a:list), "has_key(v:val, a:func) ? call(v:val.".a:func.", args, v:val) : def")
endfunction
2 0.000004 function! s:base.call(func, ...)
return call("s:call", [self.slots(), a:func] + a:000)
endfunction
2 0.000003 function! s:base.find_by(expr)
return filter(copy(self.variables.slots), a:expr)
endfunction
2 0.000004 function! s:base.find_first_by(expr)
return get(self.find_by(a:expr), 0, {})
endfunction
2 0.000004 function! s:base.sort_by(expr)
let self.variables.slots = s:L.sort_by(self.variables.slots, a:expr)
endfunction
2 0.000003 function! s:base.get_slot(val)
return a:val.slot
endfunction
2 0.000003 function! s:base.slots()
return map(copy(self.variables.slots), "self.get_slot(v:val)")
endfunction
" function! s:base.dict()
" let result = {}
" for _ in self.variables.slots
" let result[_.id] = _.value
" endfor
" return result
" endfunction
2 0.000003 function! s:make()
let result = deepcopy(s:base)
return result
endfunction
2 0.000020 let &cpo = s:save_cpo
2 0.000004 unlet s:save_cpo
SCRIPT /home/x/.vim/plugged/incsearch.vim/autoload/vital/_incsearch/Over/Input.vim
Sourced 2 times
Total time: 1507493888.703416
Self time: 1507493888.703349
count total (s) self (s)
" ___vital___
" NOTE: lines between '" ___vital___' is generated by :Vitalize.
" Do not mofidify the code nor insert new lines before '" ___vital___'
2 0.000006 if v:version > 703 || v:version == 703 && has('patch1170')
2 0.000057 function! vital#_incsearch#Over#Input#import() abort
return map({'getchar': ''}, 'function("s:" . v:key)')
endfunction
2 0.000002 else
function! s:_SID() abort
return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze__SID$')
endfunction
execute join(['function! vital#_incsearch#Over#Input#import() abort', printf("return map({'getchar': ''}, \"function('<SNR>%s_' . v:key)\")", s:_SID()), 'endfunction'], "\n")
delfunction s:_SID
endif
" ___vital___
2 0.000004 scriptencoding utf-8
2 0.000013 let s:save_cpo = &cpo
2 0.000015 set cpo&vim
2 0.000004 function! s:getchar(...)
let mode = get(a:, 1, 0)
while 1
" Workaround for https://github.com/osyo-manga/vital-over/issues/53
try
let char = call("getchar", a:000)
catch /^Vim:Interrupt$/
let char = 3 " <C-c>
endtry
" Workaround for the <expr> mappings
if string(char) !=# "\x80\xfd`"
return mode == 1 ? !!char
\ : type(char) == type(0) ? nr2char(char) : char
endif
endwhile
endfunction
2 0.000016 let &cpo = s:save_cpo
2 0.000004 unlet s:save_cpo
SCRIPT /home/x/.vim/plugged/incsearch.vim/autoload/vital/_incsearch/Over/Keymapping.vim
Sourced 2 times
Total time: 1507493888.703944
Self time: 1507493888.703828
count total (s) self (s)
" ___vital___
" NOTE: lines between '" ___vital___' is generated by :Vitalize.
" Do not mofidify the code nor insert new lines before '" ___vital___'
2 0.000006 if v:version > 703 || v:version == 703 && has('patch1170')
2 0.000052 function! vital#_incsearch#Over#Keymapping#import() abort
return map({'_vital_depends': '', 'unmapping': '', 'as_key_config': '', 'match_key': '', '_vital_loaded': ''}, 'function("s:" . v:key)')
endfunction
2 0.000002 else
function! s:_SID() abort
return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze__SID$')
endfunction
execute join(['function! vital#_incsearch#Over#Keymapping#import() abort', printf("return map({'_vital_depends': '', 'unmapping': '', 'as_key_config': '', 'match_key': '', '_vital_loaded': ''}, \"function('<SNR>%s_' . v:key)\")", s:_SID()), 'endfunction'], "\n")
delfunction s:_SID
endif
" ___vital___
2 0.000002 scriptencoding utf-8
2 0.000022 let s:save_cpo = &cpo
2 0.000015 set cpo&vim
2 0.000006 function! s:_vital_loaded(V)
let s:V = a:V
let s:String = s:V.import("Over.String")
endfunction
2 0.000004 function! s:_vital_depends()
return [
\ "Over.String",
\ ]
endfunction
2 0.000004 function! s:as_key_config(config)
let base = {
\ "noremap" : 0,
\ "lock" : 0,
\ "expr" : 0,
\ }
return type(a:config) == type({}) ? extend(base, a:config)
\ : extend(base, {
\ "key" : a:config,
\ })
endfunction
2 0.000004 function! s:match_key(keymapping, key)
let keys = sort(keys(a:keymapping))
return get(filter(keys, 'stridx(a:key, v:val) == 0'), -1, '')
endfunction
2 0.000004 function! s:_safe_eval(expr, ...)
call extend(l:, get(a:, 1, {}))
let result = get(a:, 2, "")
try
let result = eval(a:expr)
catch
echohl ErrorMsg | echom v:exception | echohl None
endtry
return result
endfunction
2 0.000004 function! s:_get_key(conf)
" call extend(l:, a:conf)
let self = a:conf
return get(a:conf, "expr", 0) ? s:_safe_eval(a:conf.key, l:) : a:conf.key
endfunction
2 0.000004 function! s:unmapping(keymapping, key, ...)
let is_locking = get(a:, 1, 0)
let key = s:match_key(a:keymapping, a:key)
if key == ""
return s:String.length(a:key) <= 1 ? a:key : s:unmapping(a:keymapping, a:key[0], is_locking) . s:unmapping(a:keymapping, a:key[1:], is_locking)
endif
let map_conf = s:as_key_config(a:keymapping[key])
let next_input = s:unmapping(a:keymapping, a:key[len(key) : ], is_locking)
if map_conf.lock == 0 && is_locking
return key . next_input
elseif map_conf.lock
return s:unmapping(a:keymapping, s:_get_key(map_conf), is_locking) . next_input
else
return s:unmapping(a:keymapping, s:_get_key(map_conf), map_conf.noremap) . next_input
endif
endfunction
2 0.000020 let &cpo = s:save_cpo
2 0.000006 unlet s:save_cpo
SCRIPT /home/x/.vim/plugged/incsearch.vim/autoload/vital/_incsearch/Over/Commandline/Modules.vim
Sourced 2 times
Total time: 1507493888.704532
Self time: 1507493888.704454
count total (s) self (s)
" ___vital___
" NOTE: lines between '" ___vital___' is generated by :Vitalize.
" Do not mofidify the code nor insert new lines before '" ___vital___'
2 0.000011 if v:version > 703 || v:version == 703 && has('patch1170')
2 0.000062 function! vital#_incsearch#Over#Commandline#Modules#import() abort
return map({'get': '', 'make': '', '_vital_loaded': ''}, 'function("s:" . v:key)')
endfunction
2 0.000002 else
function! s:_SID() abort
return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze__SID$')
endfunction
execute join(['function! vital#_incsearch#Over#Commandline#Modules#import() abort', printf("return map({'get': '', 'make': '', '_vital_loaded': ''}, \"function('<SNR>%s_' . v:key)\")", s:_SID()), 'endfunction'], "\n")
delfunction s:_SID
endif
" ___vital___
2 0.000004 scriptencoding utf-8
2 0.000014 let s:save_cpo = &cpo
2 0.000015 set cpo&vim
2 0.000005 function! s:_vital_loaded(V)
let s:V = a:V
endfunction
2 0.000004 function! s:get(name)
if exists("s:" . a:name)
return s:{a:name}
endif
let s:{a:name} = s:V.import('Over.Commandline.Modules.' . a:name)
return s:{a:name}
endfunction
2 0.000004 function! s:make(name, ...)
let module = s:get(a:name)
return call(module.make, a:000, module)
endfunction
2 0.000017 let &cpo = s:save_cpo
2 0.000006 unlet s:save_cpo
SCRIPT /home/x/.vim/plugged/incsearch.vim/autoload/vital/_incsearch/Palette/Highlight.vim
Sourced 2 times
Total time: 1507493888.705232
Self time: 1507493888.705081
count total (s) self (s)
" ___vital___
" NOTE: lines between '" ___vital___' is generated by :Vitalize.
" Do not mofidify the code nor insert new lines before '" ___vital___'
2 0.000007 if v:version > 703 || v:version == 703 && has('patch1170')
2 0.000057 function! vital#_incsearch#Palette#Highlight#import() abort
return map({'capture': '', '_vital_depends': '', 'parse': '', 'group_list': '', 'set': '', 'parse_to_name': '', 'links_to': '', 'get': '', '_vital_loaded': ''}, 'function("s:" . v:key)')
endfunction
2 0.000003 else
function! s:_SID() abort
return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze__SID$')
endfunction
execute join(['function! vital#_incsearch#Palette#Highlight#import() abort', printf("return map({'capture': '', '_vital_depends': '', 'parse': '', 'group_list': '', 'set': '', 'parse_to_name': '', 'links_to': '', 'get': '', '_vital_loaded': ''}, \"function('<SNR>%s_' . v:key)\")", s:_SID()), 'endfunction'], "\n")
delfunction s:_SID
endif
" ___vital___
2 0.000004 scriptencoding utf-8
2 0.000023 let s:save_cpo = &cpo
2 0.000016 set cpo&vim
2 0.000005 function! s:_vital_loaded(V)
let s:V = a:V
let s:Message = s:V.import("Vim.Message")
endfunction
2 0.000004 function! s:_vital_depends()
return [
\ "Vim.Message",
\ ]
endfunction
2 0.000004 function! s:_execute(cmd)
execute a:cmd
endfunction
2 0.000004 function! s:capture(name)
if hlexists(a:name) == 0
return ""
endif
return s:Message.capture("highlight " . a:name)
endfunction
2 0.000004 function! s:links_to(highlight)
return matchstr(a:highlight, '^\S\+\s\+xxx links to \zs.*\ze$')
endfunction
2 0.000004 function! s:parse_to_name(highlight)
return matchstr(a:highlight, '^\zs\w\+\ze')
endfunction
2 0.000003 function! s:parse(highlight)
let highlight = a:highlight
if highlight !~# '^\w\+\s\+xxx\s'
return {}
endif
let name = s:parse_to_name(a:highlight)
let result = { "_name" : name }
if highlight =~# '^\w\+\s\+xxx cleared'
let result.cleared = 1
return result
endif
let link = s:links_to(highlight)
if link != ""
let result.link = link
return result
endif
let attrs = [
\ "term",
\ "cterm",
\ "ctermfg",
\ "ctermbg",
\ "gui",
\ "font",
\ "guifg",
\ "guibg",
\ "guisp",
\ ]
for attr in attrs
let item = matchstr(highlight, '\s' . attr . '=\zs#\?\w\+\ze')
if item != ""
let result[attr] = item
endif
endfor
return result
endfunction
2 0.000004 function! s:get(name, ...)
if !hlexists(a:name)
return {}
endif
let result = s:parse(substitute(s:capture(a:name), "\n", "", "g"))
if has_key(result, "link") && get(a:, 1, 0)
return s:get(result.link, get(a:, 1, 0))
else
return result
endif
endfunction
2 0.000004 function! s:set(name, config)
if type(a:config) == type("")
return s:set(a:config, s:get(a:config))
endif
if has_key(a:config, "cleared")
return s:_execute("highlight clear " . a:name)
endif
if has_key(a:config, "link")
return s:_execute("highlight link " . a:name . " " . a:config.link)
endif
return s:_execute("highlight " . a:name . " " . join(map(items(filter(a:config, "v:key !=# '_name'")), "v:val[0] . '=' . v:val[1]"), " "))
endfunction
2 0.000004 function! s:group_list()
let highlights = split(s:Message.capture("highlight"), "\n")
return filter(map(highlights, "s:parse_to_name(v:val)"), "v:val != ''")
endfunction
2 0.000017 let &cpo = s:save_cpo
2 0.000006 unlet s:save_cpo
SCRIPT /home/x/.vim/plugged/incsearch.vim/autoload/vital/_incsearch/Vim/Message.vim
Sourced 2 times
Total time: 1507493888.705809
Self time: 1507493888.705701
count total (s) self (s)
" ___vital___
" NOTE: lines between '" ___vital___' is generated by :Vitalize.
" Do not mofidify the code nor insert new lines before '" ___vital___'
2 0.000006 if v:version > 703 || v:version == 703 && has('patch1170')
2 0.000057 function! vital#_incsearch#Vim#Message#import() abort
return map({'capture': '', 'echomsg': '', 'echo': '', 'warn': '', 'get_hit_enter_max_length': '', 'error': ''}, 'function("s:" . v:key)')
endfunction
2 0.000002 else
function! s:_SID() abort
return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze__SID$')
endfunction
execute join(['function! vital#_incsearch#Vim#Message#import() abort', printf("return map({'capture': '', 'echomsg': '', 'echo': '', 'warn': '', 'get_hit_enter_max_length': '', 'error': ''}, \"function('<SNR>%s_' . v:key)\")", s:_SID()), 'endfunction'], "\n")
delfunction s:_SID
endif
" ___vital___
2 0.000022 let s:save_cpo = &cpo
2 0.000015 set cpo&vim
2 0.000004 function! s:echo(hl, msg) abort
execute 'echohl' a:hl
try
echo a:msg
finally
echohl None
endtry
endfunction
2 0.000004 function! s:echomsg(hl, msg) abort
execute 'echohl' a:hl
try
for m in split(a:msg, "\n")
echomsg m
endfor
finally
echohl None
endtry
endfunction
2 0.000004 function! s:error(msg) abort
call s:echomsg('ErrorMsg', a:msg)
endfunction
2 0.000004 function! s:warn(msg) abort
call s:echomsg('WarningMsg', a:msg)
endfunction
2 0.000004 function! s:capture(command) abort
try
redir => out
silent execute a:command
finally
redir END
endtry
return out
endfunction
" * Get max length of |hit-enter|.
" If a string length of a message is greater than the max length,
" Vim waits for user input according to |hit-enter|.
" XXX: Those fixed values may be different between different OSes?
" Currently tested on only Windows.
2 0.000005 function! s:get_hit_enter_max_length() abort
let maxlen = &columns * &cmdheight - 1
if &ruler
" TODO
endif
if &showcmd
let maxlen -= 11
endif
return maxlen
endfunction
2 0.000017 let &cpo = s:save_cpo
2 0.000004 unlet s:save_cpo
" vim:set et ts=2 sts=2 sw=2 tw=0:
SCRIPT /home/x/.vim/plugged/incsearch.vim/autoload/vital/_incsearch/Over/Commandline/Modules/BufferComplete.vim
Sourced 2 times
Total time: 1507493888.707092
Self time: 1507493888.706857
count total (s) self (s)
" ___vital___
" NOTE: lines between '" ___vital___' is generated by :Vitalize.
" Do not mofidify the code nor insert new lines before '" ___vital___'
2 0.000007 if v:version > 703 || v:version == 703 && has('patch1170')
2 0.000066 function! vital#_incsearch#Over#Commandline#Modules#BufferComplete#import() abort
return map({'make': ''}, 'function("s:" . v:key)')
endfunction
2 0.000002 else
function! s:_SID() abort
return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze__SID$')
endfunction
execute join(['function! vital#_incsearch#Over#Commandline#Modules#BufferComplete#import() abort', printf("return map({'make': ''}, \"function('<SNR>%s_' . v:key)\")", s:_SID()), 'endfunction'], "\n")
delfunction s:_SID
endif
" ___vital___
2 0.000004 scriptencoding utf-8
2 0.000022 let s:save_cpo = &cpo
2 0.000021 set cpo&vim
2 0.000007 function! s:_uniq(list)
let dict = {}
for _ in a:list
let dict[_] = 0
endfor
return keys(dict)
endfunction
2 0.000016 let s:module = {
\ "name" : "BufferComplete",
\}
2 0.000007 function! s:_buffer_complete()
return sort(s:_uniq(filter(split(join(getline(1, '$')), '\W'), '!empty(v:val)')), 1)
endfunction
2 0.000005 function! s:_parse_line(line)
let keyword = matchstr(a:line, '\zs\w\+\ze$')
let pos = strchars(a:line) - strchars(keyword)
return [pos, keyword]
endfunction
2 0.000007 function! s:_as_statusline(list, count)
if empty(a:list)
return
endif
let hl_none = "%#StatusLine#"
let hl_select = "%#StatusLineNC#"
let tail = " > "
let result = a:list[0]
let pos = 0
for i in range(1, len(a:list)-1)
if strdisplaywidth(result . " " . a:list[i]) > &columns - len(tail)
if a:count < i
break
else
let pos = -i
endif
let result = a:list[i]
else
let result .= (" " . a:list[i])
endif
if a:count == i
let pos = pos + i
endif
endfor
return join(map(split(result, " "), 'v:key == pos ? hl_select . v:val . hl_none : v:val'))
endfunction
2 0.000005 function! s:module.get_complete_words()
return s:_buffer_complete()
endfunction
2 0.000005 function! s:module.complete(cmdline)
call s:_finish()
let s:old_statusline = &statusline
let backward = a:cmdline.backward()
let [pos, keyword] = s:_parse_line(backward)
if !exists("s:complete")
let s:complete = self.get_complete_words()
endif
let s:complete_list = filter(copy(s:complete), 'v:val =~ ''^''.keyword')
if empty(s:complete_list)
return -1
endif
if pos == 0
let backward = ""
else
let backward = join(split(backward, '\zs')[ : pos-1 ], "")
endif
let s:line = backward . a:cmdline.forward()
let s:pos = pos
call a:cmdline.setline(s:line)
let s:count = 0
endfunction
2 0.000005 function! s:_finish()
if exists("s:old_statusline")
let &statusline = s:old_statusline
unlet s:old_statusline
redrawstatus
endif
endfunction
2 0.000004 function! s:module.on_char_pre(cmdline)
if a:cmdline.is_input("<Over>(buffer-complete)")
\ || a:cmdline.is_input("<Over>(buffer-complete-prev)")
if self.complete(a:cmdline) == -1
call s:_finish()
call a:cmdline.setchar('')
return
endif
if a:cmdline.is_input("<Over>(buffer-complete-prev)")
let s:count = len(s:complete_list) - 1
endif
call a:cmdline.setchar('')
call a:cmdline.tap_keyinput("Completion")
" elseif a:cmdline.is_input("\<Tab>", "Completion")
elseif a:cmdline.is_input("<Over>(buffer-complete)", "Completion")
\ || a:cmdline.is_input("\<Right>", "Completion")
call a:cmdline.setchar('')
let s:count += 1
if s:count >= len(s:complete_list)
let s:count = 0
endif
elseif a:cmdline.is_input("<Over>(buffer-complete-prev)", "Completion")
\ || a:cmdline.is_input("\<Left>", "Completion")
call a:cmdline.setchar('')
let s:count -= 1
if s:count < 0
let s:count = len(s:complete_list) - 1
endif
else
if a:cmdline.untap_keyinput("Completion")
call a:cmdline.callevent("on_char_pre")
endif
call s:_finish()
return
endif
call a:cmdline.setline(s:line)
call a:cmdline.insert(s:complete_list[s:count], s:pos)
if len(s:complete_list) > 1
let &statusline = s:_as_statusline(s:complete_list, s:count)
redrawstatus
endif
if len(s:complete_list) == 1
call a:cmdline.untap_keyinput("Completion")
endif
endfunction
2 0.000007 function! s:module.on_draw_pre(...)
" redrawstatus
endfunction
2 0.000004 function! s:module.on_leave(cmdline)
call s:_finish()
unlet! s:complete
endfunction
2 0.000003 function! s:make()
return deepcopy(s:module)
endfunction
2 0.000028 let &cpo = s:save_cpo
2 0.000007 unlet s:save_cpo
SCRIPT /home/x/.vim/plugged/incsearch.vim/autoload/vital/_incsearch/Over/Commandline/Modules/Cancel.vim
Sourced 2 times
Total time: 1507493888.707753
Self time: 1507493888.707673
count total (s) self (s)
" ___vital___
" NOTE: lines between '" ___vital___' is generated by :Vitalize.
" Do not mofidify the code nor insert new lines before '" ___vital___'
2 0.000007 if v:version > 703 || v:version == 703 && has('patch1170')
2 0.000070 function! vital#_incsearch#Over#Commandline#Modules#Cancel#import() abort
return map({'make': ''}, 'function("s:" . v:key)')
endfunction
2 0.000002 else
function! s:_SID() abort
return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze__SID$')
endfunction
execute join(['function! vital#_incsearch#Over#Commandline#Modules#Cancel#import() abort', printf("return map({'make': ''}, \"function('<SNR>%s_' . v:key)\")", s:_SID()), 'endfunction'], "\n")
delfunction s:_SID
endif
" ___vital___
2 0.000003 scriptencoding utf-8
2 0.000019 let s:save_cpo = &cpo
2 0.000021 set cpo&vim
2 0.000008 let s:module = {
\ "name" : "Cancel"
\}
2 0.000005 function! s:module.on_char_pre(cmdline)
if a:cmdline.is_input("\<Esc>")
\ || a:cmdline.is_input("\<C-c>")
" call a:cmdline.cancel()
call a:cmdline.exit(1)
call a:cmdline.setchar("")
endif
endfunction
2 0.000004 function! s:make()
return deepcopy(s:module)
endfunction
2 0.000021 let &cpo = s:save_cpo
2 0.000006 unlet s:save_cpo
SCRIPT /home/x/.vim/plugged/incsearch.vim/autoload/vital/_incsearch/Over/Commandline/Modules/CursorMove.vim
Sourced 2 times
Total time: 1507493888.708424
Self time: 1507493888.708328
count total (s) self (s)
" ___vital___
" NOTE: lines between '" ___vital___' is generated by :Vitalize.
" Do not mofidify the code nor insert new lines before '" ___vital___'
2 0.000007 if v:version > 703 || v:version == 703 && has('patch1170')
2 0.000067 function! vital#_incsearch#Over#Commandline#Modules#CursorMove#import() abort
return map({'make': ''}, 'function("s:" . v:key)')
endfunction
2 0.000004 else
function! s:_SID() abort
return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze__SID$')
endfunction
execute join(['function! vital#_incsearch#Over#Commandline#Modules#CursorMove#import() abort', printf("return map({'make': ''}, \"function('<SNR>%s_' . v:key)\")", s:_SID()), 'endfunction'], "\n")
delfunction s:_SID
endif
" ___vital___
2 0.000004 scriptencoding utf-8
2 0.000019 let s:save_cpo = &cpo
2 0.000021 set cpo&vim
2 0.000009 let s:module = {
\ "name" : "CursorMove"
\}
2 0.000004 function! s:module.on_char_pre(cmdline)
if a:cmdline.is_input("\<Right>")
call a:cmdline.line.next()
call a:cmdline.setchar('')
elseif a:cmdline.is_input("\<Left>")
call a:cmdline.line.prev()
call a:cmdline.setchar('')
elseif a:cmdline.is_input("\<C-b>")
\ || a:cmdline.is_input("\<Home>")
call a:cmdline.setline(0)
call a:cmdline.setchar('')
elseif a:cmdline.is_input("\<C-e>")
\ || a:cmdline.is_input("\<End>")
call a:cmdline.setline(a:cmdline.line.length())
call a:cmdline.setchar('')
elseif a:cmdline.is_input("\<C-Left>")
\ || a:cmdline.is_input("\<S-Left>")
call a:cmdline.setline(strridx(a:cmdline.backward()[:-2], ' ') + 1)
call a:cmdline.setchar('')
elseif a:cmdline.is_input("\<C-Right>")
\ || a:cmdline.is_input("\<S-Right>")
let p = stridx(a:cmdline.forward()[1:], ' ')
call a:cmdline.setline(p != -1 ? a:cmdline.line.pos() + p + 2 : a:cmdline.line.length())
call a:cmdline.setchar('')
endif
endfunction
2 0.000004 function! s:make()
return deepcopy(s:module)
endfunction
2 0.000022 let &cpo = s:save_cpo
2 0.000006 unlet s:save_cpo
SCRIPT /home/x/.vim/plugged/incsearch.vim/autoload/vital/_incsearch/Over/Commandline/Modules/Digraphs.vim
Sourced 2 times
Total time: 1507493888.709163
Self time: 1507493888.709018
count total (s) self (s)
" ___vital___
" NOTE: lines between '" ___vital___' is generated by :Vitalize.
" Do not mofidify the code nor insert new lines before '" ___vital___'
2 0.000007 if v:version > 703 || v:version == 703 && has('patch1170')
2 0.000065 function! vital#_incsearch#Over#Commandline#Modules#Digraphs#import() abort
return map({'capture': '', '_vital_depends': '', 'digraph': '', 'make': '', '_vital_loaded': ''}, 'function("s:" . v:key)')
endfunction
2 0.000002 else
function! s:_SID() abort
return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze__SID$')
endfunction
execute join(['function! vital#_incsearch#Over#Commandline#Modules#Digraphs#import() abort', printf("return map({'capture': '', '_vital_depends': '', 'digraph': '', 'make': '', '_vital_loaded': ''}, \"function('<SNR>%s_' . v:key)\")", s:_SID()), 'endfunction'], "\n")
delfunction s:_SID
endif
" ___vital___
2 0.000004 scriptencoding utf-8
2 0.000017 let s:save_cpo = &cpo
2 0.000023 set cpo&vim
2 0.000004 function! s:_vital_loaded(V)
let s:Input = a:V.import("Over.Input")
endfunction
2 0.000004 function! s:_vital_depends()
return [
\ "Over.Input",
\ ]
endfunction
2 0.000012 let s:module = {
\ "name" : "Digraphs",
\ "digraphs" : {}
\}
2 0.000004 function! s:capture(cmd)
let verbose_save = &verbose
let &verbose = 0
try
redir => result
execute "silent!" a:cmd
redir END
finally
let &verbose = verbose_save
endtry
return result
endfunction
2 0.000004 function! s:digraph() abort
let x = split(substitute(s:capture(':digraph'), "\n", ' ', 'g'),
\ '[[:graph:]]\{2}\s.\{1,4}\s\+\d\+\s*\zs')
let digraphs = map(x, "split(v:val, ' \\+')")
let r = {}
for d in digraphs
let r[d[0]] = len(d) is 3 && d[2] =~# '\d\+' ? nr2char(str2nr(d[2],10))
\ : len(d) is 2 && d[1] =~# '32' ? nr2char(str2nr(d[1],10))
\ : ''
endfor
return r
endfunction
2 0.000004 function! s:module.on_leave(cmdline)
" Delete cache to handle additional digraphs definition
let self.digraphs = {}
endfunction
2 0.000004 function! s:module.on_char_pre(cmdline)
if a:cmdline.is_input("\<C-k>")
if empty(self.digraphs)
" Get digraphs when inputting <C-k> instead of on_enter because it cause
" flicker in some environments #107
let self.digraphs = s:digraph()
endif
call a:cmdline.setchar('?')
let self.prefix_key = a:cmdline.input_key()
let self.old_line = a:cmdline.getline()
let self.old_pos = a:cmdline.getpos()
return
elseif exists("self.prefix_key")
\ && a:cmdline.get_tap_key() == self.prefix_key
call a:cmdline.setline(self.old_line)
call a:cmdline.setpos(self.old_pos)
let x = a:cmdline.input_key()
let y = s:Input.getchar()
" For CTRL-K, there is one general digraph: CTRL-K <Space> {char} will
" enter {char} with the highest bit set. You can use this to enter
" meta-characters.
let char = x ==# "\<Space>" ?
\ nr2char(char2nr(y) + 128) : get(self.digraphs, x . y, y)
call a:cmdline.setchar(char)
endif
endfunction
2 0.000004 function! s:module.on_char(cmdline)
if a:cmdline.is_input("\<C-k>")
call a:cmdline.tap_keyinput(self.prefix_key)
call a:cmdline.disable_keymapping()
call a:cmdline.setpos(a:cmdline.getpos()-1)
else
if exists("self.prefix_key")
call a:cmdline.untap_keyinput(self.prefix_key)
call a:cmdline.enable_keymapping()
unlet! self.prefix_key
endif
endif
endfunction
2 0.000003 function! s:make()
return deepcopy(s:module)
endfunction
2 0.000025 let &cpo = s:save_cpo
2 0.000006 unlet s:save_cpo
SCRIPT /home/x/.vim/plugged/incsearch.vim/autoload/vital/_incsearch/Over/Commandline/Modules/Delete.vim
Sourced 2 times
Total time: 1507493888.709943
Self time: 1507493888.709843
count total (s) self (s)
" ___vital___
" NOTE: lines between '" ___vital___' is generated by :Vitalize.
" Do not mofidify the code nor insert new lines before '" ___vital___'
2 0.000007 if v:version > 703 || v:version == 703 && has('patch1170')
2 0.000068 function! vital#_incsearch#Over#Commandline#Modules#Delete#import() abort
return map({'make': ''}, 'function("s:" . v:key)')
endfunction
2 0.000002 else
function! s:_SID() abort
return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze__SID$')
endfunction
execute join(['function! vital#_incsearch#Over#Commandline#Modules#Delete#import() abort', printf("return map({'make': ''}, \"function('<SNR>%s_' . v:key)\")", s:_SID()), 'endfunction'], "\n")
delfunction s:_SID
endif
" ___vital___
2 0.000004 scriptencoding utf-8
2 0.000019 let s:save_cpo = &cpo
2 0.000025 set cpo&vim
2 0.000010 let s:module = {
\ "name" : "Delete",
\}
2 0.000004 function! s:module.on_char_pre(cmdline)
if a:cmdline.is_input("\<C-h>")
\ || a:cmdline.is_input("\<BS>")
if a:cmdline.line.length() == 0
return a:cmdline.exit(1)
else
call a:cmdline.line.remove_prev()
call a:cmdline.setchar('')
endif
elseif a:cmdline.is_input("\<Del>")
call a:cmdline.line.remove_pos()
call a:cmdline.setchar('')
elseif a:cmdline.is_input("\<C-w>")
let word = a:cmdline.backward_word()
let backward = a:cmdline.backward()[ : -strlen(word)-1 ]
call a:cmdline.setline(backward . a:cmdline.line.pos_char() . a:cmdline.forward())
call a:cmdline.setline(strchars(backward))
call a:cmdline.setchar('')
elseif a:cmdline.is_input("\<C-u>")
call a:cmdline.setline(a:cmdline.line.pos_char() . a:cmdline.forward())
call a:cmdline.setline(0)
call a:cmdline.setchar('')
endif
endfunction
2 0.000004 function! s:make()
return deepcopy(s:module)
endfunction
2 0.000026 let &cpo = s:save_cpo
2 0.000006 unlet s:save_cpo
SCRIPT /home/x/.vim/plugged/incsearch.vim/autoload/vital/_incsearch/Over/Commandline/Modules/DrawCommandline.vim
Sourced 2 times
Total time: 1507493888.710794
Self time: 1507493888.710599
count total (s) self (s)
" ___vital___
" NOTE: lines between '" ___vital___' is generated by :Vitalize.
" Do not mofidify the code nor insert new lines before '" ___vital___'
2 0.000007 if v:version > 703 || v:version == 703 && has('patch1170')
2 0.000066 function! vital#_incsearch#Over#Commandline#Modules#DrawCommandline#import() abort
return map({'suffix': '', 'make': ''}, 'function("s:" . v:key)')
endfunction
2 0.000003 else
function! s:_SID() abort
return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze__SID$')
endfunction
execute join(['function! vital#_incsearch#Over#Commandline#Modules#DrawCommandline#import() abort', printf("return map({'suffix': '', 'make': ''}, \"function('<SNR>%s_' . v:key)\")", s:_SID()), 'endfunction'], "\n")
delfunction s:_SID
endif
" ___vital___
2 0.000004 scriptencoding utf-8
2 0.000014 let s:save_cpo = &cpo
2 0.000025 set cpo&vim
2 0.000011 let s:module = {
\ "name" : "DrawCommandline"
\}
2 0.000005 let s:cmdheight = {}
2 0.000003 function! s:cmdheight.save()
if has_key(self, "value")
return
endif
let self.value = &cmdheight
endfunction
2 0.000004 function! s:cmdheight.restore()
if has_key(self, "value")
let &cmdheight = self.value
unlet self.value
endif
endfunction
2 0.000004 function! s:cmdheight.get()
return self.value
endfunction
2 0.000004 function! s:suffix(left, suffix)
let left_len = strdisplaywidth(a:left)
let len = &columns - left_len % &columns
let len = len + (&columns * (strdisplaywidth(a:suffix) > (len - 1))) - 1
return repeat(" ", len - strdisplaywidth(a:suffix)) . a:suffix
" return printf("%" . len . "S", a:suffix)
endfunction
2 0.000004 let s:old_width = 0
2 0.000005 function! s:_redraw(cmdline)
let left = a:cmdline.get_prompt() . a:cmdline.getline() . (empty(a:cmdline.line.pos_char()) ? " " : "")
let width = len(left) + 1
if a:cmdline.get_suffix() != ""
let width += len(s:suffix(left, a:cmdline.get_suffix())) - 1
endif
if &columns >= width && &columns <= s:old_width && s:old_width >= width
redraw
normal! :
elseif &columns <= width
normal! :
else
redraw
endif
let s:old_width = width
call s:cmdheight.save()
let height = max([(width - 1) / (&columns) + 1, s:cmdheight.get()])
if height > &cmdheight || &cmdheight > height
let &cmdheight = height
redraw
endif
endfunction
2 0.000004 function! s:_as_echon(str)
return "echon " . strtrans(string(a:str))
endfunction
2 0.000004 function! s:module.on_draw_pre(cmdline)
if empty(a:cmdline.line.pos_char())
let cursor = "echohl " . a:cmdline.highlights.cursor . " | echon ' '"
else
let cursor = "echohl " . a:cmdline.highlights.cursor_on . " | " . s:_as_echon(a:cmdline.line.pos_char())
endif
let suffix = ""
if a:cmdline.get_suffix() != ""
let suffix = s:_as_echon(s:suffix(a:cmdline.get_prompt() . a:cmdline.getline() . repeat(" ", empty(a:cmdline.line.pos_char())), a:cmdline.get_suffix()))
endif
let self.draw_command = join([
\ "echohl " . a:cmdline.highlights.prompt,
\ s:_as_echon(a:cmdline.get_prompt()),
\ "echohl NONE",
\ s:_as_echon(a:cmdline.backward()),
\ cursor,
\ "echohl NONE",
\ s:_as_echon(a:cmdline.forward()),
\ suffix,
\ ], " | ")
call s:_redraw(a:cmdline)
endfunction
2 0.000004 function! s:_echon(expr)
echon strtrans(a:expr)
endfunction
2 0.000004 function! s:module.on_draw(cmdline)
execute self.draw_command
" execute "echohl" a:cmdline.highlights.prompt
" call s:echon(a:cmdline.get_prompt())
" echohl NONE
" call s:echon(a:cmdline.backward())
" if empty(a:cmdline.line.pos_char())
" execute "echohl" a:cmdline.highlights.cursor
" call s:echon(' ')
" else
" execute "echohl" a:cmdline.highlights.cursor_on
" call s:echon(a:cmdline.line.pos_char())
" endif
" echohl NONE
" call s:echon(a:cmdline.forward())
" if a:cmdline.get_suffix() != ""
" call s:echon(s:suffix(a:cmdline.get_prompt() . a:cmdline.getline() . repeat(" ", empty(a:cmdline.line.pos_char())), a:cmdline.get_suffix()))
" endif
endfunction
2 0.000003 function! s:module.on_execute_pre(...)
call s:cmdheight.restore()
endfunction
2 0.000003 function! s:module.on_leave(...)
call s:cmdheight.restore()
endfunction
2 0.000004 function! s:make()
return deepcopy(s:module)
endfunction
2 0.000027 let &cpo = s:save_cpo
2 0.000006 unlet s:save_cpo
SCRIPT /home/x/.vim/plugged/incsearch.vim/autoload/vital/_incsearch/Over/Commandline/Modules/ExceptionExit.vim
Sourced 2 times
Total time: 1507493888.711479
Self time: 1507493888.711390
count total (s) self (s)
" ___vital___
" NOTE: lines between '" ___vital___' is generated by :Vitalize.
" Do not mofidify the code nor insert new lines before '" ___vital___'
2 0.000008 if v:version > 703 || v:version == 703 && has('patch1170')
2 0.000067 function! vital#_incsearch#Over#Commandline#Modules#ExceptionExit#import() abort
return map({'make': ''}, 'function("s:" . v:key)')
endfunction
2 0.000003 else
function! s:_SID() abort
return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze__SID$')
endfunction
execute join(['function! vital#_incsearch#Over#Commandline#Modules#ExceptionExit#import() abort', printf("return map({'make': ''}, \"function('<SNR>%s_' . v:key)\")", s:_SID()), 'endfunction'], "\n")
delfunction s:_SID
endif
" ___vital___
2 0.000003 scriptencoding utf-8
2 0.000015 let s:save_cpo = &cpo
2 0.000025 set cpo&vim
2 0.000009 let s:module = {
\ "name" : "ExceptionExit",
\}
2 0.000004 function! s:module.on_exception(cmdline)
call a:cmdline.exit(-1)
endfunction
2 0.000004 function! s:make(...)
let result = deepcopy(s:module)
let result.exit_code = get(a:, 1, 0)
return result
endfunction
2 0.000026 let &cpo = s:save_cpo
2 0.000006 unlet s:save_cpo
SCRIPT /home/x/.vim/plugged/incsearch.vim/autoload/vital/_incsearch/Over/Commandline/Modules/LiteralInsert.vim
Sourced 2 times
Total time: 1507493888.712137
Self time: 1507493888.712054
count total (s) self (s)
" ___vital___
" NOTE: lines between '" ___vital___' is generated by :Vitalize.
" Do not mofidify the code nor insert new lines before '" ___vital___'
2 0.000007 if v:version > 703 || v:version == 703 && has('patch1170')
2 0.000076 function! vital#_incsearch#Over#Commandline#Modules#LiteralInsert#import() abort
return map({'make': ''}, 'function("s:" . v:key)')
endfunction
2 0.000002 else
function! s:_SID() abort
return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze__SID$')
endfunction
execute join(['function! vital#_incsearch#Over#Commandline#Modules#LiteralInsert#import() abort', printf("return map({'make': ''}, \"function('<SNR>%s_' . v:key)\")", s:_SID()), 'endfunction'], "\n")
delfunction s:_SID
endif
" ___vital___
2 0.000004 scriptencoding utf-8
2 0.000014 let s:save_cpo = &cpo
2 0.000023 set cpo&vim
2 0.000009 let s:module = {
\ "name" : "LiteralInsert",
\}
2 0.000005 function! s:module.on_char_pre(cmdline)
if a:cmdline.is_input("\<C-v>")
\ || a:cmdline.is_input("\<C-q>")
let old_line = a:cmdline.getline()
let old_pos = a:cmdline.getpos()
call a:cmdline.insert('^')
call a:cmdline.setpos(old_pos)
call a:cmdline.draw()
let char = a:cmdline.getchar()
call a:cmdline.setline(old_line)
call a:cmdline.setpos(old_pos)
call a:cmdline.setchar(char)
endif
endfunction
2 0.000004 function! s:make()
return deepcopy(s:module)
endfunction
2 0.000020 let &cpo = s:save_cpo
2 0.000005 unlet s:save_cpo
SCRIPT /home/x/.vim/plugged/incsearch.vim/autoload/incsearch/over/modules/exit.vim
Sourced 1 time
Total time: 0.000063
Self time: 0.000063
count total (s) self (s)
"=============================================================================
" FILE: autoload/incsearch/over/modules/exit.vim
" AUTHOR: haya14busa
" License: MIT license
"=============================================================================
1 0.000002 scriptencoding utf-8
1 0.000007 let s:save_cpo = &cpo
1 0.000012 set cpo&vim
" NOTE:
" <CR> in {rhs} wil be remapped even after exiting vital-over command line
" interface, so do not use <Over>(exit)
" See also s:cli.keymapping()
1 0.000004 let s:incsearch_exit = {
\ 'name' : 'IncsearchExit',
\ 'exit_code' : 0
\}
1 0.000002 function! s:incsearch_exit.on_char_pre(cmdline) abort
if a:cmdline.is_input("\<CR>")
\ || a:cmdline.is_input("\<NL>")
call a:cmdline.setchar('')
call a:cmdline.exit(self.exit_code)
endif
endfunction
1 0.000004 function! incsearch#over#modules#exit#make() abort
return deepcopy(s:incsearch_exit)
endfunction
1 0.000012 let &cpo = s:save_cpo
1 0.000001 unlet s:save_cpo
" __END__
" vim: expandtab softtabstop=2 shiftwidth=2 foldmethod=marker
SCRIPT /home/x/.vim/plugged/incsearch.vim/autoload/incsearch/over/modules/insert_register.vim
Sourced 1 time
Total time: 0.000954
Self time: 0.000085
count total (s) self (s)
"=============================================================================
" FILE: autoload/incsearch/over/modules/insert_register.vim
" AUTHOR: haya14busa
" License: MIT license
"=============================================================================
1 0.000002 scriptencoding utf-8
1 0.000007 let s:save_cpo = &cpo
1 0.000012 set cpo&vim
1 0.000064 0.000006 let s:modules = vital#incsearch#import('Over.Commandline.Modules')
1 0.000820 0.000009 let s:InsertRegister = s:modules.get('InsertRegister').make()
1 0.000005 let s:InsertRegister_orig_on_char_pre = s:InsertRegister.on_char_pre
1 0.000003 let s:InsertRegister.search_register = ''
1 0.000002 function! s:InsertRegister.on_enter(...) abort
let self.search_register = @/
endfunction
1 0.000002 function! s:InsertRegister.on_char_pre(cmdline) abort
if exists('self.prefix_key') && a:cmdline.get_tap_key() == self.prefix_key
call a:cmdline.setline(self.old_line)
call a:cmdline.setpos(self.old_pos)
let char = a:cmdline.input_key()
if char ==# '/'
let register = tr(self.search_register, "\n", "\r")
call a:cmdline.setchar(register)
return
endif
endif
return call(s:InsertRegister_orig_on_char_pre, [a:cmdline], self)
endfunction
1 0.000005 function! incsearch#over#modules#insert_register#make() abort
return deepcopy(s:InsertRegister)
endfunction
1 0.000009 let &cpo = s:save_cpo
1 0.000002 unlet s:save_cpo
" __END__
" vim: expandtab softtabstop=2 shiftwidth=2 foldmethod=marker
SCRIPT /home/x/.vim/plugged/incsearch.vim/autoload/vital/_incsearch/Over/Commandline/Modules/InsertRegister.vim
Sourced 2 times
Total time: 1507493888.713330
Self time: 1507493888.713166
count total (s) self (s)
" ___vital___
" NOTE: lines between '" ___vital___' is generated by :Vitalize.
" Do not mofidify the code nor insert new lines before '" ___vital___'
2 0.000008 if v:version > 703 || v:version == 703 && has('patch1170')
2 0.000072 function! vital#_incsearch#Over#Commandline#Modules#InsertRegister#import() abort
return map({'_vital_depends': '', 'to_string': '', 'input': '', 'get_cmdline_cword': '', 'make': '', '_vital_loaded': ''}, 'function("s:" . v:key)')
endfunction
2 0.000006 else
function! s:_SID() abort
return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze__SID$')
endfunction
execute join(['function! vital#_incsearch#Over#Commandline#Modules#InsertRegister#import() abort', printf("return map({'_vital_depends': '', 'to_string': '', 'input': '', 'get_cmdline_cword': '', 'make': '', '_vital_loaded': ''}, \"function('<SNR>%s_' . v:key)\")", s:_SID()), 'endfunction'], "\n")
delfunction s:_SID
endif
" ___vital___
2 0.000004 scriptencoding utf-8
2 0.000017 let s:save_cpo = &cpo
2 0.000015 set cpo&vim
2 0.000005 function! s:_vital_loaded(V)
let s:V = a:V
let s:String = s:V.import("Over.String")
endfunction
2 0.000004 function! s:_vital_depends()
return [
\ "Over.String",
\ ]
endfunction
2 0.000005 function! s:to_string(expr)
return type(a:expr) == type("") ? a:expr : string(a:expr)
endfunction
2 0.000003 function! s:input(cmdline)
let CR_index = index(a:cmdline.input_key_stack(), "\<CR>")
if CR_index != -1
let input = a:cmdline.input_key_stack_string()
let input = input[ : CR_index-1]
call a:cmdline.set_input_key_stack(a:cmdline.input_key_stack()[CR_index+1 : ])
return eval(input)
endif
let input_text = ""
if !empty(a:cmdline.input_key_stack())
let input_text = a:cmdline.input_key_stack_string()
call a:cmdline.set_input_key_stack([])
endif
call a:cmdline.hl_cursor_on()
try
redraw
let input = input("=", input_text, "expression")
if !empty(input)
let input = s:to_string(eval(input))
endif
catch
return ""
finally
call a:cmdline.hl_cursor_off()
endtry
return input
endfunction
2 0.000011 let s:module = {
\ "name" : "InsertRegister"
\}
2 0.000003 function! s:module.reset()
let self.cword = expand("<cword>")
let self.cWORD = expand("<cWORD>")
let self.cfile = expand("<cfile>")
endfunction
2 0.000002 function! s:module.on_enter(...)
call self.reset()
" let self.prefix_key = ""
endfunction
2 0.000005 function! s:get_cmdline_cword(backward, cword)
" let backward = matchstr(a:backward, '.\{-}\zs\k\+$')
let backward = a:backward
if &incsearch == 0 || a:cword == "" || a:backward == "" || s:String.index(a:cword, backward) != 0
return a:cword
endif
return a:cword[len(backward) : ]
endfunction
2 0.000004 function! s:module.on_char_pre(cmdline)
if a:cmdline.is_input("\<C-r>")
call a:cmdline.setchar('"')
let self.prefix_key = a:cmdline.input_key()
let self.old_line = a:cmdline.getline()
let self.old_pos = a:cmdline.getpos()
return
elseif exists("self.prefix_key")
\ && a:cmdline.get_tap_key() == self.prefix_key
call a:cmdline.setline(self.old_line)
call a:cmdline.setpos(self.old_pos)
let char = a:cmdline.input_key()
if char =~ '^[0-9a-zA-z.%#:/"\-*+]$'
let register = tr(getreg(char), "\n", "\r")
call a:cmdline.setchar(register)
elseif char == "="
call a:cmdline.setchar(s:input(a:cmdline))
elseif char == "\<C-w>"
call a:cmdline.setchar(s:get_cmdline_cword(a:cmdline.backward_word(), self.cword))
elseif char == "\<C-a>"
call a:cmdline.setchar(self.cWORD)
elseif char == "\<C-f>"
call a:cmdline.setchar(self.cfile)
elseif char == "\<C-r>"
call a:cmdline.setchar('"')
else
call a:cmdline.setchar("")
endif
" elseif a:cmdline.is_input('=', self.prefix_key)
" call a:cmdline.setchar(s:input(a:cmdline))
" elseif a:cmdline.is_input("\<C-w>", self.prefix_key)
" call a:cmdline.setchar(self.cword)
" elseif a:cmdline.is_input("\<C-a>", self.prefix_key)
" call a:cmdline.setchar(self.cWORD)
" elseif a:cmdline.is_input("\<C-f>", self.prefix_key)
" call a:cmdline.setchar(self.cfile)
" elseif a:cmdline.is_input("\<C-r>", self.prefix_key)
" call a:cmdline.setchar('"')
" else
" call a:cmdline.setchar("")
" endif
endif
endfunction
2 0.000004 function! s:module.on_char(cmdline)
if a:cmdline.is_input("\<C-r>")
call a:cmdline.tap_keyinput(self.prefix_key)
call a:cmdline.disable_keymapping()
call a:cmdline.setpos(a:cmdline.getpos()-1)
else
if exists("self.prefix_key")
call a:cmdline.untap_keyinput(self.prefix_key)
call a:cmdline.enable_keymapping()
unlet! self.prefix_key
endif
endif
endfunction
2 0.000002 function! s:make()
return deepcopy(s:module)
endfunction
2 0.000020 let &cpo = s:save_cpo
2 0.000005 unlet s:save_cpo
SCRIPT /home/x/.vim/plugged/incsearch.vim/autoload/vital/_incsearch/Over/Commandline/Modules/Paste.vim
Sourced 2 times
Total time: 1507493888.714104
Self time: 1507493888.714030
count total (s) self (s)
" ___vital___
" NOTE: lines between '" ___vital___' is generated by :Vitalize.
" Do not mofidify the code nor insert new lines before '" ___vital___'
2 0.000007 if v:version > 703 || v:version == 703 && has('patch1170')
2 0.000067 function! vital#_incsearch#Over#Commandline#Modules#Paste#import() abort
return map({'make': ''}, 'function("s:" . v:key)')
endfunction
2 0.000002 else
function! s:_SID() abort
return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze__SID$')
endfunction
execute join(['function! vital#_incsearch#Over#Commandline#Modules#Paste#import() abort', printf("return map({'make': ''}, \"function('<SNR>%s_' . v:key)\")", s:_SID()), 'endfunction'], "\n")
delfunction s:_SID
endif
" ___vital___
2 0.000003 scriptencoding utf-8
2 0.000013 let s:save_cpo = &cpo
2 0.000015 set cpo&vim
2 0.000008 let s:module = {
\ "name" : "Paste"
\}
2 0.000004 function! s:module.on_char_pre(cmdline)
if a:cmdline.is_input("<Over>(paste)")
let register = v:register == "" ? '"' : v:register
call a:cmdline.insert(tr(getreg("*"), "\n", "\r"))
call a:cmdline.setchar('')
endif
endfunction
2 0.000002 function! s:make()
return deepcopy(s:module)
endfunction
2 0.000015 let &cpo = s:save_cpo
2 0.000006 unlet s:save_cpo
SCRIPT /home/x/.vim/plugged/incsearch.vim/autoload/vital/_incsearch/Over/Commandline/Modules/Doautocmd.vim
Sourced 2 times
Total time: 1507493888.715125
Self time: 1507493888.714827
count total (s) self (s)
" ___vital___
" NOTE: lines between '" ___vital___' is generated by :Vitalize.
" Do not mofidify the code nor insert new lines before '" ___vital___'
2 0.000007 if v:version > 703 || v:version == 703 && has('patch1170')
2 0.000059 function! vital#_incsearch#Over#Commandline#Modules#Doautocmd#import() abort
return map({'_vital_depends': '', 'doautocmd_user': '', 'get_cmdline': '', 'make': '', '_vital_loaded': ''}, 'function("s:" . v:key)')
endfunction
2 0.000002 else
function! s:_SID() abort
return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze__SID$')
endfunction
execute join(['function! vital#_incsearch#Over#Commandline#Modules#Doautocmd#import() abort', printf("return map({'_vital_depends': '', 'doautocmd_user': '', 'get_cmdline': '', 'make': '', '_vital_loaded': ''}, \"function('<SNR>%s_' . v:key)\")", s:_SID()), 'endfunction'], "\n")
delfunction s:_SID
endif
" ___vital___
2 0.000007 scriptencoding utf-8
2 0.000022 let s:save_cpo = &cpo
2 0.000016 set cpo&vim
2 0.000008 function! s:_vital_loaded(V)
let s:V = a:V
let s:E = s:V.import("Over.Exception")
endfunction
2 0.000004 function! s:_vital_depends()
return [
\ "Over.Exception",
\ ]
endfunction
2 0.000005 let s:cache_command = {}
2 0.000005 function! s:doautocmd_user(prefix, command)
let group = a:prefix . "-vital-over-commandline-doautocmd-dummy"
if !has_key(s:cache_command, a:prefix)
let s:cache_command[a:prefix] = {}
endif
if !has_key(s:cache_command[a:prefix], a:command)
execute "autocmd " . group
\ . " User " . a:command." silent! execute ''"
if v:version > 703 || v:version == 703 && has("patch438")
let s:cache_command[a:prefix][a:command] = "doautocmd <nomodeline> User " . a:command
else
let s:cache_command[a:prefix][a:command] = "doautocmd User " . a:command
endif
endif
execute s:cache_command[a:prefix][a:command]
endfunction
2 0.000014 let s:hooks = [
\ "enter",
\ "leave",
\ "char",
\ "char_pre",
\ "draw",
\ "draw_pre",
\ "execute_pre",
\ "execute_failed",
\ "execute",
\ "exception",
\]
2 0.000012 let s:hooks_camel = [
\ "Enter",
\ "Leave",
\ "Char",
\ "CharPre",
\ "Draw",
\ "DrawPre",
\ "ExecutePre",
\ "ExecuteFailed",
\ "Execute",
\ "Exception",
\]
2 0.000010 let s:module = {
\ "name" : "Doautocmd",
\}
22 0.000031 for s:i in range(len(s:hooks))
2 0.000032 execute join([
\ "function! s:module.on_" . s:hooks[s:i] . "(cmdline, ...)",
\ " let s:cmdline = a:cmdline",
\ " call s:doautocmd_user(self.prefix, self.prefix . " . string(s:hooks_camel[s:i]) . ")",
\ "endfunction",
18 0.000227 \ ], "\n")
20 0.000018 endfor
2 0.000004 function! s:get_cmdline()
if !exists("s:cmdline")
execute s:E.throw_cmd("Undefined cmdline object.", "Over.Commandline.Modules.Doautocmd")
endif
return s:cmdline
endfunction
2 0.000004 function! s:make(prefix)
if has_key(s:cache_command, a:prefix)
unlet! s:cache_command[a:prefix]
endif
execute "augroup " a:prefix . "-vital-over-commandline-doautocmd-dummy"
autocmd!
augroup END
let module = deepcopy(s:module)
let module.prefix = a:prefix
return module
endfunction
2 0.000016 let &cpo = s:save_cpo
2 0.000005 unlet s:save_cpo
SCRIPT /home/x/.vim/plugged/incsearch.vim/autoload/vital/_incsearch/Over/Exception.vim
Sourced 2 times
Total time: 1507493888.715651
Self time: 1507493888.715559
count total (s) self (s)
" ___vital___
" NOTE: lines between '" ___vital___' is generated by :Vitalize.
" Do not mofidify the code nor insert new lines before '" ___vital___'
2 0.000008 if v:version > 703 || v:version == 703 && has('patch1170')
2 0.000058 function! vital#_incsearch#Over#Exception#import() abort
return map({'throw': '', 'throw_cmd': '', 'set_prefix': '', 'error': ''}, 'function("s:" . v:key)')
endfunction
2 0.000002 else
function! s:_SID() abort
return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze__SID$')
endfunction
execute join(['function! vital#_incsearch#Over#Exception#import() abort', printf("return map({'throw': '', 'throw_cmd': '', 'set_prefix': '', 'error': ''}, \"function('<SNR>%s_' . v:key)\")", s:_SID()), 'endfunction'], "\n")
delfunction s:_SID
endif
" ___vital___
2 0.000003 scriptencoding utf-8
2 0.000017 let s:save_cpo = &cpo
2 0.000015 set cpo&vim
2 0.000013 let s:vname = expand("<sfile>:h:h:t")
2 0.000008 let s:prefix = printf("vital-over(%s) Exception", s:vname)
2 0.000004 function! s:set_prefix(prefix)
let s:prefix = a:prefix
endfunction
2 0.000005 function! s:throw_cmd(exp, where)
return 'throw ' . string(s:prefix . " : " . a:exp . " in " . a:where)
endfunction
2 0.000004 function! s:throw(exp, where)
execute s:throw_cmd(a:exp, a:where)
endfunction
2 0.000004 function! s:error(text, where)
echohl ErrorMsg
echom s:prefix . " : " . a:text . " in " . a:where
echohl None
endfunction
2 0.000016 let &cpo = s:save_cpo
2 0.000004 unlet s:save_cpo
SCRIPT /home/x/.vim/plugged/incsearch.vim/autoload/vital/_incsearch/Over/Commandline/Modules/ExceptionMessage.vim
Sourced 2 times
Total time: 1507493888.716593
Self time: 1507493888.716494
count total (s) self (s)
" ___vital___
" NOTE: lines between '" ___vital___' is generated by :Vitalize.
" Do not mofidify the code nor insert new lines before '" ___vital___'
2 0.000007 if v:version > 703 || v:version == 703 && has('patch1170')
2 0.000064 function! vital#_incsearch#Over#Commandline#Modules#ExceptionMessage#import() abort
return map({'make': ''}, 'function("s:" . v:key)')
endfunction
2 0.000002 else
function! s:_SID() abort
return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze__SID$')
endfunction
execute join(['function! vital#_incsearch#Over#Commandline#Modules#ExceptionMessage#import() abort', printf("return map({'make': ''}, \"function('<SNR>%s_' . v:key)\")", s:_SID()), 'endfunction'], "\n")
delfunction s:_SID
endif
" ___vital___
2 0.000003 scriptencoding utf-8
2 0.000014 let s:save_cpo = &cpo
2 0.000014 set cpo&vim
2 0.000008 let s:vname = expand("<sfile>:h:h:h:h:t")
2 0.000010 let s:module = {
\ "name" : "ExceptionMessage",
\}
2 0.000005 function! s:module.on_exception(cmdline)
let self.exception = v:exception
let self.throwpoint = v:throwpoint
endfunction
2 0.000002 function! s:module.on_draw_pre(cmdline)
if has_key(self, "exception")
call self.message(a:cmdline)
unlet self.exception
endif
endfunction
2 0.000004 function! s:module.message(...)
echohl ErrorMsg
execute self.command string(self.prefix . " : " . self.throwpoint . " " . self.exception)
echohl None
endfunction
2 0.000004 function! s:module.on_leave(cmdline)
if has_key(self, "exception")
call self.message(a:cmdline)
unlet self.exception
endif
endfunction
2 0.000004 function! s:make(...)
let result = deepcopy(s:module)
let result.prefix = get(a:, 1, "vital-over(".s:vname.") Exception")
let result.command = get(a:, 2, "echom")
return result
endfunction
2 0.000015 let &cpo = s:save_cpo
2 0.000006 unlet s:save_cpo
SCRIPT /home/x/.vim/plugged/incsearch.vim/autoload/vital/_incsearch/Over/Commandline/Modules/History.vim
Sourced 2 times
Total time: 1507493888.717254
Self time: 1507493888.717151
count total (s) self (s)
" ___vital___
" NOTE: lines between '" ___vital___' is generated by :Vitalize.
" Do not mofidify the code nor insert new lines before '" ___vital___'
2 0.000007 if v:version > 703 || v:version == 703 && has('patch1170')
2 0.000063 function! vital#_incsearch#Over#Commandline#Modules#History#import() abort
return map({'make': ''}, 'function("s:" . v:key)')
endfunction
2 0.000002 else
function! s:_SID() abort
return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze__SID$')
endfunction
execute join(['function! vital#_incsearch#Over#Commandline#Modules#History#import() abort', printf("return map({'make': ''}, \"function('<SNR>%s_' . v:key)\")", s:_SID()), 'endfunction'], "\n")
delfunction s:_SID
endif
" ___vital___
2 0.000003 scriptencoding utf-8
2 0.000018 let s:save_cpo = &cpo
2 0.000014 set cpo&vim
2 0.000010 let s:module = {
\ "name" : "History",
\ "mode" : "cmd",
\}
2 0.000004 function! s:module.histories()
return map(range(1, &history), 'histget(self.mode, v:val * -1)')
endfunction
2 0.000005 function! s:_should_match_cmdline(cmdline)
return a:cmdline.is_input("\<Up>")
\ || a:cmdline.is_input("\<Down>")
endfunction
2 0.000004 function! s:_reset()
let s:cmdhist = []
let s:count = 0
let s:is_match_mode = 0 " <Up>/<Down>: true, <C-n>/<C-p>: false
endfunction
2 0.000003 function! s:module.on_enter(...)
call s:_reset()
endfunction
2 0.000004 function! s:module.on_char_pre(cmdline)
if !a:cmdline.is_input("\<Up>") && !a:cmdline.is_input("\<Down>")
\ && !a:cmdline.is_input("\<C-p>") && !a:cmdline.is_input("\<C-n>")
call s:_reset()
return
else
if s:count == 0 && empty(s:cmdhist)
\ || s:is_match_mode != s:_should_match_cmdline(a:cmdline)
let cmdline = '^' . a:cmdline.getline()
let s:is_match_mode = s:_should_match_cmdline(a:cmdline)
let s:cmdhist = [a:cmdline.getline()] + (s:is_match_mode ?
\ filter(self.histories(), 'v:val =~ cmdline') : self.histories())
endif
endif
call a:cmdline.setchar("")
if a:cmdline.is_input("\<Down>") || a:cmdline.is_input("\<C-n>")
let s:count = max([s:count - 1, 0])
endif
if a:cmdline.is_input("\<Up>") || a:cmdline.is_input("\<C-p>")
let s:count = min([s:count + 1, len(s:cmdhist)])
endif
call a:cmdline.setline(get(s:cmdhist, s:count, a:cmdline.getline()))
endfunction
2 0.000004 function! s:make(...)
let module = deepcopy(s:module)
let module.mode = get(a:, 1, "cmd")
return module
endfunction
2 0.000015 let &cpo = s:save_cpo
2 0.000006 unlet s:save_cpo
SCRIPT /home/x/.vim/plugged/incsearch.vim/autoload/vital/_incsearch/Over/Commandline/Modules/NoInsert.vim
Sourced 2 times
Total time: 1507493888.717885
Self time: 1507493888.717798
count total (s) self (s)
" ___vital___
" NOTE: lines between '" ___vital___' is generated by :Vitalize.
" Do not mofidify the code nor insert new lines before '" ___vital___'
2 0.000007 if v:version > 703 || v:version == 703 && has('patch1170')
2 0.000070 function! vital#_incsearch#Over#Commandline#Modules#NoInsert#import() abort
return map({'make_special_chars': '', 'make': ''}, 'function("s:" . v:key)')
endfunction
2 0.000002 else
function! s:_SID() abort
return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze__SID$')
endfunction
execute join(['function! vital#_incsearch#Over#Commandline#Modules#NoInsert#import() abort', printf("return map({'make_special_chars': '', 'make': ''}, \"function('<SNR>%s_' . v:key)\")", s:_SID()), 'endfunction'], "\n")
delfunction s:_SID
endif
" ___vital___
2 0.000002 scriptencoding utf-8
2 0.000017 let s:save_cpo = &cpo
2 0.000015 set cpo&vim
2 0.000010 let s:module = {
\ "name" : "NoInsert",
\ "chars" : []
\}
2 0.000004 function! s:module.is_no_insert(char)
return index(self.chars, a:char) >= 0
endfunction
2 0.000003 function! s:module.on_char_pre(cmdline)
if self.is_no_insert(a:cmdline.char())
call a:cmdline.setchar("", 0)
endif
endfunction
2 0.000004 function! s:make(chars)
let module = deepcopy(s:module)
let module.chars = type(a:chars) == type([]) ? a:chars : [a:chars]
return module
endfunction
2 0.000005 function! s:make_special_chars()
let module = s:make([])
function! module.is_no_insert(char)
return char2nr(a:char) == 128 || char2nr(a:char) < 27
endfunction
return module
endfunction
2 0.000015 let &cpo = s:save_cpo
2 0.000004 unlet s:save_cpo
SCRIPT /home/x/.vim/plugged/incsearch.vim/autoload/vital/_incsearch/Over/Commandline/Modules/KeyMapping.vim
Sourced 2 times
Total time: 1507493888.718611
Self time: 1507493888.718478
count total (s) self (s)
" ___vital___
" NOTE: lines between '" ___vital___' is generated by :Vitalize.
" Do not mofidify the code nor insert new lines before '" ___vital___'
2 0.000007 if v:version > 703 || v:version == 703 && has('patch1170')
2 0.000063 function! vital#_incsearch#Over#Commandline#Modules#KeyMapping#import() abort
return map({'_vital_depends': '', 'make_emacs': '', 'make_vim_cmdline_mapping': '', '_vital_loaded': ''}, 'function("s:" . v:key)')
endfunction
2 0.000002 else
function! s:_SID() abort
return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze__SID$')
endfunction
execute join(['function! vital#_incsearch#Over#Commandline#Modules#KeyMapping#import() abort', printf("return map({'_vital_depends': '', 'make_emacs': '', 'make_vim_cmdline_mapping': '', '_vital_loaded': ''}, \"function('<SNR>%s_' . v:key)\")", s:_SID()), 'endfunction'], "\n")
delfunction s:_SID
endif
" ___vital___
2 0.000004 scriptencoding utf-8
2 0.000016 let s:save_cpo = &cpo
2 0.000014 set cpo&vim
2 0.000006 function! s:_vital_loaded(V)
let s:Keymapping = a:V.import("Palette.Keymapping")
endfunction
2 0.000003 function! s:_vital_depends()
return [
\ "Palette.Keymapping",
\ ]
endfunction
2 0.000008 let s:emacs = {
\ "name" : "KeyMapping_emacs_like"
\}
2 0.000005 function! s:emacs.keymapping(cmdline)
return {
\ "\<C-f>" : {
\ "key" : "\<Right>",
\ "noremap" : 1,
\ "lock" : 1,
\ },
\ "\<C-b>" : {
\ "key" : "\<Left>",
\ "noremap" : 1,
\ "lock" : 1,
\ },
\ "\<C-n>" : {
\ "key" : "\<Down>",
\ "noremap" : 1,
\ "lock" : 1,
\ },
\ "\<C-p>" : {
\ "key" : "\<Up>",
\ "noremap" : 1,
\ "lock" : 1,
\ },
\ "\<C-a>" : {
\ "key" : "\<Home>",
\ "noremap" : 1,
\ "lock" : 1,
\ },
\ "\<C-e>" : {
\ "key" : "\<End>",
\ "noremap" : 1,
\ "lock" : 1,
\ },
\ "\<C-d>" : {
\ "key" : "\<Del>",
\ "noremap" : 1,
\ "lock" : 1,
\ },
\ "\<A-d>" : {
\ "key" : "\<C-w>",
\ "noremap" : 1,
\ "lock" : 1,
\ },
\ "\<A-b>" : {
\ "key" : "\<S-Left>",
\ "noremap" : 1,
\ "lock" : 1,
\ },
\ "\<A-f>" : {
\ "key" : "\<S-Right>",
\ "noremap" : 1,
\ "lock" : 1,
\ },
\ }
endfunction
2 0.000003 function! s:make_emacs()
return deepcopy(s:emacs)
endfunction
2 0.000011 let s:vim_cmdline_mapping = {
\ "name" : "KeyMapping_vim_cmdline_mapping",
\ "_cmaps" : {}
\}
2 0.000004 function! s:_convert_sid(rhs, sid) abort
return substitute(a:rhs, '<SID>', '<SNR>' . a:sid . '_', 'g')
endfunction
2 0.000003 function! s:_auto_cmap()
let cmaps = {}
let cmap_info = s:Keymapping.rhs_key_list("c", 0, 1)
" vital-over currently doesn't support <buffer> mappings
for c in filter(cmap_info, "v:val['buffer'] ==# 0")
let cmaps[s:Keymapping.escape_special_key(c['lhs'])] = {
\ 'noremap' : c['noremap'],
\ 'key' : s:Keymapping.escape_special_key(s:_convert_sid(c['rhs'], c['sid'])),
\ 'expr' : s:Keymapping.escape_special_key(c['expr']),
\ }
endfor
return cmaps
endfunction
2 0.000004 function! s:vim_cmdline_mapping.on_enter(cmdline)
let self._cmaps = s:_auto_cmap()
endfunction
2 0.000005 function! s:vim_cmdline_mapping.keymapping(cmdline)
return self._cmaps
endfunction
2 0.000004 function! s:make_vim_cmdline_mapping()
return deepcopy(s:vim_cmdline_mapping)
endfunction
2 0.000016 let &cpo = s:save_cpo
2 0.000006 unlet s:save_cpo
SCRIPT /home/x/.vim/plugged/incsearch.vim/autoload/vital/_incsearch/Palette/Keymapping.vim
Sourced 2 times
Total time: 1507493888.719358
Self time: 1507493888.719213
count total (s) self (s)
" ___vital___
" NOTE: lines between '" ___vital___' is generated by :Vitalize.
" Do not mofidify the code nor insert new lines before '" ___vital___'
2 0.000009 if v:version > 703 || v:version == 703 && has('patch1170')
2 0.000094 function! vital#_incsearch#Palette#Keymapping#import() abort
return map({'capture': '', '_vital_depends': '', 'escape_special_key': '', 'rhs_key_list': '', 'parse_lhs_list': '', 'lhs_key_list': '', 'capture_list': '', 'parse_lhs': '', '_vital_loaded': ''}, 'function("s:" . v:key)')
endfunction
2 0.000002 else
function! s:_SID() abort
return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze__SID$')
endfunction
execute join(['function! vital#_incsearch#Palette#Keymapping#import() abort', printf("return map({'capture': '', '_vital_depends': '', 'escape_special_key': '', 'rhs_key_list': '', 'parse_lhs_list': '', 'lhs_key_list': '', 'capture_list': '', 'parse_lhs': '', '_vital_loaded': ''}, \"function('<SNR>%s_' . v:key)\")", s:_SID()), 'endfunction'], "\n")
delfunction s:_SID
endif
" ___vital___
2 0.000003 scriptencoding utf-8
2 0.000014 let s:save_cpo = &cpo
2 0.000016 set cpo&vim
2 0.000005 let s:modep = "[nvoicsxl]"
2 0.000005 function! s:_vital_loaded(V)
let s:V = a:V
let s:Capture = s:V.import("Palette.Capture")
endfunction
2 0.000004 function! s:_vital_depends()
return [
\ "Palette.Capture",
\ ]
endfunction
2 0.000004 function! s:_capture(mode)
let cmd = "map"
if a:mode ==# "!"
let cmd = cmd . "!"
elseif a:mode =~# "[nvoicsxl]"
let cmd = a:mode . cmd
endif
return s:Capture.command(cmd)
endfunction
2 0.000004 function! s:capture(...)
let mode = get(a:, 1, "")
let modes = split(mode, '\zs')
return join(map(modes, "s:_capture(v:val)"), "\n")
endfunction
2 0.000004 function! s:_keymapping(str)
return a:str =~ '^[!nvoicsxl]\s'
endfunction
2 0.000004 function! s:capture_list(...)
let mode = get(a:, 1, "")
return filter(split(s:capture(mode), "\n"), "s:_keymapping(v:val)")
endfunction
2 0.000005 function! s:escape_special_key(key)
" Workaround : <C-?> https://github.com/osyo-manga/vital-palette/issues/5
if a:key ==# "<^?>"
return "\<C-?>"
endif
execute 'let result = "' . substitute(escape(a:key, '\"'), '\(<.\{-}>\)', '\\\1', 'g') . '"'
return result
endfunction
2 0.000004 function! s:parse_lhs(text, ...)
let mode = get(a:, 1, '[!nvoicsxl]')
" NOTE: :map! Surpport : https://github.com/osyo-manga/vital-palette/issues/4
if get(a:, 1, "") =~# '[!ci]'
let mode = '[!ci]'
endif
return matchstr(a:text, mode . '\{1,3\}\s*\zs\S\{-}\ze\s\+')
endfunction
2 0.000004 function! s:parse_lhs_list(...)
let mode = get(a:, 1, "")
return map(s:capture_list(mode), "s:parse_lhs(v:val, mode)")
endfunction
2 0.000004 function! s:lhs_key_list(...)
let mode = get(a:, 1, "")
return map(s:parse_lhs_list(mode), "s:escape_special_key(v:val)")
endfunction
2 0.000005 function! s:_maparg(name, mode, abbr, dict)
" Workaround : <C-?> https://github.com/osyo-manga/vital-palette/issues/5
if a:name ==# "<^?>"
return maparg("\<C-?>", a:mode, a:abbr, a:dict)
endif
return maparg(a:name, a:mode, a:abbr, a:dict)
endfunction
2 0.000003 function! s:rhs_key_list(...)
let mode = get(a:, 1, "")
let abbr = get(a:, 2, 0)
let dict = get(a:, 3, 0)
let result = []
for m in split(mode, '\zs')
let result += map(s:parse_lhs_list(m), "s:_maparg(v:val, m, abbr, dict)")
endfor
return filter(result, "empty(v:val) == 0")
endfunction
2 0.000017 let &cpo = s:save_cpo
2 0.000005 unlet s:save_cpo
SCRIPT /home/x/.vim/plugged/incsearch.vim/autoload/vital/_incsearch/Palette/Capture.vim
Sourced 2 times
Total time: 1507493888.719974
Self time: 1507493888.719869
count total (s) self (s)
" ___vital___
" NOTE: lines between '" ___vital___' is generated by :Vitalize.
" Do not mofidify the code nor insert new lines before '" ___vital___'
2 0.000008 if v:version > 703 || v:version == 703 && has('patch1170')
2 0.000075 function! vital#_incsearch#Palette#Capture#import() abort
return map({'extend': '', 'command': ''}, 'function("s:" . v:key)')
endfunction
2 0.000002 else
function! s:_SID() abort
return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze__SID$')
endfunction
execute join(['function! vital#_incsearch#Palette#Capture#import() abort', printf("return map({'extend': '', 'command': ''}, \"function('<SNR>%s_' . v:key)\")", s:_SID()), 'endfunction'], "\n")
delfunction s:_SID
endif
" ___vital___
2 0.000004 scriptencoding utf-8
2 0.000018 let s:save_cpo = &cpo
2 0.000017 set cpo&vim
2 0.000004 let s:verbosefiles = []
2 0.000004 function! s:_verbosefile_push(file)
call add(s:verbosefiles, &verbosefile)
let &verbosefile = a:file
return a:file
endfunction
2 0.000004 function! s:_verbosefile_pop()
let filename = &verbosefile
let &verbosefile = get(s:verbosefiles, -1)
call remove(s:verbosefiles, -1)
return filename
endfunction
2 0.000003 function! s:_reset()
let s:verbosefiles = []
endfunction
2 0.000004 function! s:extend(dict, src)
for [key, value] in items(a:src)
let a:dict[key] = value
unlet value
endfor
endfunction
2 0.000004 function! s:command(cmd, ...)
" Workaround : Vim 7.3.xxx in Travis and Ubuntu
" https://github.com/osyo-manga/vital-palette/issues/5
" call extend(l:, get(a:, 1, {}))
if a:0 > 0
call s:extend(l:, a:1)
endif
call s:_verbosefile_push(tempname())
try
redir =>result
silent execute a:cmd
finally
redir END
endtry
call s:_verbosefile_pop()
" let result = substitute(result, "<SRN>", "\<SNR>", "g")
" let result = substitute(result, "<SID>", "\<SID>", "g")
return result
endfunction
2 0.000016 let &cpo = s:save_cpo
2 0.000005 unlet s:save_cpo
SCRIPT /home/x/.vim/plugged/incsearch.vim/autoload/vital/_incsearch/Over/Commandline/Modules/IgnoreRegexpBackwardWord.vim
Sourced 2 times
Total time: 1507493888.720650
Self time: 1507493888.720563
count total (s) self (s)
" ___vital___
" NOTE: lines between '" ___vital___' is generated by :Vitalize.
" Do not mofidify the code nor insert new lines before '" ___vital___'
2 0.000008 if v:version > 703 || v:version == 703 && has('patch1170')
2 0.000079 function! vital#_incsearch#Over#Commandline#Modules#IgnoreRegexpBackwardWord#import() abort
return map({'backward_word': '', 'make': ''}, 'function("s:" . v:key)')
endfunction
2 0.000002 else
function! s:_SID() abort
return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze__SID$')
endfunction
execute join(['function! vital#_incsearch#Over#Commandline#Modules#IgnoreRegexpBackwardWord#import() abort', printf("return map({'backward_word': '', 'make': ''}, \"function('<SNR>%s_' . v:key)\")", s:_SID()), 'endfunction'], "\n")
delfunction s:_SID
endif
" ___vital___
2 0.000004 scriptencoding utf-8
2 0.000013 let s:save_cpo = &cpo
2 0.000014 set cpo&vim
" Improved backward word detection which ignore regular expression
2 0.000009 let s:module = {
\ "name" : "IgnoreRegexpBackwardWord"
\}
2 0.000004 function! s:backward_word(str, ...)
let pat = get(a:, 1, '\k\+\s*\|.')
let flags = s:non_escaped_backslash .
\ '\%(' . 'z[se]' .
\ '\|' . '[iIkKfFpPsSdDxXoOwWhHaAlLuUetrbncCZmMvV]' .
\ '\|' . '%[dxouUCVlcv]' .
\ '\|' . "%'[a-zA-Z]" .
\ '\|' . '%#=\d' .
\ '\|' . 'z\=\d' .
\ '\)'
return matchstr(get(split(a:str, flags . '\s*\zs'), -1, ""),
\ '\%(' . flags . '\s*\|' . pat . '\)$')
endfunction
2 0.000006 let s:non_escaped_backslash = '\m\%(\%(^\|[^\\]\)\%(\\\\\)*\)\@<=\\'
2 0.000004 function! s:module.on_enter(cmdline)
function! a:cmdline.backward_word(...)
return call("s:backward_word", [self.backward()] + a:000)
endfunction
endfunction
2 0.000004 function! s:make()
return deepcopy(s:module)
endfunction
2 0.000016 let &cpo = s:save_cpo
2 0.000004 unlet s:save_cpo
SCRIPT /home/x/.vim/plugged/incsearch.vim/autoload/incsearch/over/modules/module_management.vim
Sourced 1 time
Total time: 0.000069
Self time: 0.000069
count total (s) self (s)
"=============================================================================
" FILE: autoload/incsearch/over/modules/module_management.vim
" AUTHOR: haya14busa
" License: MIT license
"=============================================================================
1 0.000002 scriptencoding utf-8
1 0.000007 let s:save_cpo = &cpo
1 0.000008 set cpo&vim
1 0.000005 let s:module_management = {
\ 'name' : 'IncsearchModuleManagement',
\ 'modules' : [ ]
\}
1 0.000002 function! s:module_management.on_enter(cmdline) abort
if !exists('s:default_backward_word')
let s:default_backward_word = a:cmdline.backward_word
endif
for module in self.modules
if has_key(module, '_condition') && ! module._condition()
call a:cmdline.disconnect(module.name)
if module.name ==# 'IgnoreRegexpBackwardWord'
function! a:cmdline.backward_word(...) abort
return call(s:default_backward_word, a:000, self)
endfunction
endif
elseif empty(a:cmdline.get_module(module.name))
call a:cmdline.connect(module)
if has_key(module, 'on_enter')
call module.on_enter(a:cmdline)
endif
endif
endfor
endfunction
1 0.000002 function! s:module_management.priority(event) abort
" NOTE: to overwrite backward_word() with default function
return a:event ==# 'on_enter' ? 5 : 0
endfunction
1 0.000005 function! incsearch#over#modules#module_management#make(modules) abort
let m = deepcopy(s:module_management)
let m.modules = a:modules
return m
endfunction
1 0.000008 let &cpo = s:save_cpo
1 0.000002 unlet s:save_cpo
" __END__
" vim: expandtab softtabstop=2 shiftwidth=2 foldmethod=marker
SCRIPT /home/x/.vim/plugged/incsearch.vim/autoload/incsearch/over/modules/pattern_saver.vim
Sourced 1 time
Total time: 0.000065
Self time: 0.000065
count total (s) self (s)
"=============================================================================
" FILE: autoload/incsearch/over/modules/pattern_saver.vim
" AUTHOR: haya14busa
" License: MIT license
" @vimlint(EVL103, 1, a:cmdline)
"=============================================================================
1 0.000002 scriptencoding utf-8
1 0.000007 let s:save_cpo = &cpo
1 0.000008 set cpo&vim
1 0.000005 let s:pattern_saver = {
\ 'name' : 'PatternSaver',
\ 'pattern' : '',
\ 'hlsearch' : &hlsearch
\}
1 0.000002 function! s:pattern_saver.on_enter(cmdline) abort
if ! g:incsearch#no_inc_hlsearch
let self.pattern = @/
let self.hlsearch = &hlsearch
if exists('v:hlsearch')
let self.vhlsearch = v:hlsearch
endif
set hlsearch | nohlsearch
endif
endfunction
1 0.000002 function! s:pattern_saver.on_leave(cmdline) abort
if ! g:incsearch#no_inc_hlsearch
let is_cancel = a:cmdline.exit_code()
if is_cancel
let @/ = self.pattern
endif
let &hlsearch = self.hlsearch
if exists('v:hlsearch')
let v:hlsearch = self.vhlsearch
endif
endif
endfunction
1 0.000004 function! incsearch#over#modules#pattern_saver#make() abort
return deepcopy(s:pattern_saver)
endfunction
1 0.000008 let &cpo = s:save_cpo
1 0.000001 unlet s:save_cpo
" __END__
" vim: expandtab softtabstop=2 shiftwidth=2 foldmethod=marker
SCRIPT /home/x/.vim/plugged/incsearch.vim/autoload/incsearch/over/modules/bulk_input_char.vim
Sourced 1 time
Total time: 0.000061
Self time: 0.000061
count total (s) self (s)
"=============================================================================
" FILE: autoload/incsearch/over/modules/bulk_input_char.vim
" AUTHOR: haya14busa
" License: MIT license
"=============================================================================
1 0.000002 scriptencoding utf-8
1 0.000007 let s:save_cpo = &cpo
1 0.000008 set cpo&vim
" IncsearchBulkInputChar bulk insert characters and avoid updating for each
" character input. It's useful while execution macro or pasting text clipboard.
" CAUTION: cannot test getchar(0) with themis.vim
1 0.000004 let s:bulk_input_char = {
\ 'name': 'IncsearchBulkInputChar'
\ }
1 0.000003 function! s:bulk_input_char.on_char_pre(cmdline) abort
let stack = []
let c = 1
while c
let c = getchar(0)
if c != 0
let stack += [nr2char(c)]
elseif !empty(stack)
call a:cmdline.set_input_key_stack(stack)
endif
endwhile
endfunction
1 0.000004 function! incsearch#over#modules#bulk_input_char#make() abort
return deepcopy(s:bulk_input_char)
endfunction
1 0.000008 let &cpo = s:save_cpo
1 0.000002 unlet s:save_cpo
" __END__
" vim: expandtab softtabstop=2 shiftwidth=2 foldmethod=marker
SCRIPT /home/x/.vim/plugged/incsearch.vim/autoload/incsearch/over/modules/bracketed_paste.vim
Sourced 1 time
Total time: 0.000060
Self time: 0.000060
count total (s) self (s)
"=============================================================================
" FILE: autoload/incsearch/over/modules/bracketed_paste.vim
" AUTHOR: haya14busa
" License: MIT license
" @vimlint(EVL103, 1, a:cmdline)
"=============================================================================
1 0.000002 scriptencoding utf-8
1 0.000007 let s:save_cpo = &cpo
1 0.000008 set cpo&vim
" https://github.com/haya14busa/incsearch.vim/issues/131
1 0.000004 let s:bracketed_paste = {
\ 'name' : 'BracketedPaste',
\ 't_BE' : '',
\}
1 0.000002 function! s:bracketed_paste.on_enter(cmdline) abort
if !exists('&t_BE')
return
endif
let self.t_BE = &t_BE
set t_BE=
endfunction
1 0.000002 function! s:bracketed_paste.on_leave(cmdline) abort
if !exists('&t_BE')
return
endif
let &t_BE = self.t_BE
endfunction
1 0.000005 function! incsearch#over#modules#bracketed_paste#make() abort
return deepcopy(s:bracketed_paste)
endfunction
1 0.000008 let &cpo = s:save_cpo
1 0.000002 unlet s:save_cpo
" __END__
" vim: expandtab softtabstop=2 shiftwidth=2 foldmethod=marker
SCRIPT /home/x/.vim/plugged/incsearch.vim/autoload/incsearch/over/modules/incsearch.vim
Sourced 1 time
Total time: 0.009923
Self time: 0.000304
count total (s) self (s)
"=============================================================================
" FILE: autoload/incsearch/over/modules/incsearch.vim
" AUTHOR: haya14busa
" License: MIT license
"=============================================================================
1 0.000002 scriptencoding utf-8
1 0.000007 let s:save_cpo = &cpo
1 0.000007 set cpo&vim
1 0.000002 let s:TRUE = !0
1 0.000002 let s:FALSE = 0
1 0.000003 let s:DIRECTION = { 'forward': 1, 'backward': 0 } " see :h v:searchforward
1 0.000055 let s:hi = g:incsearch#highlight#_hi
1 0.000114 0.000007 let s:U = incsearch#util#import()
1 0.000004 let s:inc = {
\ 'name' : 'incsearch',
\}
" NOTE: for InsertRegister handling
1 0.000002 function! s:inc.priority(event) abort
return a:event is# 'on_char' ? 10 : 0
endfunction
1 0.000002 function! s:inc.on_enter(cmdline) abort
nohlsearch " disable previous highlight
let a:cmdline._w = winsaveview()
let hgm = incsearch#highlight#hgm()
let c = hgm.cursor
call s:hi.add(c.group, c.group, '\%#', c.priority)
call incsearch#highlight#update()
" XXX: Manipulate search history for magic option
" In the first place, I want to omit magic flag when histadd(), but
" when returning cmd as expr mapping and feedkeys() cannot handle it, so
" remove no user intended magic flag at on_enter.
" Maybe I can also handle it with autocmd, should I use autocmd instead?
let hist = histget('/', -1)
if len(hist) > 2 && hist[:1] ==# incsearch#magic()
call histdel('/', -1)
call histadd('/', hist[2:])
endif
endfunction
1 0.000001 function! s:inc.on_leave(cmdline) abort
call s:hi.disable_all()
call s:hi.delete_all()
" redraw: hide pseud-cursor
redraw " need to redraw for handling non-<expr> mappings
if a:cmdline.getline() ==# ''
echo ''
else
echo a:cmdline.get_prompt() . a:cmdline.getline()
endif
" NOTE:
" push rest of keymappings with feedkeys()
" FIXME: assume 'noremap' but it should take care wheter or not the
" mappings should be remapped or not
if a:cmdline.input_key_stack_string() !=# ''
call feedkeys(a:cmdline.input_key_stack_string(), 'n')
endif
endfunction
" Avoid search-related error while incremental searching
1 0.000007 function! s:on_searching(func, ...) abort
try
return call(a:func, a:000)
catch /E16:/ " E16: Invalid range (with /\_[a- )
catch /E33:/ " E33: No previous substitute regular expression
catch /E53:/ " E53: Unmatched %(
catch /E54:/
catch /E55:/
catch /E62:/ " E62: Nested \= (with /a\=\=)
catch /E63:/ " E63: invalid use of \_
catch /E64:/ " E64: \@ follows nothing
catch /E65:/ " E65: Illegal back reference
catch /E66:/ " E66: \z( not allowed here
catch /E67:/ " E67: \z1 et al. not allowed here
catch /E68:/ " E68: Invalid character after \z (with /\za & re=1)
catch /E69:/ " E69: Missing ] after \%[
catch /E70:/ " E70: Empty \%[]
catch /E71:/ " E71: Invalid character after \%
catch /E554:/
catch /E678:/ " E678: Invalid character after \%[dxouU]
catch /E864:/ " E864: \%#= can only be followed by 0, 1, or 2. The
" automatic engine will be used
catch /E865:/ " E865: (NFA) Regexp end encountered prematurely
catch /E866:/ " E866: (NFA regexp) Misplaced @
catch /E867:/ " E867: (NFA) Unknown operator
catch /E869:/ " E869: (NFA) Unknown operator '\@m
catch /E870:/ " E870: (NFA regexp) Error reading repetition limits
catch /E871:/ " E871: (NFA regexp) Can't have a multi follow a multi !
catch /E874:/ " E874: (NFA) Could not pop the stack ! (with \&)
catch /E877:/ " E877: (NFA regexp) Invalid character class: 109
catch /E888:/ " E888: (NFA regexp) cannot repeat (with /\ze*)
call s:hi.disable_all()
catch
echohl ErrorMsg | echom v:throwpoint . ' ' . v:exception | echohl None
endtry
endfunction
1 0.000003 function! s:on_char_pre(cmdline) abort
" NOTE:
" `:call a:cmdline.setchar('')` as soon as possible!
let [raw_pattern, offset] = a:cmdline._parse_pattern()
let pattern = a:cmdline._convert(raw_pattern)
" Interactive :h last-pattern if pattern is empty
if ( a:cmdline.is_input('<Over>(incsearch-next)')
\ || a:cmdline.is_input('<Over>(incsearch-prev)')
\ ) && empty(pattern)
call a:cmdline.setchar('')
" Use history instead of @/ to work with magic option and converter
call a:cmdline.setline(histget('/', -1) . (empty(offset) ? '' : a:cmdline._base_key) . offset)
" Just insert last-pattern and do not count up, but the incsearch-prev
" should move the cursor to reversed directly, so do not return if the
" command is prev
if a:cmdline.is_input('<Over>(incsearch-next)') | return | endif
endif
if a:cmdline.is_input('<Over>(incsearch-next)')
call a:cmdline.setchar('')
if a:cmdline._flag ==# 'n' " exit stay mode
let a:cmdline._flag = ''
else
let a:cmdline._vcount1 += 1
endif
elseif a:cmdline.is_input('<Over>(incsearch-prev)')
call a:cmdline.setchar('')
if a:cmdline._flag ==# 'n' " exit stay mode
let a:cmdline._flag = ''
endif
let a:cmdline._vcount1 -= 1
elseif (a:cmdline.is_input('<Over>(incsearch-scroll-f)')
\ && (a:cmdline._flag ==# '' || a:cmdline._flag ==# 'n'))
\ || (a:cmdline.is_input('<Over>(incsearch-scroll-b)') && a:cmdline._flag ==# 'b')
call a:cmdline.setchar('')
if a:cmdline._flag ==# 'n' | let a:cmdline._flag = '' | endif
let pos_expr = a:cmdline.is_input('<Over>(incsearch-scroll-f)') ? 'w$' : 'w0'
let to_col = a:cmdline.is_input('<Over>(incsearch-scroll-f)')
\ ? s:U.get_max_col(pos_expr) : 1
let [from, to] = [getpos('.')[1:2], [line(pos_expr), to_col]]
let cnt = s:U.count_pattern(pattern, from, to)
let a:cmdline._vcount1 += cnt
elseif (a:cmdline.is_input('<Over>(incsearch-scroll-b)')
\ && (a:cmdline._flag ==# '' || a:cmdline._flag ==# 'n'))
\ || (a:cmdline.is_input('<Over>(incsearch-scroll-f)') && a:cmdline._flag ==# 'b')
call a:cmdline.setchar('')
if a:cmdline._flag ==# 'n'
let a:cmdline._flag = ''
let a:cmdline._vcount1 -= 1
endif
let pos_expr = a:cmdline.is_input('<Over>(incsearch-scroll-f)') ? 'w$' : 'w0'
let to_col = a:cmdline.is_input('<Over>(incsearch-scroll-f)')
\ ? s:U.get_max_col(pos_expr) : 1
let [from, to] = [getpos('.')[1:2], [line(pos_expr), to_col]]
let cnt = s:U.count_pattern(pattern, from, to)
let a:cmdline._vcount1 -= cnt
endif
" Handle nowrapscan:
" if you `:set nowrapscan`, you can't move to the reversed direction
if !&wrapscan && (
\ a:cmdline.is_input('<Over>(incsearch-next)')
\ || a:cmdline.is_input('<Over>(incsearch-prev)')
\ || a:cmdline.is_input('<Over>(incsearch-scroll-f)')
\ || a:cmdline.is_input('<Over>(incsearch-scroll-b)')
\ )
if a:cmdline._vcount1 < 1
let a:cmdline._vcount1 = 1
else
call a:cmdline.setchar('')
let [from, to] = [[a:cmdline._w.lnum, a:cmdline._w.col + 1],
\ a:cmdline._flag !=# 'b'
\ ? [line('$'), s:U.get_max_col('$')]
\ : [1, 1]
\ ]
let max_cnt = s:U.count_pattern(pattern, from, to, s:TRUE)
let a:cmdline._vcount1 = min([max_cnt, a:cmdline._vcount1])
endif
endif
if &wrapscan && a:cmdline._vcount1 < 1
let a:cmdline._vcount1 += s:U.count_pattern(pattern)
endif
endfunction
1 0.000002 function! s:on_char(cmdline) abort
if a:cmdline._does_exit_from_incsearch
return
endif
let [raw_pattern, offset] = a:cmdline._parse_pattern()
if raw_pattern ==# ''
call s:hi.disable_all()
nohlsearch
return
endif
" For InsertRegister
if a:cmdline.get_tap_key() ==# "\<C-r>"
let p = a:cmdline.getpos()
" Remove `"`
let raw_pattern = raw_pattern[:p-1] . raw_pattern[p+1:]
let w = winsaveview()
call cursor(line('.'), col('.') + len(a:cmdline.backward_word()))
call a:cmdline.get_module('InsertRegister').reset()
call winrestview(w)
endif
let pattern = a:cmdline._convert(raw_pattern)
" Improved Incremental cursor move!
call s:move_cursor(a:cmdline, pattern, offset)
" Improved Incremental highlighing!
" case: because matchadd() doesn't handle 'ignorecase' nor 'smartcase'
let case = incsearch#detect_case(raw_pattern)
let should_separate = g:incsearch#separate_highlight && a:cmdline._flag !=# 'n'
let pattern_for_hi =
\ (a:cmdline._flag is# 'b' ? s:unescape_question_for_backward(pattern) : pattern)
\ . case
call incsearch#highlight#incremental_highlight(
\ pattern_for_hi,
\ should_separate,
\ a:cmdline._direction,
\ [a:cmdline._w.lnum, a:cmdline._w.col])
" functional `normal! zz` after scroll for <expr> mappings
if ( a:cmdline.is_input('<Over>(incsearch-scroll-f)')
\ || a:cmdline.is_input('<Over>(incsearch-scroll-b)'))
call winrestview({'topline': max([1, line('.') - winheight(0) / 2])})
endif
endfunction
" Caveat: It handle :h last-pattern, so be careful if you want to pass empty
" string as a pattern
1 0.000003 function! s:move_cursor(cli, pattern, ...) abort
let offset = get(a:, 1, '')
if a:cli._flag ==# 'n' " skip if stay mode
return
endif
call winrestview(a:cli._w)
" pseud-move cursor position: this is restored afterward if called by
" <expr> mappings
if a:cli._is_expr
for _ in range(a:cli._vcount1)
" NOTE: This cannot handle {offset} for cursor position
call search(a:pattern, a:cli._flag)
endfor
else
" More precise cursor position while searching
" Caveat:
" This block contains `normal`, please make sure <expr> mappings
" doesn't reach this block
let is_visual_mode = s:U.is_visual(mode(1))
let cmd = incsearch#with_ignore_foldopen(
\ s:U.dictfunction(a:cli._build_search_cmd, a:cli),
\ a:cli._combine_pattern(a:pattern, offset), 'n')
" NOTE:
" :silent!
" Shut up errors! because this is just for the cursor emulation
" while searching
silent! call incsearch#execute_search(cmd)
if is_visual_mode
let w = winsaveview()
normal! gv
call winrestview(w)
call incsearch#highlight#emulate_visual_highlight()
endif
endif
endfunction
1 0.000002 function! s:inc.on_char_pre(cmdline) abort
call s:on_searching(function('s:on_char_pre'), a:cmdline)
endfunction
1 0.000002 function! s:inc.on_char(cmdline) abort
call s:on_searching(function('s:on_char'), a:cmdline)
endfunction
1 0.000003 function! s:unescape_question_for_backward(pattern) abort
return substitute(a:pattern, '\\?', '?', 'g')
endfunction
1 0.000005 function! incsearch#over#modules#incsearch#make() abort
return deepcopy(s:inc)
endfunction
1 0.000008 let &cpo = s:save_cpo
1 0.000002 unlet s:save_cpo
" __END__
" vim: expandtab softtabstop=2 shiftwidth=2 foldmethod=marker
SCRIPT /home/x/.vim/plugged/incsearch.vim/autoload/incsearch/highlight.vim
Sourced 1 time
Total time: 0.009496
Self time: 0.000445
count total (s) self (s)
"=============================================================================
" FILE: autoload/incsearch/highlight.vim
" AUTHOR: haya14busa
" License: MIT license {{{
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the
" "Software"), to deal in the Software without restriction, including
" without limitation the rights to use, copy, modify, merge, publish,
" distribute, sublicense, and/or sell copies of the Software, and to
" permit persons to whom the Software is furnished to do so, subject to
" the following conditions:
"
" The above copyright notice and this permission notice shall be included
" in all copies or substantial portions of the Software.
"
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
" IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
" CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
" TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
" SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
" }}}
"=============================================================================
1 0.000002 scriptencoding utf-8
" Saving 'cpoptions' {{{
1 0.000007 let s:save_cpo = &cpo
1 0.000007 set cpo&vim
" }}}
1 0.000002 let s:TRUE = !0
1 0.000002 let s:FALSE = 0
1 0.000003 let s:DIRECTION = { 'forward': 1, 'backward': 0 } " see :h v:searchforward
" Utility Helper:
1 0.000112 0.000008 let s:U = incsearch#util#import()
" Management:
1 0.000021 0.000006 let s:V = vital#incsearch#of()
1 0.008910 0.000019 let s:hi = s:V.import('Coaster.Highlight').make()
1 0.000003 let g:incsearch#highlight#_hi = s:hi
1 0.000008 function! incsearch#highlight#update() abort
" it's intuiive to call incsearch#highlight#on() & off() but there are no
" need to execute `:nohlsearch` when updating.
call s:hi.disable_all()
call s:hi.enable_all()
endfunction
1 0.000003 function! incsearch#highlight#on() abort
call s:hi.enable_all()
if ! g:incsearch#no_inc_hlsearch
let &hlsearch = &hlsearch
endif
endfunction
1 0.000003 function! incsearch#highlight#off() abort
call s:hi.disable_all()
if ! g:incsearch#no_inc_hlsearch
nohlsearch
endif
endfunction
1 0.000002 function! s:init_hl() abort
hi default link IncSearchMatch Search
hi default link IncSearchMatchReverse IncSearch
hi default link IncSearchCursor Cursor
hi default link IncSearchOnCursor IncSearch
hi default IncSearchUnderline term=underline cterm=underline gui=underline
endfunction
1 0.000050 0.000009 call s:init_hl()
1 0.000003 augroup plugin-incsearch-highlight
1 0.000078 autocmd!
1 0.000006 autocmd ColorScheme * call s:init_hl()
1 0.000002 augroup END
1 0.000017 let s:default_highlight = {
\ 'visual' : {
\ 'group' : '_IncSearchVisual',
\ 'priority' : '10'
\ },
\ 'match' : {
\ 'group' : 'IncSearchMatch',
\ 'priority' : '49'
\ },
\ 'match_reverse' : {
\ 'group' : 'IncSearchMatchReverse',
\ 'priority' : '49'
\ },
\ 'on_cursor' : {
\ 'group' : 'IncSearchOnCursor',
\ 'priority' : '50'
\ },
\ 'cursor' : {
\ 'group' : 'IncSearchCursor',
\ 'priority' : '51'
\ },
\ }
1 0.000004 function! incsearch#highlight#hgm() abort " highlight group management
let hgm = copy(s:default_highlight)
for key in keys(hgm)
call extend(hgm[key], get(g:incsearch#highlight, key, {}))
endfor
return hgm
endfunction
" hldict: { 'name' : lhs, 'highlight': rhs }
" Util:
" @return hldict
1 0.000004 function! incsearch#highlight#capture(hlname) abort
" Based On: https://github.com/t9md/vim-ezbar
" https://github.com/osyo-manga/vital-over
let hlname = a:hlname
if !hlexists(hlname)
return
endif
while 1
let save_verbose = &verbose
let &verbose = 0
try
redir => HL_SAVE
execute 'silent! highlight ' . hlname
redir END
finally
let &verbose = save_verbose
endtry
if !empty(matchstr(HL_SAVE, 'xxx cleared$'))
return ''
endif
" follow highlight link
let ml = matchlist(HL_SAVE, 'links to \zs.*')
if !empty(ml)
let hlname = ml[0]
continue
endif
break
endwhile
let HL_SAVE = substitute(matchstr(HL_SAVE, 'xxx \zs.*'),
\ '[ \t\n]\+', ' ', 'g')
return { 'name': hlname, 'highlight': HL_SAVE }
endfunction
1 0.000004 function! incsearch#highlight#turn_off(hldict) abort
execute 'highlight' a:hldict.name 'NONE'
endfunction
1 0.000004 function! incsearch#highlight#turn_on(hldict) abort
execute 'highlight' a:hldict.name a:hldict.highlight
endfunction
" Wrapper:
" @return hlobj
1 0.000004 function! incsearch#highlight#get_visual_hlobj() abort
if ! exists('s:_visual_hl')
let s:_visual_hl = incsearch#highlight#capture('Visual')
endif
return s:_visual_hl
endfunction
1 0.000002 augroup incsearch-update-visual-highlight
1 0.000029 autocmd!
1 0.000005 autocmd ColorScheme * if exists('s:_visual_hl') | unlet s:_visual_hl | endif
1 0.000002 augroup END
" Visual Highlighting Emulation:
1 0.000003 let s:INT = { 'MAX': 2147483647 }
" NOTE:
" Default highlight for visual selection has always higher priority than
" defined highlight, so you have to turn off default visual highlight and
" emulate it. All this function do is pseudo highlight visual selected area
" args: mode, visual_hl, v_start_pos, v_end_pos
1 0.000004 function! incsearch#highlight#emulate_visual_highlight(...) abort
let is_visual_now = s:U.is_visual(mode(1))
let mode = get(a:, 1, is_visual_now ? mode(1) : visualmode())
let visual_hl = get(a:, 2, incsearch#highlight#get_visual_hlobj())
" Note: the default pos value assume visual selection is not cleared.
" It uses curswant to emulate visual-block
let v_start_pos = get(a:, 3,
\ (is_visual_now ? [line('v'),col('v')] : [line("'<"), col("'<")]))
" See: https://github.com/vim-jp/issues/issues/604
" getcurpos() could be negative value, so use winsaveview() instead
let end_curswant_pos =
\ (exists('*getcurpos') ? getcurpos()[4] : winsaveview().curswant + 1)
let v_end_pos = get(a:, 4, (is_visual_now
\ ? [line('.'), end_curswant_pos < 0 ? s:INT.MAX : end_curswant_pos ]
\ : [line("'>"), col("'>")]))
let pattern = incsearch#highlight#get_visual_pattern(mode, v_start_pos, v_end_pos)
let hgm = incsearch#highlight#hgm()
let v = hgm.visual
" NOTE: Update highlight
execute 'hi' 'clear' v.group
execute 'hi' v.group visual_hl['highlight']
call s:hi.add(v.group, v.group, pattern, v.priority)
call incsearch#highlight#update()
endfunction
1 0.000005 function! incsearch#highlight#get_visual_pattern(mode, v_start_pos, v_end_pos) abort
" NOTE: highlight doesn't work if the range is over screen height, so
" limit pattern to visible window.
let [_, v_start, v_end, _] = s:U.sort_pos([
\ a:v_start_pos,
\ a:v_end_pos,
\ [line('w0'), 1],
\ [line('w$'), s:U.get_max_col(line('w$'))]
\ ])
if a:mode ==# 'v'
if v_start[0] == v_end[0]
return printf('\v%%%dl%%%dc\_.*%%%dl%%%dc',
\ v_start[0],
\ min([v_start[1], s:U.get_max_col(v_start[0])]),
\ v_end[0],
\ min([v_end[1], s:U.get_max_col(v_end[0])]))
else
return printf('\v%%%dl%%%dc\_.{-}%%%dl|%%%dl\_.*%%%dl%%%dc',
\ v_start[0],
\ min([v_start[1], s:U.get_max_col(v_start[0])]),
\ v_end[0],
\ v_end[0],
\ v_end[0],
\ min([v_end[1], s:U.get_max_col(v_end[0])]))
endif
elseif a:mode ==# 'V'
return printf('\v%%%dl\_.*%%%dl', v_start[0], v_end[0])
elseif a:mode ==# "\<C-v>"
" @vimlint(EVL102, 1, l:min_c)
let [min_c, max_c] = s:U.sort_num([v_start[1], v_end[1]])
let max_c += 1 " increment needed
let max_c = max_c < 0 ? s:INT.MAX : max_c
let mapfunc = "
\ printf('%%%dl%%%dc.*%%%dc',
\ v:val, min_c, min([max_c, s:U.get_max_col(v:val)]))
\ "
return '\v'.join(map(range(v_start[0], v_end[0]), mapfunc), '|')
else
throw 'incsearch.vim: unexpected mode ' . a:mode
endif
endfunction
" Incremental Highlighting:
1 0.000004 function! incsearch#highlight#incremental_highlight(pattern, ...) abort
let should_separate_highlight = get(a:, 1, s:FALSE)
let direction = get(a:, 2, s:DIRECTION.forward)
let start_pos = get(a:, 3, getpos('.')[1:2])
let hgm = incsearch#highlight#hgm()
let [m, r, o, c] = [hgm.match, hgm.match_reverse, hgm.on_cursor, hgm.cursor]
let on_cursor_pattern = '\m\%#\(' . a:pattern . '\m\)'
if '' =~# a:pattern
" Do not highlight for patterns which match everything
call s:hi.delete_all()
elseif ! should_separate_highlight
call s:hi.add(m.group, m.group, a:pattern, m.priority)
if ! g:incsearch#no_inc_hlsearch
let @/ = a:pattern
let &hlsearch = &hlsearch
endif
else
let [p1, p2] = (direction == s:DIRECTION.forward)
\ ? [incsearch#highlight#forward_pattern(a:pattern, start_pos)
\ ,incsearch#highlight#backward_pattern(a:pattern, start_pos)]
\ : [incsearch#highlight#backward_pattern(a:pattern, start_pos)
\ ,incsearch#highlight#forward_pattern(a:pattern, start_pos)]
call s:hi.add(m.group , m.group , p1 , m.priority) " right direction
call s:hi.add(r.group , r.group , p2 , r.priority) " reversed direction
endif
call s:hi.add(o.group , o.group , on_cursor_pattern , o.priority)
call s:hi.add(c.group , c.group , '\v%#' , c.priority)
call incsearch#highlight#update()
endfunction
1 0.000004 function! incsearch#highlight#forward_pattern(pattern, from_pos) abort
let [line, col] = a:from_pos
return printf('\v(%%>%dl|%%%dl%%>%dc)\m\(%s\m\)', line, line, col, a:pattern)
endfunction
1 0.000004 function! incsearch#highlight#backward_pattern(pattern, from_pos) abort
let [line, col] = a:from_pos
return printf('\v(%%<%dl|%%%dl%%<%dc)\m\(%s\m\)', line, line, col, a:pattern)
endfunction
" Restore 'cpoptions' {{{
1 0.000009 let &cpo = s:save_cpo
1 0.000002 unlet s:save_cpo
" }}}
" __END__ {{{
" vim: expandtab softtabstop=2 shiftwidth=2
" vim: foldmethod=marker
" }}}
SCRIPT /home/x/.vim/plugged/incsearch.vim/autoload/vital/_incsearch/Coaster/Highlight.vim
Sourced 2 times
Total time: 1507493888.723465
Self time: 1507493888.722902
count total (s) self (s)
" ___vital___
" NOTE: lines between '" ___vital___' is generated by :Vitalize.
" Do not mofidify the code nor insert new lines before '" ___vital___'
2 0.000008 if v:version > 703 || v:version == 703 && has('patch1170')
2 0.000065 function! vital#_incsearch#Coaster#Highlight#import() abort
return map({'highlight': '', 'clear': '', 'delete': '', 'add': '', 'as_windo': '', '_vital_depends': '', 'get_hl_id': '', 'to_list': '', 'clear_all': '', 'delete_all': '', 'to_list_by': '', 'update': '', 'enable': '', 'delete_by': '', 'hl_list': '', 'make': '', 'enable_list': '', 'update_all': '', 'disable': '', 'disable_all': '', 'is_enabled': '', 'enable_all': '', 'is_added': '', '_vital_loaded': ''}, 'function("s:" . v:key)')
endfunction
2 0.000002 else
function! s:_SID() abort
return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze__SID$')
endfunction
execute join(['function! vital#_incsearch#Coaster#Highlight#import() abort', printf("return map({'highlight': '', 'clear': '', 'delete': '', 'add': '', 'as_windo': '', '_vital_depends': '', 'get_hl_id': '', 'to_list': '', 'clear_all': '', 'delete_all': '', 'to_list_by': '', 'update': '', 'enable': '', 'delete_by': '', 'hl_list': '', 'make': '', 'enable_list': '', 'update_all': '', 'disable': '', 'disable_all': '', 'is_enabled': '', 'enable_all': '', 'is_added': '', '_vital_loaded': ''}, \"function('<SNR>%s_' . v:key)\")", s:_SID()), 'endfunction'], "\n")
delfunction s:_SID
endif
" ___vital___
2 0.000004 scriptencoding utf-8
2 0.000017 let s:save_cpo = &cpo
2 0.000015 set cpo&vim
2 0.000004 function! s:_vital_loaded(V)
let s:V = a:V
let s:Window = a:V.import("Coaster.Window")
let s:Gift = a:V.import("Gift")
call s:_init()
endfunction
2 0.000004 function! s:_vital_depends()
return [
\ "Coaster.Window",
\ "Gift",
\ ]
endfunction
2 0.000013 let s:base = {
\ "variables" : {
\ "hl_list" : {},
\ "id_list" : {}
\ }
\}
2 0.000004 function! s:base.add(name, group, pattern, ...)
call self.delete(a:name)
let priority = get(a:, 1, 10)
let self.variables.hl_list[a:name] = {
\ "group" : a:group,
\ "pattern" : a:pattern,
\ "priority" : priority,
\ "name" : a:name,
\ }
endfunction
2 0.000004 function! s:base.is_added(name)
return has_key(self.variables.hl_list, a:name)
endfunction
2 0.000003 function! s:base.hl_list()
return keys(self.variables.hl_list)
endfunction
2 0.000003 function! s:base.to_list()
return values(self.variables.hl_list)
endfunction
2 0.000004 function! s:_is_equal(__expr, __hl)
let name = a:__hl.name
let group = a:__hl.group
let pattern = a:__hl.pattern
let priority = a:__hl.priority
return eval(a:__expr)
endfunction
2 0.000008 function! s:base.to_list_by(expr)
return filter(values(self.variables.hl_list), "s:_is_equal(a:expr, v:val)")
endfunction
2 0.000002 function! s:base.enable_list(...)
let window = get(a:, 1, s:Gift.uniq_winnr())
return keys(get(self.variables.id_list, window, {}))
endfunction
2 0.000004 function! s:base.delete(name)
if !self.is_added(a:name)
return -1
endif
unlet! self.variables.hl_list[a:name]
endfunction
2 0.000004 function! s:base.delete_by(expr)
return map(self.to_list_by(a:expr), "self.delete(v:val.name)")
endfunction
2 0.000002 function! s:base.delete_all()
for name in self.hl_list()
call self.delete(name)
endfor
endfunction
2 0.000004 function! s:base.get_hl_id(name, ...)
let window = get(a:, 1, s:Gift.uniq_winnr())
return get(get(self.variables.id_list, window, {}), a:name, "")
endfunction
2 0.000004 function! s:base.is_enabled(name, ...)
let window = get(a:, 1, s:Gift.uniq_winnr())
return self.get_hl_id(a:name, window) != ""
endfunction
2 0.000003 function! s:base.enable(name)
let hl = get(self.variables.hl_list, a:name, {})
if empty(hl)
return -1
endif
if self.is_enabled(a:name)
call self.disable(a:name)
endif
let winnr = s:Gift.uniq_winnr()
if !has_key(self.variables.id_list, winnr)
let self.variables.id_list[winnr] = {}
endif
let self.variables.id_list[winnr][a:name] = matchadd(hl.group, hl.pattern, hl.priority)
endfunction
2 0.000003 function! s:base.enable_all()
for name in self.hl_list()
call self.enable(name)
endfor
endfunction
2 0.000003 function! s:base.disable(name)
if !self.is_enabled(a:name)
return -1
endif
let id = -1
silent! let id = matchdelete(self.get_hl_id(a:name))
if id == -1
return -1
endif
let winnr = get(a:, 1, s:Gift.uniq_winnr())
unlet! self.variables.id_list[winnr][a:name]
endfunction
2 0.000004 function! s:base.disable_all()
for name in self.enable_list()
call self.disable(name)
endfor
endfunction
2 0.000003 function! s:base.update(name)
call self.disable(a:name)
call self.enable(a:name)
endfunction
2 0.000002 function! s:base.update_all()
call self.disable_all()
call self.enable_all()
endfunction
2 0.000004 function! s:base.highlight(name, group, pattern, ...)
let priority = get(a:, 1, 10)
call self.add(a:name, a:group, a:pattern, priority)
call self.enable(a:name)
endfunction
2 0.000003 function! s:base.clear(name)
call self.disable(a:name)
call self.delete(a:name)
endfunction
2 0.000003 function! s:base.clear_all()
call self.disable_all()
call self.delete_all()
endfunction
2 0.000004 function! s:base.as_windo()
return self.windo
endfunction
2 0.000003 function! s:make()
let result = deepcopy(s:base)
let result.windo = s:Window.as_windo(result)
return result
endfunction
2 0.000027 let s:global = deepcopy(s:base)
2 0.000173 let s:funcs = keys(filter(copy(s:global), "type(v:val) == type(function('tr'))"))
44 0.000052 for s:name in s:funcs
2 0.000018 execute
\ "function! s:" . s:name . "(...) \n"
\ "return call(s:global." . s:name . ", a:000, s:global) \n"
40 0.000301 \ "endfunction"
42 0.000038 endfor
2 0.000003 unlet s:name
2 0.000004 function! s:_init()
let s:global.windo = s:Window.as_windo(s:global)
endfunction
" function! s:matchadd(...)
" return {
" \ "id" : call("matchadd", a:000),
" \ "bufnr" : bufnr("%"),
" \ }
" endfunction
"
"
" function! s:matchdelete(id)
" if empty(a:id)
" return -1
" endif
" return s:Buffer.execute(a:id.bufnr, "call matchdelete(" . a:id.id . ")")
" endfunction
2 0.000015 let &cpo = s:save_cpo
2 0.000006 unlet s:save_cpo
SCRIPT /home/x/.vim/plugged/incsearch.vim/autoload/vital/_incsearch/Coaster/Window.vim
Sourced 2 times
Total time: 1507493888.724086
Self time: 1507493888.723998
count total (s) self (s)
" ___vital___
" NOTE: lines between '" ___vital___' is generated by :Vitalize.
" Do not mofidify the code nor insert new lines before '" ___vital___'
2 0.000007 if v:version > 703 || v:version == 703 && has('patch1170')
2 0.000062 function! vital#_incsearch#Coaster#Window#import() abort
return map({'as_windo': '', '_vital_depends': '', 'windo': '', '_vital_loaded': ''}, 'function("s:" . v:key)')
endfunction
2 0.000002 else
function! s:_SID() abort
return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze__SID$')
endfunction
execute join(['function! vital#_incsearch#Coaster#Window#import() abort', printf("return map({'as_windo': '', '_vital_depends': '', 'windo': '', '_vital_loaded': ''}, \"function('<SNR>%s_' . v:key)\")", s:_SID()), 'endfunction'], "\n")
delfunction s:_SID
endif
" ___vital___
2 0.000004 scriptencoding utf-8
2 0.000012 let s:save_cpo = &cpo
2 0.000015 set cpo&vim
2 0.000005 function! s:_vital_loaded(V)
let s:V = a:V
let s:Buffer = a:V.import("Vim.Buffer")
endfunction
2 0.000003 function! s:_vital_depends()
return [
\ "Vim.Buffer",
\ ]
endfunction
2 0.000005 function! s:windo(func, args, ...)
let dict = get(a:, 1, {})
if len(tabpagebuflist()) <= 1 || s:Buffer.is_cmdwin()
return call(a:func, a:args, dict)
endif
let pre_winnr = winnr()
noautocmd windo call call(a:func, a:args, dict)
if pre_winnr == winnr()
return
endif
execute pre_winnr . "wincmd w"
endfunction
2 0.000004 function! s:as_windo(base)
let windo = {}
let windo.obj = a:base
for [key, Value] in items(a:base)
if type(function("tr")) == type(Value)
execute
\ "function! windo.". key. "(...)\n"
\ " return s:windo(self.obj." . key . ", a:000, self.obj)\n"
\ "endfunction"
endif
unlet Value
endfor
return windo
endfunction
2 0.000016 let &cpo = s:save_cpo
2 0.000005 unlet s:save_cpo
SCRIPT /home/x/.vim/plugged/incsearch.vim/autoload/vital/_incsearch/Vim/Buffer.vim
Sourced 2 times
Total time: 1507493888.724722
Self time: 1507493888.724561
count total (s) self (s)
" ___vital___
" NOTE: lines between '" ___vital___' is generated by :Vitalize.
" Do not mofidify the code nor insert new lines before '" ___vital___'
2 0.000006 if v:version > 703 || v:version == 703 && has('patch1170')
2 0.000062 function! vital#_incsearch#Vim#Buffer#import() abort
return map({'_vital_depends': '', 'read_content': '', 'get_selected_text': '', 'is_cmdwin': '', 'edit_content': '', 'open': '', 'get_last_selected': '', '_vital_loaded': ''}, 'function("s:" . v:key)')
endfunction
2 0.000002 else
function! s:_SID() abort
return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze__SID$')
endfunction
execute join(['function! vital#_incsearch#Vim#Buffer#import() abort', printf("return map({'_vital_depends': '', 'read_content': '', 'get_selected_text': '', 'is_cmdwin': '', 'edit_content': '', 'open': '', 'get_last_selected': '', '_vital_loaded': ''}, \"function('<SNR>%s_' . v:key)\")", s:_SID()), 'endfunction'], "\n")
delfunction s:_SID
endif
" ___vital___
2 0.000022 let s:save_cpo = &cpo
2 0.000015 set cpo&vim
2 0.000005 function! s:_vital_loaded(V) abort
let s:V = a:V
let s:P = s:V.import('Prelude')
let s:G = s:V.import('Vim.Guard')
endfunction
2 0.000004 function! s:_vital_depends() abort
return ['Prelude', 'Vim.Guard']
endfunction
2 0.000007 if exists('*getcmdwintype')
2 0.000004 function! s:is_cmdwin() abort
return getcmdwintype() !=# ''
endfunction
2 0.000002 else
function! s:is_cmdwin() abort
return bufname('%') ==# '[Command Line]'
endfunction
endif
2 0.000004 function! s:open(buffer, opener) abort
let save_wildignore = &wildignore
let &wildignore = ''
try
if s:P.is_funcref(a:opener)
let loaded = !bufloaded(a:buffer)
call a:opener(a:buffer)
elseif a:buffer is 0 || a:buffer is# ''
let loaded = 1
silent execute a:opener
enew
else
let loaded = !bufloaded(a:buffer)
if s:P.is_string(a:buffer)
execute a:opener '`=a:buffer`'
elseif s:P.is_number(a:buffer)
silent execute a:opener
execute a:buffer 'buffer'
else
throw 'vital: Vim.Buffer: Unknown opener type.'
endif
endif
finally
let &wildignore = save_wildignore
endtry
return loaded
endfunction
2 0.000005 function! s:get_selected_text(...) abort
echohl WarningMsg
echom "[WARN] s:get_selected_text() is deprecated. Use 's:get_last_selected()'."
echohl None
return call('s:get_last_selected', a:000)
endfunction
" Get the last selected text in visual mode
" without using |gv| to avoid |textlock|.
" NOTE:
" * This function uses |gv| only when using |CTRL-V|
" because |gv| is the only way to get selected text
" when using <C-v>$ .
" Please see #192 for the details.
" * If you don't care about |textlock|,
" you can use simple version of this function.
" https://github.com/vim-jp/vital.vim/commit/39aae80f3839fdbeebd838ff14d87327a6b889a9
2 0.000005 function! s:get_last_selected() abort
if visualmode() ==# "\<C-v>"
let save = getreg('"', 1)
let save_type = getregtype('"')
try
normal! gv""y
return @"
finally
call setreg('"', save, save_type)
endtry
else
let [begin, end] = [getpos("'<"), getpos("'>")]
let lastchar = matchstr(getline(end[1])[end[2]-1 :], '.')
if begin[1] ==# end[1]
let lines = [getline(begin[1])[begin[2]-1 : end[2]-2]]
else
let lines = [getline(begin[1])[begin[2]-1 :]]
\ + (end[1] - begin[1] <# 2 ? [] : getline(begin[1]+1, end[1]-1))
\ + [getline(end[1])[: end[2]-2]]
endif
return join(lines, "\n") . lastchar . (visualmode() ==# 'V' ? "\n" : '')
endif
endfunction
2 0.000004 function! s:read_content(content, ...) abort
let options = extend({
\ 'tempfile': '',
\ 'fileformat': '',
\ 'encoding': '',
\ 'binary': 0,
\ 'nobinary': 0,
\ 'bad': '',
\ 'edit': 0,
\}, get(a:000, 0, {}))
let tempfile = empty(options.tempfile) ? tempname() : options.tempfile
let optnames = [
\ empty(options.fileformat) ? '' : '++ff=' . options.fileformat,
\ empty(options.encoding) ? '' : '++enc=' . options.encoding,
\ empty(options.binary) ? '' : '++bin',
\ empty(options.nobinary) ? '' : '++nobin',
\ empty(options.bad) ? '' : '++bad=' . options.bad,
\ empty(options.edit) ? '' : '++edit',
\]
let optname = join(filter(optnames, '!empty(v:val)'))
try
call writefile(a:content, tempfile)
execute printf('keepalt keepjumps read %s%s',
\ empty(optname) ? '' : optname . ' ',
\ fnameescape(tempfile),
\)
finally
call delete(tempfile)
endtry
endfunction
2 0.000005 function! s:edit_content(content, ...) abort
let options = extend({
\ 'edit': 1,
\}, get(a:000, 0, {}))
let guard = s:G.store(['&l:modifiable'])
let saved_view = winsaveview()
try
let &l:modifiable=1
silent keepjumps %delete _
silent call s:read_content(a:content, options)
silent keepjumps 1delete _
finally
keepjump call winrestview(saved_view)
call guard.restore()
endtry
setlocal nomodified
endfunction
2 0.000016 let &cpo = s:save_cpo
2 0.000003 unlet s:save_cpo
" vim:set et ts=2 sts=2 sw=2 tw=0:
SCRIPT /home/x/.vim/plugged/incsearch.vim/autoload/vital/_incsearch/Prelude.vim
Sourced 2 times
Total time: 1507493888.725881
Self time: 1507493888.725462
count total (s) self (s)
" ___vital___
" NOTE: lines between '" ___vital___' is generated by :Vitalize.
" Do not mofidify the code nor insert new lines before '" ___vital___'
2 0.000008 if v:version > 703 || v:version == 703 && has('patch1170')
2 0.000058 function! vital#_incsearch#Prelude#import() abort
return map({'escape_pattern': '', 'is_funcref': '', 'path2directory': '', 'wcswidth': '', 'is_string': '', 'input_helper': '', 'is_number': '', 'is_cygwin': '', 'path2project_directory': '', 'strwidthpart_reverse': '', 'input_safe': '', 'is_list': '', 'truncate_skipping': '', 'glob': '', 'truncate': '', 'is_dict': '', 'set_default': '', 'is_numeric': '', 'getchar_safe': '', 'substitute_path_separator': '', 'is_mac': '', 'strwidthpart': '', 'getchar': '', 'is_unix': '', 'is_windows': '', 'globpath': '', 'escape_file_searching': '', 'is_float': '', 'smart_execute_command': ''}, 'function("s:" . v:key)')
endfunction
2 0.000002 else
function! s:_SID() abort
return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze__SID$')
endfunction
execute join(['function! vital#_incsearch#Prelude#import() abort', printf("return map({'escape_pattern': '', 'is_funcref': '', 'path2directory': '', 'wcswidth': '', 'is_string': '', 'input_helper': '', 'is_number': '', 'is_cygwin': '', 'path2project_directory': '', 'strwidthpart_reverse': '', 'input_safe': '', 'is_list': '', 'truncate_skipping': '', 'glob': '', 'truncate': '', 'is_dict': '', 'set_default': '', 'is_numeric': '', 'getchar_safe': '', 'substitute_path_separator': '', 'is_mac': '', 'strwidthpart': '', 'getchar': '', 'is_unix': '', 'is_windows': '', 'globpath': '', 'escape_file_searching': '', 'is_float': '', 'smart_execute_command': ''}, \"function('<SNR>%s_' . v:key)\")", s:_SID()), 'endfunction'], "\n")
delfunction s:_SID
endif
" ___vital___
2 0.000018 let s:save_cpo = &cpo
2 0.000015 set cpo&vim
2 0.000007 if v:version ># 703 ||
\ (v:version is 703 && has('patch465'))
2 0.000004 function! s:glob(expr) abort
return glob(a:expr, 1, 1)
endfunction
2 0.000002 else
function! s:glob(expr) abort
let R = glob(a:expr, 1)
return split(R, '\n')
endfunction
endif
2 0.000004 function! s:globpath(path, expr) abort
let R = globpath(a:path, a:expr, 1)
return split(R, '\n')
endfunction
" Wrapper functions for type().
2 0.000038 let [
\ s:__TYPE_NUMBER,
\ s:__TYPE_STRING,
\ s:__TYPE_FUNCREF,
\ s:__TYPE_LIST,
\ s:__TYPE_DICT,
\ s:__TYPE_FLOAT] = [
\ type(3),
\ type(''),
\ type(function('tr')),
\ type([]),
\ type({}),
\ has('float') ? type(str2float('0')) : -1]
" __TYPE_FLOAT = -1 when -float
" This doesn't match to anything.
" Number or Float
2 0.000004 function! s:is_numeric(Value) abort
let _ = type(a:Value)
return _ ==# s:__TYPE_NUMBER
\ || _ ==# s:__TYPE_FLOAT
endfunction
" Number
2 0.000004 function! s:is_number(Value) abort
return type(a:Value) ==# s:__TYPE_NUMBER
endfunction
" Float
2 0.000004 function! s:is_float(Value) abort
return type(a:Value) ==# s:__TYPE_FLOAT
endfunction
" String
2 0.000004 function! s:is_string(Value) abort
return type(a:Value) ==# s:__TYPE_STRING
endfunction
" Funcref
2 0.000004 function! s:is_funcref(Value) abort
return type(a:Value) ==# s:__TYPE_FUNCREF
endfunction
" List
2 0.000004 function! s:is_list(Value) abort
return type(a:Value) ==# s:__TYPE_LIST
endfunction
" Dictionary
2 0.000004 function! s:is_dict(Value) abort
return type(a:Value) ==# s:__TYPE_DICT
endfunction
2 0.000006 function! s:truncate_skipping(str, max, footer_width, separator) abort
call s:_warn_deprecated('truncate_skipping', 'Data.String.truncate_skipping')
let width = s:wcswidth(a:str)
if width <= a:max
let ret = a:str
else
let header_width = a:max - s:wcswidth(a:separator) - a:footer_width
let ret = s:strwidthpart(a:str, header_width) . a:separator
\ . s:strwidthpart_reverse(a:str, a:footer_width)
endif
return s:truncate(ret, a:max)
endfunction
2 0.000004 function! s:truncate(str, width) abort
" Original function is from mattn.
" http://github.com/mattn/googlereader-vim/tree/master
call s:_warn_deprecated('truncate', 'Data.String.truncate')
if a:str =~# '^[\x00-\x7f]*$'
return len(a:str) < a:width ?
\ printf('%-'.a:width.'s', a:str) : strpart(a:str, 0, a:width)
endif
let ret = a:str
let width = s:wcswidth(a:str)
if width > a:width
let ret = s:strwidthpart(ret, a:width)
let width = s:wcswidth(ret)
endif
if width < a:width
let ret .= repeat(' ', a:width - width)
endif
return ret
endfunction
2 0.000004 function! s:strwidthpart(str, width) abort
call s:_warn_deprecated('strwidthpart', 'Data.String.strwidthpart')
if a:width <= 0
return ''
endif
let ret = a:str
let width = s:wcswidth(a:str)
while width > a:width
let char = matchstr(ret, '.$')
let ret = ret[: -1 - len(char)]
let width -= s:wcswidth(char)
endwhile
return ret
endfunction
2 0.000006 function! s:strwidthpart_reverse(str, width) abort
call s:_warn_deprecated('strwidthpart_reverse', 'Data.String.strwidthpart_reverse')
if a:width <= 0
return ''
endif
let ret = a:str
let width = s:wcswidth(a:str)
while width > a:width
let char = matchstr(ret, '^.')
let ret = ret[len(char) :]
let width -= s:wcswidth(char)
endwhile
return ret
endfunction
2 0.000005 if v:version >= 703
" Use builtin function.
2 0.000004 function! s:wcswidth(str) abort
call s:_warn_deprecated('wcswidth', 'Data.String.wcswidth')
return strwidth(a:str)
endfunction
2 0.000002 else
function! s:wcswidth(str) abort
call s:_warn_deprecated('wcswidth', 'Data.String.wcswidth')
if a:str =~# '^[\x00-\x7f]*$'
return strlen(a:str)
end
let mx_first = '^\(.\)'
let str = a:str
let width = 0
while 1
let ucs = char2nr(substitute(str, mx_first, '\1', ''))
if ucs == 0
break
endif
let width += s:_wcwidth(ucs)
let str = substitute(str, mx_first, '', '')
endwhile
return width
endfunction
" UTF-8 only.
function! s:_wcwidth(ucs) abort
let ucs = a:ucs
if (ucs >= 0x1100
\ && (ucs <= 0x115f
\ || ucs == 0x2329
\ || ucs == 0x232a
\ || (ucs >= 0x2e80 && ucs <= 0xa4cf
\ && ucs != 0x303f)
\ || (ucs >= 0xac00 && ucs <= 0xd7a3)
\ || (ucs >= 0xf900 && ucs <= 0xfaff)
\ || (ucs >= 0xfe30 && ucs <= 0xfe6f)
\ || (ucs >= 0xff00 && ucs <= 0xff60)
\ || (ucs >= 0xffe0 && ucs <= 0xffe6)
\ || (ucs >= 0x20000 && ucs <= 0x2fffd)
\ || (ucs >= 0x30000 && ucs <= 0x3fffd)
\ ))
return 2
endif
return 1
endfunction
endif
2 0.000024 let s:is_windows = has('win16') || has('win32') || has('win64') || has('win95')
2 0.000009 let s:is_cygwin = has('win32unix')
2 0.000029 let s:is_mac = !s:is_windows && !s:is_cygwin
\ && (has('mac') || has('macunix') || has('gui_macvim') ||
\ (!isdirectory('/proc') && executable('sw_vers')))
2 0.000005 let s:is_unix = has('unix')
2 0.000004 function! s:is_windows() abort
return s:is_windows
endfunction
2 0.000004 function! s:is_cygwin() abort
return s:is_cygwin
endfunction
2 0.000003 function! s:is_mac() abort
return s:is_mac
endfunction
2 0.000003 function! s:is_unix() abort
return s:is_unix
endfunction
2 0.000004 function! s:_warn_deprecated(name, alternative) abort
try
echohl Error
echomsg 'Prelude.' . a:name . ' is deprecated! Please use ' . a:alternative . ' instead.'
finally
echohl None
endtry
endfunction
2 0.000005 function! s:smart_execute_command(action, word) abort
execute a:action . ' ' . (a:word ==# '' ? '' : '`=a:word`')
endfunction
2 0.000005 function! s:escape_file_searching(buffer_name) abort
return escape(a:buffer_name, '*[]?{}, ')
endfunction
2 0.000004 function! s:escape_pattern(str) abort
call s:_warn_deprecated(
\ 'escape_pattern',
\ 'Data.String.escape_pattern',
\)
return escape(a:str, '~"\.^$[]*')
endfunction
2 0.000003 function! s:getchar(...) abort
let c = call('getchar', a:000)
return type(c) == type(0) ? nr2char(c) : c
endfunction
2 0.000004 function! s:getchar_safe(...) abort
let c = s:input_helper('getchar', a:000)
return type(c) == type('') ? c : nr2char(c)
endfunction
2 0.000004 function! s:input_safe(...) abort
return s:input_helper('input', a:000)
endfunction
2 0.000005 function! s:input_helper(funcname, args) abort
let success = 0
if inputsave() !=# success
throw 'vital: Prelude: inputsave() failed'
endif
try
return call(a:funcname, a:args)
finally
if inputrestore() !=# success
throw 'vital: Prelude: inputrestore() failed'
endif
endtry
endfunction
2 0.000005 function! s:set_default(var, val) abort
if !exists(a:var) || type({a:var}) != type(a:val)
let {a:var} = a:val
endif
endfunction
2 0.000005 function! s:substitute_path_separator(path) abort
return s:is_windows ? substitute(a:path, '\\', '/', 'g') : a:path
endfunction
2 0.000004 function! s:path2directory(path) abort
return s:substitute_path_separator(isdirectory(a:path) ? a:path : fnamemodify(a:path, ':p:h'))
endfunction
2 0.000005 function! s:_path2project_directory_git(path) abort
let parent = a:path
while 1
let path = parent . '/.git'
if isdirectory(path) || filereadable(path)
return parent
endif
let next = fnamemodify(parent, ':h')
if next == parent
return ''
endif
let parent = next
endwhile
endfunction
2 0.000004 function! s:_path2project_directory_svn(path) abort
let search_directory = a:path
let directory = ''
let find_directory = s:escape_file_searching(search_directory)
let d = finddir('.svn', find_directory . ';')
if d ==# ''
return ''
endif
let directory = fnamemodify(d, ':p:h:h')
" Search parent directories.
let parent_directory = s:path2directory(
\ fnamemodify(directory, ':h'))
if parent_directory !=# ''
let d = finddir('.svn', parent_directory . ';')
if d !=# ''
let directory = s:_path2project_directory_svn(parent_directory)
endif
endif
return directory
endfunction
2 0.000005 function! s:_path2project_directory_others(vcs, path) abort
let vcs = a:vcs
let search_directory = a:path
let find_directory = s:escape_file_searching(search_directory)
let d = finddir(vcs, find_directory . ';')
if d ==# ''
return ''
endif
return fnamemodify(d, ':p:h:h')
endfunction
2 0.000005 function! s:path2project_directory(path, ...) abort
let is_allow_empty = get(a:000, 0, 0)
let search_directory = s:path2directory(a:path)
let directory = ''
" Search VCS directory.
for vcs in ['.git', '.bzr', '.hg', '.svn']
if vcs ==# '.git'
let directory = s:_path2project_directory_git(search_directory)
elseif vcs ==# '.svn'
let directory = s:_path2project_directory_svn(search_directory)
else
let directory = s:_path2project_directory_others(vcs, search_directory)
endif
if directory !=# ''
break
endif
endfor
" Search project file.
if directory ==# ''
for d in ['build.xml', 'prj.el', '.project', 'pom.xml', 'package.json',
\ 'Makefile', 'configure', 'Rakefile', 'NAnt.build',
\ 'P4CONFIG', 'tags', 'gtags']
let d = findfile(d, s:escape_file_searching(search_directory) . ';')
if d !=# ''
let directory = fnamemodify(d, ':p:h')
break
endif
endfor
endif
if directory ==# ''
" Search /src/ directory.
let base = s:substitute_path_separator(search_directory)
if base =~# '/src/'
let directory = base[: strridx(base, '/src/') + 3]
endif
endif
if directory ==# '' && !is_allow_empty
" Use original path.
let directory = search_directory
endif
return s:substitute_path_separator(directory)
endfunction
2 0.000017 let &cpo = s:save_cpo
2 0.000003 unlet s:save_cpo
" vim:set et ts=2 sts=2 sw=2 tw=0:
SCRIPT /home/x/.vim/plugged/incsearch.vim/autoload/vital/_incsearch/Vim/Guard.vim
Sourced 2 times
Total time: 1507493888.726862
Self time: 1507493888.726614
count total (s) self (s)
" ___vital___
" NOTE: lines between '" ___vital___' is generated by :Vitalize.
" Do not mofidify the code nor insert new lines before '" ___vital___'
2 0.000007 if v:version > 703 || v:version == 703 && has('patch1170')
2 0.000056 function! vital#_incsearch#Vim#Guard#import() abort
return map({'_vital_depends': '', '_vital_created': '', 'store': '', '_vital_loaded': ''}, 'function("s:" . v:key)')
endfunction
2 0.000002 else
function! s:_SID() abort
return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze__SID$')
endfunction
execute join(['function! vital#_incsearch#Vim#Guard#import() abort', printf("return map({'_vital_depends': '', '_vital_created': '', 'store': '', '_vital_loaded': ''}, \"function('<SNR>%s_' . v:key)\")", s:_SID()), 'endfunction'], "\n")
delfunction s:_SID
endif
" ___vital___
2 0.000014 let s:save_cpo = &cpo
2 0.000015 set cpo&vim
" Use a Funcref as a special term _UNDEFINED
2 0.000004 function! s:_undefined() abort
return 'undefined'
endfunction
2 0.000010 let s:_UNDEFINED = function('s:_undefined')
2 0.000004 function! s:_vital_loaded(V) abort
let s:V = a:V
let s:Prelude = s:V.import('Prelude')
let s:List = s:V.import('Data.List')
let s:Dict = s:V.import('Data.Dict')
endfunction
2 0.000004 function! s:_vital_depends() abort
return ['Prelude', 'Data.List', 'Data.Dict']
endfunction
2 0.000005 function! s:_vital_created(module) abort
" define constant variables
if !exists('s:const')
let s:const = {}
let s:const.is_local_variable_supported =
\ v:version > 703 || (v:version == 703 && has('patch560'))
" NOTE:
" The third argument is available from 7.4.242 but it had bug and that
" bug was fixed from 7.4.513
let s:const.is_third_argument_of_getreg_supported = has('patch-7.4.513')
lockvar s:const
endif
call extend(a:module, s:const)
endfunction
2 0.000004 function! s:_throw(msg) abort
throw printf('vital: Vim.Guard: %s', a:msg)
endfunction
2 0.000005 let s:option = {}
2 0.000005 function! s:_new_option(name) abort
if a:name !~# '^&'
call s:_throw(printf(
\'An option name "%s" requires to be started from "&"', a:name
\))
elseif !exists(a:name)
call s:_throw(printf(
\'An option name "%s" does not exist', a:name
\))
endif
let option = copy(s:option)
let option.name = a:name
let option.value = eval(a:name)
return option
endfunction
2 0.000004 function! s:option.restore() abort
execute printf('let %s = %s', self.name, string(self.value))
endfunction
2 0.000004 let s:register = {}
2 0.000004 function! s:_new_register(name) abort
if len(a:name) != 2
call s:_throw(printf(
\'A register name "%s" requires to be "@" + a single character', a:name
\))
elseif a:name !~# '^@'
call s:_throw(printf(
\'A register name "%s" requires to be started from "@"', a:name
\))
elseif a:name =~# '^@[:.%]$'
call s:_throw(printf(
\'A register name "%s" is read only', a:name
\))
elseif a:name !~# '^@[@0-9a-zA-Z#=*+~_/-]$'
call s:_throw(printf(
\'A register name "%s" does not exist. See ":help let-register"', a:name
\))
endif
let name = a:name ==# '@@' ? '' : a:name[1]
let register = copy(s:register)
let register.name = name
if s:const.is_third_argument_of_getreg_supported
let register.value = getreg(name, 1, 1)
else
let register.value = getreg(name, 1)
endif
let register.type = getregtype(name)
return register
endfunction
2 0.000004 function! s:register.restore() abort
call setreg(self.name, self.value, self.type)
endfunction
2 0.000010 let s:environment = {}
2 0.000005 function! s:_new_environment(name) abort
if a:name !~# '^\$'
call s:_throw(printf(
\'An environment variable name "%s" requires to be started from "$"', a:name
\))
elseif !exists(a:name)
call s:_throw(printf(
\'An environment variable name "%s" does not exist. While Vim cannot unlet environment variable, it requires to exist', a:name
\))
endif
let environment = copy(s:environment)
let environment.name = a:name
let environment.value = eval(a:name)
return environment
endfunction
2 0.000007 function! s:environment.restore() abort
execute printf('let %s = %s', self.name, string(self.value))
endfunction
2 0.000005 let s:variable = {}
2 0.000005 function! s:_new_variable(name, ...) abort
if a:0 == 0
let m = matchlist(a:name, '^\([bwtg]:\)\(.*\)$')
if empty(m)
call s:_throw(printf(
\ join([
\ 'An variable name "%s" requires to start from b:, w:, t:, or g:',
\ 'while no {namespace} is specified',
\ ]),
\ a:name,
\))
endif
let [prefix, name] = m[1 : 2]
let namespace = eval(prefix)
else
let name = a:name
let namespace = a:1
endif
let variable = copy(s:variable)
let variable.name = name
let variable.value = get(namespace, name, s:_UNDEFINED)
let variable.value =
\ type(variable.value) == type({}) || type(variable.value) == type([])
\ ? deepcopy(variable.value)
\ : variable.value
let variable._namespace = namespace
return variable
endfunction
2 0.000004 function! s:variable.restore() abort
" unlet the variable to prevent variable type mis-match in case
silent! unlet! self._namespace[self.name]
if type(self.value) == type(s:_UNDEFINED) && self.value == s:_UNDEFINED
" do nothing, leave the variable as undefined
else
let self._namespace[self.name] = self.value
endif
endfunction
2 0.000005 let s:instance = {}
2 0.000005 function! s:_new_instance(instance, ...) abort
let shallow = get(a:000, 0, 0)
if !s:Prelude.is_list(a:instance) && !s:Prelude.is_dict(a:instance)
call s:_throw(printf(
\'An instance "%s" requires to be List or Dictionary', string(a:instance)
\))
endif
let instance = copy(s:instance)
let instance.instance = a:instance
let instance.values = shallow ? copy(a:instance) : deepcopy(a:instance)
return instance
endfunction
2 0.000003 function! s:instance.restore() abort
if s:Prelude.is_list(self.instance)
call s:List.clear(self.instance)
else
call s:Dict.clear(self.instance)
endif
call extend(self.instance, self.values)
endfunction
2 0.000005 let s:guard = {}
2 0.000004 function! s:store(targets) abort
let resources = []
for meta in a:targets
if s:Prelude.is_list(meta)
if len(meta) == 1
call add(resources, s:_new_instance(meta[0]))
elseif len(meta) == 2
if s:Prelude.is_string(meta[0])
call add(resources, call('s:_new_variable', meta))
else
call add(resources, call('s:_new_instance', meta))
endif
else
call s:_throw('List assignment requires one or two elements')
endif
elseif type(meta) == type('')
if meta =~# '^[bwtgls]:'
" Note:
" To improve an error message, handle l:XXX or s:XXX as well
call add(resources, s:_new_variable(meta))
elseif meta =~# '^&'
call add(resources, s:_new_option(meta))
elseif meta =~# '^@'
call add(resources, s:_new_register(meta))
elseif meta =~# '^\$'
call add(resources, s:_new_environment(meta))
else
call s:_throw(printf(
\ 'Unknown value "%s" was specified',
\ meta
\))
endif
endif
unlet meta
endfor
let guard = copy(s:guard)
let guard._resources = resources
return guard
endfunction
2 0.000004 function! s:guard.restore() abort
for resource in self._resources
call resource.restore()
endfor
endfunction
2 0.000018 let &cpo = s:save_cpo
2 0.000004 unlet! s:save_cpo
" vim:set et ts=2 sts=2 sw=2 tw=0 fdm=marker:
SCRIPT /home/x/.vim/plugged/incsearch.vim/autoload/vital/_incsearch/Data/Dict.vim
Sourced 2 times
Total time: 1507493888.727712
Self time: 1507493888.727560
count total (s) self (s)
" ___vital___
" NOTE: lines between '" ___vital___' is generated by :Vitalize.
" Do not mofidify the code nor insert new lines before '" ___vital___'
2 0.000008 if v:version > 703 || v:version == 703 && has('patch1170')
2 0.000060 function! vital#_incsearch#Data#Dict#import() abort
return map({'pick': '', 'clear': '', 'max_by': '', 'foldl': '', 'swap': '', 'omit': '', 'min_by': '', 'foldr': '', 'make_index': '', 'make': ''}, 'function("s:" . v:key)')
endfunction
2 0.000004 else
function! s:_SID() abort
return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze__SID$')
endfunction
execute join(['function! vital#_incsearch#Data#Dict#import() abort', printf("return map({'pick': '', 'clear': '', 'max_by': '', 'foldl': '', 'swap': '', 'omit': '', 'min_by': '', 'foldr': '', 'make_index': '', 'make': ''}, \"function('<SNR>%s_' . v:key)\")", s:_SID()), 'endfunction'], "\n")
delfunction s:_SID
endif
" ___vital___
" Utilities for dictionary.
2 0.000014 let s:save_cpo = &cpo
2 0.000022 set cpo&vim
" Makes a dict from keys and values
2 0.000004 function! s:make(keys, values, ...) abort
let dict = {}
let fill = a:0 ? a:1 : 0
for i in range(len(a:keys))
let key = type(a:keys[i]) == type('') ? a:keys[i] : string(a:keys[i])
if key ==# ''
throw "vital: Data.Dict: Can't use an empty string for key."
endif
let dict[key] = get(a:values, i, fill)
endfor
return dict
endfunction
" Swaps keys and values
2 0.000004 function! s:swap(dict) abort
return s:make(values(a:dict), keys(a:dict))
endfunction
" Makes a index dict from a list
2 0.000004 function! s:make_index(list, ...) abort
let value = a:0 ? a:1 : 1
return s:make(a:list, [], value)
endfunction
2 0.000004 function! s:pick(dict, keys) abort
let new_dict = {}
for key in a:keys
if has_key(a:dict, key)
let new_dict[key] = a:dict[key]
endif
endfor
return new_dict
endfunction
2 0.000004 function! s:omit(dict, keys) abort
let new_dict = copy(a:dict)
for key in a:keys
if has_key(a:dict, key)
call remove(new_dict, key)
endif
endfor
return new_dict
endfunction
2 0.000004 function! s:clear(dict) abort
for key in keys(a:dict)
call remove(a:dict, key)
endfor
return a:dict
endfunction
2 0.000004 function! s:_max_by(dict, expr) abort
let dict = s:swap(map(copy(a:dict), a:expr))
let key = dict[max(keys(dict))]
return [key, a:dict[key]]
endfunction
2 0.000004 function! s:max_by(dict, expr) abort
if empty(a:dict)
throw 'vital: Data.Dict: Empty dictionary'
endif
return s:_max_by(a:dict, a:expr)
endfunction
2 0.000004 function! s:min_by(dict, expr) abort
if empty(a:dict)
throw 'vital: Data.Dict: Empty dictionary'
endif
return s:_max_by(a:dict, '-(' . a:expr . ')')
endfunction
2 0.000004 function! s:_foldl(f, init, xs) abort
let memo = a:init
for [k, v] in a:xs
let expr = substitute(a:f, 'v:key', string(k), 'g')
let expr = substitute(expr, 'v:val', string(v), 'g')
let expr = substitute(expr, 'v:memo', string(memo), 'g')
unlet memo
let memo = eval(expr)
endfor
return memo
endfunction
2 0.000005 function! s:foldl(f, init, dict) abort
return s:_foldl(a:f, a:init, items(a:dict))
endfunction
2 0.000004 function! s:foldr(f, init, dict) abort
return s:_foldl(a:f, a:init, reverse(items(a:dict)))
endfunction
2 0.000017 let &cpo = s:save_cpo
2 0.000004 unlet s:save_cpo
" vim:set et ts=2 sts=2 sw=2 tw=0:
SCRIPT /home/x/.vim/plugged/incsearch.vim/autoload/vital/_incsearch/Gift.vim
Sourced 2 times
Total time: 1507493888.728510
Self time: 1507493888.728333
count total (s) self (s)
" ___vital___
" NOTE: lines between '" ___vital___' is generated by :Vitalize.
" Do not mofidify the code nor insert new lines before '" ___vital___'
2 0.000008 if v:version > 703 || v:version == 703 && has('patch1170')
2 0.000056 function! vital#_incsearch#Gift#import() abort
return map({'flatten': '', 'uniq_tabpagenr': '', 'tabpagewinnr_list': '', 'execute': '', 'getwinvar': '', 'winnr': '', 'jump_window': '', '_vital_depends': '', 'uniq_winnr': '', 'setwinvar': '', 'find': '', 'openable_bufnr_list': '', 'to_fullpath': '', 'bufnr': '', 'set_current_window': '', 'tabpagewinnr': '', 'close_window': '', 'close_window_by': '', 'uniq_winnr_list': '', '_vital_loaded': '', 'find_by': ''}, 'function("s:" . v:key)')
endfunction
2 0.000003 else
function! s:_SID() abort
return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze__SID$')
endfunction
execute join(['function! vital#_incsearch#Gift#import() abort', printf("return map({'flatten': '', 'uniq_tabpagenr': '', 'tabpagewinnr_list': '', 'execute': '', 'getwinvar': '', 'winnr': '', 'jump_window': '', '_vital_depends': '', 'uniq_winnr': '', 'setwinvar': '', 'find': '', 'openable_bufnr_list': '', 'to_fullpath': '', 'bufnr': '', 'set_current_window': '', 'tabpagewinnr': '', 'close_window': '', 'close_window_by': '', 'uniq_winnr_list': '', '_vital_loaded': '', 'find_by': ''}, \"function('<SNR>%s_' . v:key)\")", s:_SID()), 'endfunction'], "\n")
delfunction s:_SID
endif
" ___vital___
2 0.000003 scriptencoding utf-8
2 0.000013 let s:save_cpo = &cpo
2 0.000015 set cpo&vim
2 0.000005 function! s:_vital_loaded(V)
let s:V = a:V
let s:Window = s:V.import("Gift.Window")
let s:Tabpage = s:V.import("Gift.Tabpage")
endfunction
2 0.000004 function! s:_vital_depends()
return [
\ "Gift.Window",
\ "Gift.Tabpage",
\ ]
endfunction
2 0.000004 function! s:to_fullpath(filename)
let name = substitute(fnamemodify(a:filename, ":p"), '\', '/', "g")
if filereadable(name)
return name
else
return a:filename
endif
endfunction
2 0.000004 function! s:flatten(list)
return eval(join(a:list, "+"))
endfunction
2 0.000004 function! s:bufnr(expr)
return type(a:expr) == type([])
\ ? s:bufnr(s:uniq_winnr(a:expr[1], a:expr[0]))
\ : s:Window.bufnr(a:expr)
endfunction
2 0.000004 function! s:openable_bufnr_list()
return map(s:tabpagewinnr_list(), "s:bufnr([v:val[0], v:val[1]])")
endfunction
2 0.000004 function! s:tabpagewinnr(...)
return a:0 == 0 ? s:tabpagewinnr(s:uniq_winnr())
\ : s:Window.tabpagewinnr(a:1)
endfunction
2 0.000004 function! s:tabpagewinnr_list()
return s:Window.tabpagewinnr_list()
" return s:flatten(map(range(1, tabpagenr("$")), "map(range(1, tabpagewinnr(v:val, '$')), '['.v:val.', v:val]')"))
endfunction
2 0.000004 function! s:uniq_winnr(...)
return call(s:Window.uniq_nr, a:000, s:Window)
endfunction
2 0.000004 function! s:winnr(uniqnr)
let [tabnr, winnr] = s:Window.tabpagewinnr(a:uniqnr)
return winnr
endfunction
2 0.000004 function! s:uniq_winnr_list(...)
return map(s:tabpagewinnr_list(), "s:uniq_winnr(v:val[1], v:val[0])")
endfunction
2 0.000003 function! s:find(expr)
let gift_find_result = []
for [tabnr, winnr] in s:tabpagewinnr_list()
let bufnr = s:bufnr([tabnr, winnr])
if eval(a:expr)
call add(gift_find_result, [tabnr, winnr])
endif
endfor
return gift_find_result
endfunction
2 0.000004 function! s:find_by(expr)
if type(a:expr) == type(function("tr"))
return filter(s:tabpagewinnr_list(), "a:expr(s:bufnr([v:val[0], v:val[1]]), v:val[0], v:val[1])")
else
return s:find(a:expr)
endif
endfunction
2 0.000004 function! s:jump_window(expr)
return type(a:expr) == type([])
\ ? s:jump_window(s:uniq_winnr(a:expr[1], a:expr[0]))
\ : s:Window.jump(a:expr)
endfunction
2 0.000004 function! s:set_current_window(expr)
return s:jump_window(a:expr)
endfunction
2 0.000004 function! s:close_window(expr, ...)
let close_cmd = get(a:, 1, "close")
return type(a:expr) == type([])
\ ? s:close_window(s:uniq_winnr(a:expr[1], a:expr[0]), close_cmd)
\ : s:Window.close(a:expr, close_cmd)
endfunction
2 0.000004 function! s:close_window_by(expr, ...)
let close_cmd = get(a:, 1, "close")
return map(map(s:find(a:expr), "s:uniq_winnr(v:val[1], v:val[0])"), 's:close_window(v:val, close_cmd)')
endfunction
2 0.000004 function! s:execute(expr, execute)
return type(a:expr) == type([])
\ ? s:execute(s:uniq_winnr(a:expr[1], a:expr[0]), a:execute)
\ : s:Window.execute(a:expr, a:execute)
endfunction
2 0.000004 function! s:getwinvar(uniq_winnr, varname, ...)
let def = get(a:, 1, "")
return s:Window.getvar(a:uniq_winnr, a:varname, def)
endfunction
2 0.000005 function! s:setwinvar(uniq_winnr, varname, val)
return s:Window.setvar(a:uniq_winnr, a:varname, a:val)
endfunction
2 0.000004 function! s:uniq_tabpagenr(...)
return call(s:Tabpage.uniq_nr, a:000, s:Tabpage)
endfunction
2 0.000016 let &cpo = s:save_cpo
2 0.000005 unlet s:save_cpo
SCRIPT /home/x/.vim/plugged/incsearch.vim/autoload/vital/_incsearch/Gift/Window.vim
Sourced 2 times
Total time: 1507493888.729286
Self time: 1507493888.729107
count total (s) self (s)
" ___vital___
" NOTE: lines between '" ___vital___' is generated by :Vitalize.
" Do not mofidify the code nor insert new lines before '" ___vital___'
2 0.000008 if v:version > 703 || v:version == 703 && has('patch1170')
2 0.000055 function! vital#_incsearch#Gift#Window#import() abort
return map({'flatten': '', 'tabpagewinnr_list': '', 'execute': '', 'close': '', 'numbering': '', 'set_prefix': '', '_vital_depends': '', 'exists': '', 'jump': '', 'setvar': '', 'bufnr': '', 'uniq_nr': '', 'make_uniq_nr': '', 'tabpagewinnr': '', 'getvar': '', '_vital_loaded': ''}, 'function("s:" . v:key)')
endfunction
2 0.000002 else
function! s:_SID() abort
return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze__SID$')
endfunction
execute join(['function! vital#_incsearch#Gift#Window#import() abort', printf("return map({'flatten': '', 'tabpagewinnr_list': '', 'execute': '', 'close': '', 'numbering': '', 'set_prefix': '', '_vital_depends': '', 'exists': '', 'jump': '', 'setvar': '', 'bufnr': '', 'uniq_nr': '', 'make_uniq_nr': '', 'tabpagewinnr': '', 'getvar': '', '_vital_loaded': ''}, \"function('<SNR>%s_' . v:key)\")", s:_SID()), 'endfunction'], "\n")
delfunction s:_SID
endif
" ___vital___
2 0.000004 scriptencoding utf-8
2 0.000017 let s:save_cpo = &cpo
2 0.000014 set cpo&vim
2 0.000005 function! s:_vital_loaded(V)
let s:V = a:V
let s:Tabpage = s:V.import("Gift.Tabpage")
endfunction
2 0.000004 function! s:_vital_depends()
return [
\ "Gift.Tabpage",
\ ]
endfunction
2 0.000014 let s:prefix = expand("<sfile>:p:h:h:t")
2 0.000005 function! s:set_prefix(prefix)
let s:prefix = a:prefix
endfunction
2 0.000003 function! s:flatten(list)
return eval(join(a:list, "+"))
endfunction
2 0.000004 function! s:tabpagewinnr_list()
return s:flatten(map(range(1, tabpagenr("$")), "map(range(1, tabpagewinnr(v:val, '$')), '['.v:val.', v:val]')"))
endfunction
2 0.000006 if !exists("s:uniq_counter")
1 0.000002 let s:uniq_counter = 0
1 0.000001 endif
2 0.000004 function! s:make_uniq_nr()
let s:uniq_counter += 1
return s:uniq_counter
endfunction
2 0.000004 function! s:numbering(...)
let winnr = get(a:, 1, winnr())
let tabnr = get(a:, 2, tabpagenr())
let uniq_nr = s:make_uniq_nr()
call settabwinvar(tabnr, winnr, s:prefix . "_gift_uniq_winnr", uniq_nr)
return uniq_nr
endfunction
2 0.000004 function! s:uniq_nr(...)
let winnr = get(a:, 1, winnr())
let tabnr = get(a:, 2, tabpagenr())
let uniq_nr = get(gettabwinvar(tabnr, winnr, ""), s:prefix . "_gift_uniq_winnr", -1)
if uniq_nr == -1
let uniq_nr = s:numbering(winnr, tabnr)
endif
return uniq_nr
endfunction
2 0.000004 function! s:exists(nr)
let [tabnr, winnr] = s:tabpagewinnr(a:nr)
return tabnr != 0 && winnr != 0
endfunction
2 0.000005 function! s:tabpagewinnr(nr)
if a:nr == 0
return s:tabpagewinnr(s:uniq_nr())
endif
let tabwinnrs = s:tabpagewinnr_list()
for [tabnr, winnr] in tabwinnrs
if s:uniq_nr(winnr, tabnr) == a:nr
return [tabnr, winnr]
endif
endfor
return [0, 0]
endfunction
2 0.000004 function! s:getvar(nr, varname, ...)
let def = get(a:, 1, "")
let [tabnr, winnr] = s:tabpagewinnr(a:nr)
return get(gettabwinvar(tabnr, winnr, ""), a:varname, def)
endfunction
2 0.000004 function! s:setvar(nr, varname, val)
let [tabnr, winnr] = s:tabpagewinnr(a:nr)
if tabnr == 0 || winnr == 0
return
endif
return settabwinvar(tabnr, winnr, a:varname, a:val)
endfunction
2 0.000003 function! s:bufnr(nr)
let [tabnr, winnr] = s:tabpagewinnr(a:nr)
return winnr >= 1 ? get(tabpagebuflist(tabnr), winnr-1, -1) : -1
endfunction
2 0.000004 function! s:jump(nr)
let [tabnr, winnr] = s:tabpagewinnr(a:nr)
if tabnr == 0 || winnr == 0
return -1
endif
execute "tabnext" tabnr
execute winnr . "wincmd w"
endfunction
2 0.000005 function! s:close(nr, close_cmd)
call s:execute(a:nr, a:close_cmd)
" let current = gift#uniq_winnr()
" let result = s:jump(a:nr)
" if result == -1
" return -1
" endif
" execute a:close_cmd
" return s:jump(current)
endfunction
2 0.000004 function! s:execute(nr, expr)
let current = s:uniq_nr()
let result = s:jump(a:nr)
if result == -1
return -1
endif
execute a:expr
return s:jump(current)
endfunction
2 0.000016 let &cpo = s:save_cpo
2 0.000007 unlet s:save_cpo
SCRIPT /home/x/.vim/plugged/incsearch.vim/autoload/vital/_incsearch/Gift/Tabpage.vim
Sourced 2 times
Total time: 1507493888.729926
Self time: 1507493888.729825
count total (s) self (s)
" ___vital___
" NOTE: lines between '" ___vital___' is generated by :Vitalize.
" Do not mofidify the code nor insert new lines before '" ___vital___'
2 0.000008 if v:version > 703 || v:version == 703 && has('patch1170')
2 0.000064 function! vital#_incsearch#Gift#Tabpage#import() abort
return map({'uniq_nr': '', 'make_uniq_nr': '', 'numbering': '', 'set_prefix': ''}, 'function("s:" . v:key)')
endfunction
2 0.000003 else
function! s:_SID() abort
return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze__SID$')
endfunction
execute join(['function! vital#_incsearch#Gift#Tabpage#import() abort', printf("return map({'uniq_nr': '', 'make_uniq_nr': '', 'numbering': '', 'set_prefix': ''}, \"function('<SNR>%s_' . v:key)\")", s:_SID()), 'endfunction'], "\n")
delfunction s:_SID
endif
" ___vital___
2 0.000003 scriptencoding utf-8
2 0.000015 let s:save_cpo = &cpo
2 0.000015 set cpo&vim
2 0.000015 let s:prefix = expand("<sfile>:p:h:h:t")
2 0.000006 function! s:set_prefix(prefix)
let s:prefix = a:prefix
endfunction
2 0.000005 let s:uniq_counter = 0
2 0.000004 function! s:make_uniq_nr()
let s:uniq_counter += 1
return s:uniq_counter
endfunction
2 0.000004 function! s:numbering(...)
let tabnr = get(a:, 1, tabpagenr())
let uniq_nr = s:make_uniq_nr()
call settabvar(tabnr, s:prefix . "_gift_uniq_tabpagenr", uniq_nr)
return uniq_nr
endfunction
2 0.000004 function! s:uniq_nr(...)
let tabnr = get(a:, 1, tabpagenr())
let uniq_nr = get(gettabvar(tabnr, ""), s:prefix . "_gift_uniq_tabpagenr", -1)
if uniq_nr == -1
let uniq_nr = s:numbering(tabnr)
endif
return uniq_nr
endfunction
2 0.000017 let &cpo = s:save_cpo
2 0.000006 unlet s:save_cpo
SCRIPT /home/x/.vim/plugged/incsearch.vim/autoload/incsearch/over/extend.vim
Sourced 1 time
Total time: 0.000233
Self time: 0.000134
count total (s) self (s)
"=============================================================================
" FILE: autoload/incsearch/over/extend.vim
" AUTHOR: haya14busa
" License: MIT license
"=============================================================================
1 0.000002 scriptencoding utf-8
1 0.000007 let s:save_cpo = &cpo
1 0.000008 set cpo&vim
1 0.000002 let s:TRUE = !0
1 0.000002 let s:FALSE = 0
1 0.000003 let s:non_escaped_backslash = '\m\%(\%(^\|[^\\]\)\%(\\\\\)*\)\@<=\\'
1 0.000106 0.000007 let s:U = incsearch#util#import()
1 0.000004 function! incsearch#over#extend#enrich(cli) abort
return extend(a:cli, s:cli)
endfunction
1 0.000006 let s:cli = {
\ '_does_exit_from_incsearch': s:FALSE,
\ '_return_cmd': '',
\ '_converter_cache': {}
\ }
1 0.000002 function! s:cli._generate_command(input) abort
let is_cancel = self.exit_code()
if is_cancel
return s:U.is_visual(self._mode) ? '\<ESC>gv' : "\<ESC>"
else
call self._call_execute_event()
let [pattern, offset] = incsearch#parse_pattern(a:input, self._base_key)
" TODO: implement convert input method
let p = self._combine_pattern(self._convert(pattern), offset)
return self._build_search_cmd(p)
endif
endfunction
" @return search cmd
1 0.000002 function! s:cli._build_search_cmd(pattern, ...) abort
let mode = get(a:, 1, self._mode)
let op = (mode ==# 'no') ? v:operator
\ : s:U.is_visual(mode) ? 'gv'
\ : ''
let zv = (&foldopen =~# '\vsearch|all' && mode !=# 'no' ? 'zv' : '')
" NOTE:
" Should I consider o_v, o_V, and o_CTRL-V cases and do not
" <Esc>? <Esc> exists for flexible v:count with using s:cli._vcount1,
" but, if you do not move the cursor while incremental searching,
" there are no need to use <Esc>.
let esc = self._has_count ? "\<Esc>" : ''
let register = esc is# '' ? '' : '"' . v:register
let cnt = self._vcount1 is# 1 ? '' : self._vcount1
let prefix = esc . register . (esc is# '' ? '' : op) . cnt
return printf("%s%s%s\<CR>%s", prefix, self._base_key, a:pattern, zv)
endfunction
"" Call on_execute_pre and on_execute event
" assume current position is the destination and a:cli._w is the position to
" start search
1 0.000002 function! s:cli._call_execute_event(...) abort
let view = get(a:, 1, winsaveview())
try
call winrestview(self._w)
call self.callevent('on_execute_pre')
finally
call winrestview(view)
endtry
call self.callevent('on_execute')
endfunction
1 0.000001 function! s:cli._parse_pattern() abort
if v:version == 704 && !has('patch421')
" Ignore \ze* which clash vim 7.4 without 421 patch
" Assume `\m`
let [p, o] = incsearch#parse_pattern(self.getline(), self._base_key)
let p = (p =~# s:non_escaped_backslash . 'z[se]\%(\*\|\\+\)' ? '' : p)
return [p, o]
else
return incsearch#parse_pattern(self.getline(), self._base_key)
endif
endfunction
1 0.000002 function! s:cli._combine_pattern(pattern, offset) abort
return empty(a:offset) ? a:pattern : a:pattern . self._base_key . a:offset
endfunction
1 0.000002 function! s:cli._convert(pattern) abort
if a:pattern is# ''
return a:pattern
elseif empty(self._converters)
return incsearch#magic() . a:pattern
elseif has_key(self._converter_cache, a:pattern)
return self._converter_cache[a:pattern]
else
let ps = [incsearch#magic() . a:pattern]
for l:Converter in self._converters
let l:Convert = type(l:Converter) is type(function('function'))
\ ? l:Converter : l:Converter.convert
let ps += [l:Convert(a:pattern)]
unlet l:Converter
endfor
" Converters may return upper case even if a:pattern doesn't contain upper
" case letter, so prepend case flag explicitly
" let case = incsearch#detect_case(a:pattern)
let case = incsearch#detect_case(a:pattern)
let self._converter_cache[a:pattern] = case . s:U.regexp_join(ps)
return self._converter_cache[a:pattern]
endif
endfunction
1 0.000002 function! s:cli._exit_incsearch(...) abort
let cmd = get(a:, 1, '')
let self._return_cmd = cmd
let self._does_exit_from_incsearch = s:TRUE
call self.exit()
endfunction
1 0.000012 let &cpo = s:save_cpo
1 0.000002 unlet s:save_cpo
" __END__
" vim: expandtab softtabstop=2 shiftwidth=2 foldmethod=marker
SCRIPT /home/x/.vim/plugged/incsearch.vim/autoload/incsearch/autocmd.vim
Sourced 1 time
Total time: 0.000638
Self time: 0.000638
count total (s) self (s)
"=============================================================================
" FILE: autoload/incsearch/autocmd.vim
" AUTHOR: haya14busa
" License: MIT license
"=============================================================================
1 0.000007 scriptencoding utf-8
1 0.000021 let s:save_cpo = &cpo
1 0.000027 set cpo&vim
1 0.000175 noremap <silent><expr> <Plug>(_incsearch-nohlsearch) incsearch#autocmd#auto_nohlsearch(0)
1 0.000072 noremap! <silent><expr> <Plug>(_incsearch-nohlsearch) incsearch#autocmd#auto_nohlsearch(0)
1 0.000099 nnoremap <silent> <Plug>(_incsearch-nohlsearch) :<C-u>nohlsearch<CR>
1 0.000065 xnoremap <silent> <Plug>(_incsearch-nohlsearch) :<C-u>nohlsearch<CR>gv
" Make sure move cursor by search related action __after__ calling this
" function because the first move event just set nested autocmd which
" does :nohlsearch
" @expr
1 0.000016 function! incsearch#autocmd#auto_nohlsearch(nest) abort
" NOTE: see this value inside this function in order to toggle auto
" :nohlsearch feature easily with g:incsearch#autocmd#auto_nohlsearch option
if !g:incsearch#auto_nohlsearch | return '' | endif
return s:auto_nohlsearch(a:nest)
endfunction
1 0.000011 function! incsearch#autocmd#is_set() abort
return exists('#incsearch-auto-nohlsearch#CursorMoved')
endfunction
1 0.000008 function! s:auto_nohlsearch(nest) abort
" NOTE: :h autocmd-searchpat
" You cannot implement this feature without feedkeys() because of
" :h autocmd-searchpat
augroup incsearch-auto-nohlsearch
autocmd!
autocmd InsertEnter * :call <SID>attach_on_insert_leave() | autocmd! incsearch-auto-nohlsearch
execute join([
\ 'autocmd CursorMoved *'
\ , repeat('autocmd incsearch-auto-nohlsearch CursorMoved * ', a:nest)
\ , 'call feedkeys("\<Plug>(_incsearch-nohlsearch)", "m")'
\ , '| autocmd! incsearch-auto-nohlsearch'
\ ], ' ')
augroup END
return ''
endfunction
1 0.000007 function! s:attach_on_insert_leave() abort
augroup incsearch-auto-nohlsearch-on-insert-leave
autocmd!
autocmd InsertLeave * :call incsearch#autocmd#auto_nohlsearch(1)
\ | autocmd! incsearch-auto-nohlsearch-on-insert-leave
augroup END
return ''
endfunction
1 0.000024 let &cpo = s:save_cpo
1 0.000006 unlet s:save_cpo
" __END__
" vim: expandtab softtabstop=2 shiftwidth=2 foldmethod=marker
SCRIPT /home/x/.vim/plugged/CamelCaseMotion/autoload/camelcasemotion.vim
Sourced 1 time
Total time: 0.000665
Self time: 0.000665
count total (s) self (s)
" camelcasemotion.vim: Motion through CamelCaseWords and underscore_notation.
"
" DEPENDENCIES:
" - Requires Vim 7.0 or higher.
"
" Copyright: (C) 2007-2009 by Ingo Karkat
" The VIM LICENSE applies to this script; see ':help copyright'.
"
" Maintainer: Ingo Karkat <ingo@karkat.de>
" REVISION DATE REMARKS
" 1.50.001 05-May-2009 Do not create mappings for select mode;
" according to|Select-mode|, printable character
" commands should delete the selection and insert
" the typed characters.
" Moved functions from plugin to separate autoload
" script.
" file creation
"- functions ------------------------------------------------------------------"
1 0.000015 let s:forward_to_end_list = []
1 0.000017 call add(s:forward_to_end_list, '\m\d\+') " number
1 0.000011 call add(s:forward_to_end_list, '\u\+\ze\%(\u\l\|\d\)') " ALLCAPS followed by CamelCase or number
1 0.000010 call add(s:forward_to_end_list, '\l\+\ze\%(\u\|\d\)') " lowercase followed by ALLCAPS
1 0.000009 call add(s:forward_to_end_list, '\u\l\+') " CamelCase
1 0.000009 call add(s:forward_to_end_list, '\%(\a\|\d\)\+\ze[-_]') " underscore_notation
1 0.000008 call add(s:forward_to_end_list, '\%(\k\@!\S\)\+') " non-keyword
1 0.000009 call add(s:forward_to_end_list, '\%([-_]\@!\k\)\+\>') " word
1 0.000017 let s:forward_to_end = join(s:forward_to_end_list, '\|')
1 0.000007 let s:forward_to_next_list = []
1 0.000009 call add(s:forward_to_next_list, '\m\<\D') " word
1 0.000008 call add(s:forward_to_next_list, '^$') " empty line
1 0.000010 call add(s:forward_to_next_list, '\%(^\|\s\)\+\zs\k\@!\S') " non-keyword after whitespaces
1 0.000008 call add(s:forward_to_next_list, '\>\<') " non-whitespace after word
1 0.000008 call add(s:forward_to_next_list, '[{}\[\]()<>]') " brackets, parens, braces
1 0.000008 call add(s:forward_to_next_list, '\d\+') " number
1 0.000010 call add(s:forward_to_next_list, '\l\+\zs\%(\u\|\d\)') " lowercase followed by capital letter or number
1 0.000009 call add(s:forward_to_next_list, '\u\+\zs\%(\u\l\|\d\)') " ALLCAPS followed by CamelCase or number
1 0.000008 call add(s:forward_to_next_list, '\u\l\+') " CamelCase
1 0.000008 call add(s:forward_to_next_list, '\u\@<!\u\+') " ALLCAPS
1 0.000009 call add(s:forward_to_next_list, '[-_]\zs\%(\u\+\|\u\l\+\|\l\+\|\d\+\)') " underscored followed by ALLCAPS, CamelCase, lowercase, or number
1 0.000015 let s:forward_to_next = join(s:forward_to_next_list, '\|')
1 0.000012 function! s:Move(direction, count, mode)
" Note: There is no inversion of the regular expression character class
" 'keyword character' (\k). We need an inversion "non-keyword" defined as
" "any non-whitespace character that is not a keyword character" (e.g.
" [!@#$%^&*()]). This can be specified via a non-whitespace character in
" whose place no keyword character matches (\k\@!\S).
"echo "count is " . a:count
let l:i = 0
while l:i < a:count
if a:direction == 'e' || a:direction == 'ge'
" "Forward to end" motion.
" number | ACRONYM followed by CamelCase or number | CamelCase | underscore_notation | non-keyword | word
let l:direction = (a:direction == 'e' ? a:direction : 'be')
call search(s:forward_to_end, 'W' . l:direction)
" Note: word must be defined as '\k\>'; '\>' on its own somehow
" dominates over the previous branch. Plus, \k must exclude the
" underscore, or a trailing one will be incorrectly moved over:
" '\%(_\@!\k\)'.
if a:mode == 'o'
" Note: Special additional treatment for operator-pending mode
" "forward to end" motion.
" The difference between normal mode, operator-pending and visual
" mode is that in the latter two, the motion must go _past_ the
" final "word" character, so that all characters of the "word" are
" selected. This is done by appending a 'l' motion after the
" search for the next "word".
"
" In operator-pending mode, the 'l' motion only works properly
" at the end of the line (i.e. when the moved-over "word" is at
" the end of the line) when the 'l' motion is allowed to move
" over to the next line. Thus, the 'l' motion is added
" temporarily to the global 'whichwrap' setting.
" Without this, the motion would leave out the last character in
" the line. I've also experimented with temporarily setting
" "set virtualedit=onemore" , but that didn't work.
let l:save_ww = &whichwrap
set whichwrap+=l
normal! l
let &whichwrap = l:save_ww
endif
else
" Forward (a:direction == '') and backward (a:direction == 'b')
" motion.
let l:direction = (a:direction == 'w' ? '' : a:direction)
" word | empty line | non-keyword after whitespaces | non-whitespace after word | number | lowercase folowed by capital letter or number | ACRONYM followed by CamelCase or number | CamelCase | ACRONYM | underscore followed by ACRONYM, Camel, lowercase or number
call search(s:forward_to_next, 'W' . l:direction)
" Note: word must be defined as '\<\D' to avoid that a word like
" 1234Test is moved over as [1][2]34[T]est instead of [1]234[T]est
" because \< matches with zero width, and \d\+ will then start
" matching '234'. To fix that, we make \d\+ be solely responsible
" for numbers by taken this away from \< via \<\D. (An alternative
" would be to replace \d\+ with \D\%#\zs\d\+, but that one is more
" complex.) All other branches are not affected, because they match
" multiple characters and not the same character multiple times.
endif
let l:i = l:i + 1
endwhile
endfunction
1 0.000013 function! camelcasemotion#Motion(direction, count, mode)
"*******************************************************************************
"* PURPOSE:
" Perform the motion over CamelCaseWords or underscore_notation.
"* ASSUMPTIONS / PRECONDITIONS:
" none
"* EFFECTS / POSTCONDITIONS:
" Move cursor / change selection.
"* INPUTS:
" a:direction one of 'w', 'b', 'e'
" a:count number of "words" to move over
" a:mode one of 'n', 'o', 'v', 'iv' (latter one is a special visual mode
" when inside the inner "word" text objects.
"* RETURN VALUES:
" none
"*******************************************************************************
" Visual mode needs special preparations and postprocessing;
" normal and operator-pending mode breeze through to s:Move().
if a:mode == 'v'
" Visual mode was left when calling this function. Reselecting the current
" selection returns to visual mode and allows to call search() and issue
" normal mode motions while staying in visual mode.
normal! gv
endif
if a:mode == 'v' || a:mode == 'iv'
" Note_1a:
if &selection != 'exclusive' && a:direction == 'w'
normal! l
endif
endif
call s:Move(a:direction, a:count, a:mode)
if a:mode == 'v' || a:mode == 'iv'
" Note: 'selection' setting.
if &selection == 'exclusive' && (a:direction == 'e' || a:direction == 'ge')
" When set to 'exclusive', the "forward to end" motion (',e') does not
" include the last character of the moved-over "word". To include that, an
" additional 'l' motion is appended to the motion; similar to the
" special treatment in operator-pending mode.
normal! l
elseif &selection != 'exclusive' && (
\ (a:direction != 'e' && a:direction == 'ge')
\ || (a:mode == 'iv' && a:direction == 'w'))
" Note_1b:
" The forward and backward motions move to the beginning of the next "word".
" When 'selection' is set to 'inclusive' or 'old', this is one character too far.
" The appended 'h' motion undoes this. Because of this backward step,
" though, the forward motion finds the current "word" again, and would
" be stuck on the current "word". An 'l' motion before the CamelCase
" motion (see Note_1a) fixes that.
" Note_1c:
" A similar problem applies when selecting a whole inner "word": the
" cursor moves to the beginning of the next "word" which for an
" inclusive selection, at least in operator-pending mode, leads to
" counter-intuitive results. (See github issues #28 and #31.) The
" appended 'h' is needed in that case as well. Possibly for 'v' mode
" too.
normal! h
endif
endif
endfunction
1 0.000012 function! camelcasemotion#InnerMotion(direction, count)
" If the cursor is positioned on the first character of a CamelWord, the
" backward motion would move to the previous word, which would result in a
" wrong selection. To fix this, first move the cursor to the right, so that
" the backward motion definitely will cover the current "word" under the
" cursor.
normal! l
" Move "word" backwards, enter visual mode, then move "word" forward. This
" selects the inner "word" in visual mode; the operator-pending mode takes
" this selection as the area covered by the motion.
if a:direction == 'b'
" Do not do the selection backwards, because the backwards "word" motion
" in visual mode + selection=inclusive has an off-by-one error.
call camelcasemotion#Motion('b', a:count, 'n')
normal! v
" We decree that 'b' is the opposite of 'e', not 'w'. This makes more
" sense at the end of a line and for underscore_notation.
call camelcasemotion#Motion('e', a:count, 'iv')
else
call camelcasemotion#Motion('b', 1, 'n')
normal! v
call camelcasemotion#Motion(a:direction, a:count, 'iv')
endif
endfunction
1 0.000013 function! camelcasemotion#CreateMotionMappings(leader)
" Create mappings according to this template:
" (* stands for the mode [nov], ? for the underlying motion [wbe].)
for l:mode in ['n', 'o', 'v']
for l:motion in ['w', 'b', 'e', 'ge']
let l:targetMapping = '<Plug>CamelCaseMotion_' . l:motion
execute (l:mode ==# 'v' ? 'x' : l:mode) .
\ 'map <silent> ' . a:leader . l:motion . ' ' . l:targetMapping
endfor
endfor
" Create mappings according to this template:
" (* stands for the mode [ov], ? for the underlying motion [wbe].)
for l:mode in ['o', 'v']
for l:motion in ['w', 'b', 'e', 'ge']
let l:targetMapping = '<Plug>CamelCaseMotion_i' . l:motion
execute (l:mode ==# 'v' ? 'x' : l:mode) .
\ 'map <silent> i' . a:leader . l:motion . ' ' . l:targetMapping
endfor
endfor
endfunction
" vim: set sts=2 sw=2 expandtab ff=unix fdm=syntax :
FUNCTION <SNR>167__import_func_name()
Called 39 times
Total time: 0.000579
Self time: 0.000322
count total (s) self (s)
39 0.000559 0.000302 return printf('vital#_%s#%s#import', a:plugin_name, s:_dot_to_sharp(a:module_name))
FUNCTION <SNR>121_wordcount_update()
Called 483 times
Total time: 0.106838
Self time: 0.071716
count total (s) self (s)
483 0.004073 if empty(bufname(''))
return
endif
483 0.023133 if match(&ft, get(g:, 'airline#extensions#wordcount#filetypes')) > -1
483 0.003724 let l:mode = mode()
483 0.003984 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
483 0.012795 if get(b:, 'airline_wordcount_cache', '') is# '' || b:airline_wordcount_cache isnot# get(b:, 'airline_wordcount', '') || get(b:, 'airline_change_tick', 0) != b:changedtick || get(b:, 'airline_winwidth', 0) != winwidth(0)
" cache data
37 0.035525 0.000403 let b:airline_wordcount = airline#extensions#wordcount#formatters#{s:formatter}#format()
37 0.000113 let b:airline_wordcount_cache = b:airline_wordcount
37 0.000100 let b:airline_change_tick = b:changedtick
37 0.000116 let b:airline_winwidth = winwidth(0)
37 0.000034 endif
483 0.000952 endif
483 0.000917 endif
FUNCTION 267()
Called 9 times
Total time: 0.000369
Self time: 0.000192
count total (s) self (s)
9 0.000253 0.000118 if self.is_no_insert(a:cmdline.char())
2 0.000057 0.000015 call a:cmdline.setchar("", 0)
2 0.000003 endif
FUNCTION <SNR>133_section_is_empty()
Called 18 times
Total time: 0.002408
Self time: 0.001769
count total (s) self (s)
18 0.000045 let start=1
" do not check for inactive windows or the tabline
18 0.000047 if a:self._context.active == 0
return 0
elseif get(a:self._context, 'tabline', 0)
return 0
endif
" only check, if airline#skip_empty_sections == 1
18 0.000067 if get(g:, 'airline_skip_empty_sections', 0) == 0
return 0
endif
" only check, if airline#skip_empty_sections == 1
18 0.000068 if get(w:, 'airline_skip_empty_sections', -1) == 0
return 0
endif
" assume accents sections to be never empty
" (avoides, that on startup the mode message becomes empty)
18 0.000502 if match(a:content, '%#__accent_[^#]*#.*__restore__#') > -1
6 0.000012 return 0
endif
12 0.000036 if empty(a:content)
2 0.000003 return 1
endif
10 0.000183 let list=matchlist(a:content, '%{\zs.\{-}\ze}', 1, start)
10 0.000028 if empty(list)
2 0.000005 return 0 " no function in statusline text
endif
10 0.000027 while len(list) > 0
8 0.000028 let expr = list[0]
8 0.000009 try
" catch all exceptions, just in case
8 0.000765 0.000126 if !empty(eval(expr))
6 0.000008 return 0
endif
2 0.000002 catch
return 0
endtry
2 0.000005 let start += 1
2 0.000039 let list=matchlist(a:content, '%{\zs.\{-}\ze}', 1, start)
2 0.000003 endw
2 0.000002 return 1
FUNCTION vital#_incsearch#Over#Commandline#import()
Called 1 time
Total time: 0.000034
Self time: 0.000034
count total (s) self (s)
1 0.000034 return map({'_vital_depends': '', 'make_standard_search_back': '', 'get_module': '', 'make_standard_search': '', 'make_standard': '', 'make_module': '', 'make_default': '', '_vital_loaded': ''}, 'function("s:" . v:key)')
FUNCTION <SNR>160_wordcount()
Called 37 times
Total time: 0.031947
Self time: 0.031947
count total (s) self (s)
37 0.000183 if exists("*wordcount")
37 0.000130 let l:mode = mode()
37 0.000157 if l:mode ==# 'v' || l:mode ==# 'V' || l:mode ==# 's' || l:mode ==# 'S'
let l:visual_words = wordcount()['visual_words']
if l:visual_words != ''
return l:visual_words
else
return 0
endif
else
37 0.030984 return wordcount()['words']
endif
elseif mode() =~? 's'
return
else
let old_status = v:statusmsg
let position = getpos(".")
exe "silent normal! g\<c-g>"
let stat = v:statusmsg
call setpos('.', position)
let v:statusmsg = old_status
let parts = split(stat)
if len(parts) > 11
return str2nr(parts[11])
else
return
endif
endif
FUNCTION 5()
Called 2 times
Total time: 0.000014
Self time: 0.000014
count total (s) self (s)
2 0.000013 call add(self._sections, ['|', a:0 ? a:1 : '%='])
FUNCTION 7()
Called 16 times
Total time: 0.000106
Self time: 0.000106
count total (s) self (s)
16 0.000097 call add(self._sections, [a:group, a:contents])
FUNCTION 9()
Called 2 times
Total time: 0.017414
Self time: 0.002319
count total (s) self (s)
2 0.000006 let side = 1
2 0.000004 let line = ''
2 0.000004 let i = 0
2 0.000008 let length = len(self._sections)
2 0.000004 let split = 0
2 0.000004 let is_empty = 0
2 0.000005 let prev_group = ''
20 0.000041 while i < length
18 0.000067 let section = self._sections[i]
18 0.000077 let group = section[0]
18 0.000058 let contents = section[1]
18 0.000042 let pgroup = prev_group
18 0.000510 0.000168 let prev_group = s:get_prev_group(self._sections, i)
18 0.000084 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
18 0.000028 if is_empty
2 0.000005 let prev_group = pgroup
2 0.000002 endif
18 0.002588 0.000180 let is_empty = s:section_is_empty(self, contents)
18 0.000032 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
4 0.000010 let pgroup = group
4 0.000004 endif
18 0.000034 if group == ''
let line .= contents
elseif group == '|'
2 0.000003 let side = 0
2 0.000005 let line .= contents
2 0.000004 let split = 1
2 0.000003 else
16 0.000032 if prev_group == ''
2 0.000009 let line .= '%#'.group.'#'
2 0.000003 elseif split
2 0.000004 if !is_empty
2 0.001741 0.000023 let line .= s:get_transitioned_seperator(self, prev_group, group, side)
2 0.000002 endif
2 0.000004 let split = 0
2 0.000002 else
12 0.000016 if !is_empty
8 0.009738 0.000102 let line .= s:get_seperator(self, prev_group, group, side)
8 0.000008 endif
12 0.000009 endif
16 0.001179 0.000188 let line .= is_empty ? '' : s:get_accented_line(self, group, contents)
16 0.000020 endif
18 0.000056 let i = i + 1
18 0.000033 endwhile
2 0.000004 if !self._context.active
"let line = substitute(line, '%#airline_c#', '%#airline_c'.self._context.bufnr.'#', '')
let line = substitute(line, '%#.\{-}\ze#', '\0_inactive', 'g')
endif
2 0.000006 return line
FUNCTION <SNR>116_sync_active_winnr()
Called 446 times
Total time: 0.010158
Self time: 0.010158
count total (s) self (s)
446 0.006056 if exists('#airline') && winnr() != s:active_winnr
call airline#update_statusline()
endif
FUNCTION ale#job#IsRunning()
Called 4 times
Total time: 0.000087
Self time: 0.000087
count total (s) self (s)
4 0.000016 if has('nvim')
try
" In NeoVim, if the job isn't running, jobpid() will throw.
call jobpid(a:job_id)
return 1
catch
endtry
elseif has_key(s:job_map, a:job_id)
let l:job = s:job_map[a:job_id].job
return job_status(l:job) is# 'run'
endif
4 0.000004 return 0
FUNCTION incsearch#over#modules#exit#make()
Called 1 time
Total time: 0.000005
Self time: 0.000005
count total (s) self (s)
1 0.000004 return deepcopy(s:incsearch_exit)
FUNCTION <SNR>171__clamp()
Called 10 times
Total time: 0.000148
Self time: 0.000148
count total (s) self (s)
10 0.000130 return min([max([a:x, a:max]), a:min])
FUNCTION airline#util#exec_funcrefs()
Called 3 times
Total time: 0.014309
Self time: 0.000406
count total (s) self (s)
14 0.000048 for Fn in a:list
13 0.014147 0.000244 let code = call(Fn, a:000)
13 0.000028 if code != 0
2 0.000004 return code
endif
11 0.000015 endfor
1 0.000002 return 0
FUNCTION <SNR>116_is_excluded_window()
Called 2 times
Total time: 0.000160
Self time: 0.000160
count total (s) self (s)
2 0.000007 for matchft in g:airline_exclude_filetypes
if matchft ==# &ft
return 1
endif
endfor
8 0.000019 for matchw in g:airline_exclude_filenames
6 0.000061 if matchstr(expand('%'), matchw) ==# matchw
return 1
endif
6 0.000005 endfor
2 0.000006 if g:airline_exclude_preview && &previewwindow
return 1
endif
2 0.000003 return 0
FUNCTION gitgutter#process_buffer()
Called 1 time
Total time: 0.000732
Self time: 0.000251
count total (s) self (s)
1 0.000118 0.000034 call gitgutter#utility#use_known_shell()
1 0.000059 0.000027 call gitgutter#utility#set_buffer(a:bufnr)
1 0.000245 0.000024 if gitgutter#utility#is_active()
1 0.000005 if g:gitgutter_sign_column_always
call gitgutter#sign#add_dummy_sign()
endif
1 0.000002 try
1 0.000109 0.000027 if !a:realtime || gitgutter#utility#has_fresh_changes()
let diff = gitgutter#diff#run_diff(a:realtime || gitgutter#utility#has_unsaved_changes(), 0)
if diff != 'async'
call gitgutter#handle_diff(diff)
endif
endif
1 0.000003 catch /diff failed/
call gitgutter#debug#log('diff failed')
call gitgutter#hunk#reset()
endtry
1 0.000058 0.000042 execute "silent doautocmd" s:nomodeline "User GitGutter"
1 0.000003 else
call gitgutter#hunk#reset()
endif
1 0.000069 0.000023 call gitgutter#utility#restore_shell()
FUNCTION <SNR>206__vital_loaded()
Called 1 time
Total time: 0.006938
Self time: 0.000026
count total (s) self (s)
1 0.000002 let s:V = a:V
1 0.004274 0.000005 let s:Window = a:V.import("Coaster.Window")
1 0.002241 0.000011 let s:Gift = a:V.import("Gift")
1 0.000421 0.000008 call s:_init()
FUNCTION <SNR>134_build_sections()
Called 4 times
Total time: 0.002460
Self time: 0.000370
count total (s) self (s)
20 0.000044 for key in a:keys
16 0.000068 if (key == 'warning' || key == 'error') && !a:context.active
continue
endif
16 0.002234 0.000144 call s:add_section(a:builder, a:context, key)
16 0.000020 endfor
FUNCTION 308()
Called 28 times
Total time: 0.001686
Self time: 0.000888
count total (s) self (s)
28 0.001043 0.000245 call self.delete(a:name)
28 0.000212 let priority = get(a:, 1, 10)
28 0.000374 let self.variables.hl_list[a:name] = { "group" : a:group, "pattern" : a:pattern, "priority" : priority, "name" : a:name, }
FUNCTION airline#extensions#wordcount#formatters#default#format()
Called 37 times
Total time: 0.035122
Self time: 0.002757
count total (s) self (s)
37 0.032335 0.000388 let words = string(s:wordcount())
37 0.000104 if empty(words)
return
endif
37 0.000194 let result = g:airline_symbols.space . g:airline_right_alt_sep . g:airline_symbols.space
37 0.000096 if winwidth(0) >= 80
37 0.000677 0.000259 let separator = s:get_decimal_group()
37 0.000128 if words > 999 && !empty(separator)
" Format number according to locale, e.g. German: 1.245 or English: 1,245
37 0.000820 let words = substitute(words, '\d\@<=\(\(\d\{3\}\)\+\)$', separator.'&', 'g')
37 0.000046 endif
37 0.000257 let result = printf("%s%s", words, " words"). result
37 0.000042 else
let result = printf("%s%s", words, "W"). result
endif
37 0.000063 return result
FUNCTION <SNR>170__is_valid_highlight()
Called 1 time
Total time: 0.000352
Self time: 0.000027
count total (s) self (s)
1 0.000332 0.000007 let highlight = s:Highlight.get(a:name)
1 0.000002 if empty(highlight)
return 0
endif
1 0.000007 if has("gui_running") && (has_key(highlight, "guifg") || has_key(highlight, "guibg"))
return 1
elseif (has_key(highlight, "ctermfg") || has_key(highlight, "ctermbg"))
return 1
endif
1 0.000001 return 0
FUNCTION vital#_incsearch#Coaster#Highlight#import()
Called 1 time
Total time: 0.000069
Self time: 0.000069
count total (s) self (s)
1 0.000068 return map({'highlight': '', 'clear': '', 'delete': '', 'add': '', 'as_windo': '', '_vital_depends': '', 'get_hl_id': '', 'to_list': '', 'clear_all': '', 'delete_all': '', 'to_list_by': '', 'update': '', 'enable': '', 'delete_by': '', 'hl_list': '', 'make': '', 'enable_list': '', 'update_all': '', 'disable': '', 'disable_all': '', 'is_enabled': '', 'enable_all': '', 'is_added': '', '_vital_loaded': ''}, 'function("s:" . v:key)')
FUNCTION ale#linter#Get()
Called 2 times
Total time: 0.001805
Self time: 0.000892
count total (s) self (s)
2 0.000017 let l:possibly_duplicated_linters = []
" Handle dot-seperated filetypes.
4 0.000042 for l:original_filetype in split(a:original_filetypes, '\.')
2 0.000508 0.000050 let l:filetype = ale#linter#ResolveFiletype(l:original_filetype)
2 0.000264 0.000059 let l:linter_names = s:GetLinterNames(l:original_filetype)
2 0.000293 0.000043 let l:all_linters = ale#linter#GetAll(l:filetype)
2 0.000011 let l:filetype_linters = []
2 0.000024 if type(l:linter_names) == type('') && l:linter_names is# 'all'
2 0.000013 let l:filetype_linters = l:all_linters
2 0.000012 elseif type(l:linter_names) == type([])
" Select only the linters we or the user has specified.
for l:linter in l:all_linters
let l:name_list = [l:linter.name] + l:linter.aliases
for l:name in l:name_list
if index(l:linter_names, l:name) >= 0
call add(l:filetype_linters, l:linter)
break
endif
endfor
endfor
endif
2 0.000023 call extend(l:possibly_duplicated_linters, l:filetype_linters)
2 0.000005 endfor
2 0.000011 let l:name_list = []
2 0.000010 let l:combined_linters = []
" Make sure we override linters so we don't get two with the same name,
" like 'eslint' for both 'javascript' and 'typescript'
"
" Note that the reverse calls here modify the List variables.
8 0.000040 for l:linter in reverse(l:possibly_duplicated_linters)
6 0.000055 if index(l:name_list, l:linter.name) < 0
6 0.000049 call add(l:name_list, l:linter.name)
6 0.000048 call add(l:combined_linters, l:linter)
6 0.000012 endif
6 0.000012 endfor
2 0.000016 return reverse(l:combined_linters)
FUNCTION incsearch#execute_search()
Called 11 times
Total time: 0.008358
Self time: 0.000246
count total (s) self (s)
11 0.008345 0.000233 return call(function('s:_execute_search'), a:000)
FUNCTION <SNR>135_GetCounts()
Called 550 times
Total time: 0.027684
Self time: 0.027684
count total (s) self (s)
550 0.007195 if !exists('g:ale_buffer_info') || !has_key(g:ale_buffer_info, a:buffer)
return s:CreateCountDict()
endif
" Cache is cold, so manually ask for an update.
550 0.004996 if !has_key(g:ale_buffer_info[a:buffer], 'count')
call ale#statusline#Update(a:buffer, g:ale_buffer_info[a:buffer].loclist)
endif
550 0.003633 return g:ale_buffer_info[a:buffer].count
FUNCTION <SNR>129_get_syn()
Called 578 times
Total time: 0.036347
Self time: 0.036347
count total (s) self (s)
578 0.003576 if !exists("g:airline_gui_mode")
let g:airline_gui_mode = airline#init#gui_mode()
endif
578 0.001603 let color = ''
578 0.003570 if hlexists(a:group)
554 0.006960 let color = synIDattr(synIDtrans(hlID(a:group)), a:what, g:airline_gui_mode)
554 0.000947 endif
578 0.002943 if empty(color) || color == -1
" should always exists
24 0.000514 let color = synIDattr(synIDtrans(hlID('Normal')), a:what, g:airline_gui_mode)
" however, just in case
24 0.000167 if empty(color) || color == -1
let color = 'NONE'
endif
24 0.000044 endif
578 0.001547 return color
FUNCTION <SNR>153_GroupLoclistItems()
Called 4 times
Total time: 0.017791
Self time: 0.017791
count total (s) self (s)
4 0.000011 let l:grouped_items = []
4 0.000008 let l:last_lnum = -1
1060 0.001174 for l:obj in a:loclist
1056 0.001717 if l:obj.bufnr != a:buffer
continue
endif
" Create a new sub-List when we hit a new line.
1056 0.001765 if l:obj.lnum != l:last_lnum
484 0.001261 call add(l:grouped_items, [])
484 0.000371 endif
1056 0.003509 call add(l:grouped_items[-1], l:obj)
1056 0.002259 let l:last_lnum = l:obj.lnum
1056 0.000887 endfor
4 0.000008 return l:grouped_items
FUNCTION 105()
Called 1 time
Total time: 0.576626
Self time: 0.000019
count total (s) self (s)
1 0.576620 0.000013 let exit_code = call(self.__main, a:000, self)
1 0.000004 return exit_code
FUNCTION vital#_incsearch#Data#List#import()
Called 1 time
Total time: 0.000129
Self time: 0.000129
count total (s) self (s)
1 0.000128 return map({'combinations': '', 'and': '', 'sort_by': '', 'foldr1': '', 'sort': '', 'flatten': '', 'has_index': '', 'find_indices': '', 'any': '', 'unshift': '', 'span': '', 'pop': '', 'binary_search': '', 'uniq_by': '', 'or': '', 'all': '', 'zip': '', 'find_last_index': '', 'find': '', 'partition': '', 'map_accum': '', 'permutations': '', 'break': '', 'max_by': '', 'foldl': '', 'foldr': '', 'find_index': '', 'group_by': '', 'take_while': '', 'conj': '', 'push': '', 'char_range': '', 'cons': '', 'foldl1': '', 'intersect': '', 'concat': '', 'shift': '', 'clear': '', 'has_common_items': '', 'product': '', 'zip_fill': '', 'uniq': '', 'has': '', 'min_by': '', 'with_index': ''}, 'function("s:" . v:key)')
FUNCTION <SNR>197_capture()
Called 1 time
Total time: 0.000233
Self time: 0.000023
count total (s) self (s)
1 0.000003 let mode = get(a:, 1, "")
1 0.000005 let modes = split(mode, '\zs')
1 0.000224 0.000014 return join(map(modes, "s:_capture(v:val)"), "\n")
FUNCTION airline#check_mode()
Called 547 times
Total time: 0.230623
Self time: 0.131643
count total (s) self (s)
547 0.004446 if !exists("s:airline_run")
let s:airline_run = 0
endif
547 0.003008 let s:airline_run += 1
547 0.004224 let context = s:contexts[a:winnr]
547 0.003576 if get(w:, 'airline_active', 1)
547 0.003261 let l:m = mode()
547 0.002022 if l:m ==# "i"
82 0.000262 let l:mode = ['insert']
82 0.000146 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
465 0.002332 let l:mode = ['normal']
465 0.000974 endif
547 0.005739 let w:airline_current_mode = get(g:airline_mode_map, l:m, l:m)
547 0.001084 else
let l:mode = ['inactive']
let w:airline_current_mode = get(g:airline_mode_map, '__')
endif
547 0.003497 if g:airline_detect_modified && &modified
114 0.000630 call add(l:mode, 'modified')
114 0.000150 endif
547 0.002332 if g:airline_detect_paste && &paste
call add(l:mode, 'paste')
endif
547 0.005054 if g:airline_detect_crypt && exists("+key") && !empty(&key)
call add(l:mode, 'crypt')
endif
547 0.002873 if g:airline_detect_spell && &spell
547 0.003991 call add(l:mode, 'spell')
547 0.001092 endif
547 0.002181 if &readonly || ! &modifiable
call add(l:mode, 'readonly')
endif
547 0.005035 let mode_string = join(l:mode)
547 0.002134 if s:airline_run < 3
" skip this round.
" When this function is run too early after startup,
" it forces a redraw by vim which will remove the intro screen.
let w:airline_lastmode = mode_string
return ''
endif
547 0.004671 if get(w:, 'airline_lastmode', '') != mode_string
3 0.002512 0.000073 call airline#highlighter#highlight_modified_inactive(context.bufnr)
3 0.096595 0.000054 call airline#highlighter#highlight(l:mode, context.bufnr)
3 0.000014 let w:airline_lastmode = mode_string
3 0.000004 endif
547 0.001490 return ''
FUNCTION <SNR>180_make()
Called 1 time
Total time: 0.000004
Self time: 0.000004
count total (s) self (s)
1 0.000004 return deepcopy(s:module)
FUNCTION <SNR>133_should_change_group()
Called 8 times
Total time: 0.003002
Self time: 0.000276
count total (s) self (s)
8 0.000024 if a:group1 == a:group2
return 0
endif
8 0.001423 0.000062 let color1 = airline#highlighter#get_highlight(a:group1)
8 0.001421 0.000056 let color2 = airline#highlighter#get_highlight(a:group2)
8 0.000020 if g:airline_gui_mode ==# 'gui'
return color1[1] != color2[1] || color1[0] != color2[0]
else
8 0.000043 return color1[3] != color2[3] || color1[2] != color2[2]
endif
FUNCTION airline#util#append()
Called 3829 times
Total time: 0.110026
Self time: 0.110026
count total (s) self (s)
3829 0.023506 if a:minwidth > 0 && winwidth(0) < a:minwidth
return ''
endif
3829 0.029270 let prefix = s:spc == "\ua0" ? s:spc : s:spc.s:spc
3829 0.032154 return empty(a:text) ? '' : prefix.g:airline_left_alt_sep.s:spc.a:text
FUNCTION <SNR>170__vital_loaded()
Called 1 time
Total time: 0.005767
Self time: 0.000062
count total (s) self (s)
1 0.000002 let s:V = a:V
1 0.002132 0.000006 let s:String = s:V.import("Over.String")
1 0.000735 0.000008 let s:Signals = s:V.import("Over.Signals")
1 0.000433 0.000007 let s:Input = s:V.import("Over.Input")
1 0.000631 0.000006 let s:Keymapping = s:V.import("Over.Keymapping")
1 0.000539 0.000007 let s:Module = s:V.import("Over.Commandline.Modules")
1 0.000021 0.000012 let s:base.variables.modules = s:Signals.make()
1 0.000002 function! s:base.variables.modules.get_slot(val)
return a:val.slot.module
endfunction
1 0.001267 0.000007 let s:Highlight = s:V.import("Palette.Highlight")
FUNCTION <SNR>68_GetPrevChar()
Called 17 times
Total time: 0.000605
Self time: 0.000191
count total (s) self (s)
17 0.000591 0.000177 return s:GetCharBehind(1)
FUNCTION <SNR>156_EchoWithShortMess()
Called 363 times
Total time: 0.096345
Self time: 0.096345
count total (s) self (s)
" We need to remember the setting for shormess and reset it again.
363 0.004916 let l:shortmess_options = getbufvar('%', '&shortmess')
363 0.000960 try
" Turn shortmess on or off.
363 0.001649 if a:setting is# 'on'
363 0.005548 setlocal shortmess+=T
" echomsg is needed for the message to get truncated and appear in
" the message history.
363 0.060169 exec "norm! :echomsg a:message\n"
363 0.001890 elseif a:setting is# 'off'
setlocal shortmess-=T
" Regular echo is needed for printing newline characters.
echo a:message
else
throw 'Invalid setting: ' . string(a:setting)
endif
363 0.001293 finally
363 0.007708 call setbufvar('%', '&shortmess', l:shortmess_options)
363 0.001266 endtry
FUNCTION <SNR>142_HandleLoclist()
Called 4 times
Total time: 0.378159
Self time: 0.010875
count total (s) self (s)
4 0.000030 let l:buffer_info = get(g:ale_buffer_info, a:buffer, {})
4 0.000009 if empty(l:buffer_info)
return
endif
" Remove this linter from the list of active linters.
" This may have already been done when the job exits.
4 0.000023 call filter(l:buffer_info.active_linter_list, 'v:val isnot# a:linter_name')
" Make some adjustments to the loclists to fix common problems, and also
" to set default values for loclist items.
4 0.039610 0.000039 let l:linter_loclist = ale#engine#FixLocList(a:buffer, a:linter_name, a:loclist)
" Remove previous items for this linter.
4 0.001523 call filter(g:ale_buffer_info[a:buffer].loclist, 'v:val.linter_name isnot# a:linter_name')
" Add the new items.
4 0.000050 call extend(g:ale_buffer_info[a:buffer].loclist, l:linter_loclist)
" Sort the loclist again.
" We need a sorted list so we can run a binary search against it
" for efficient lookup of the messages in the cursor handler.
4 0.118136 0.009088 call sort(g:ale_buffer_info[a:buffer].loclist, 'ale#util#LocItemCompare')
4 0.000479 0.000021 if ale#ShouldDoNothing(a:buffer)
return
endif
4 0.218247 0.000040 call ale#engine#SetResults(a:buffer, g:ale_buffer_info[a:buffer].loclist)
FUNCTION incsearch#cli#make()
Called 1 time
Total time: 0.000157
Self time: 0.000103
count total (s) self (s)
1 0.000088 let cli = deepcopy(s:cli)
1 0.000067 0.000013 call incsearch#cli#set(cli, a:config)
1 0.000001 return cli
FUNCTION <SNR>68_GetNextChar()
Called 17 times
Total time: 0.000439
Self time: 0.000127
count total (s) self (s)
17 0.000426 0.000114 return s:GetCharAhead(1)
FUNCTION airline#themes#get_highlight()
Called 78 times
Total time: 0.017131
Self time: 0.000903
count total (s) self (s)
78 0.017064 0.000836 return call('airline#highlighter#get_highlight', [a:group] + a:000)
FUNCTION <SNR>159_InsideCommentOrStringAndShouldStop()
Called 37 times
Total time: 0.058153
Self time: 0.000812
count total (s) self (s)
37 0.057593 0.000252 let retval = s:InsideCommentOrString()
37 0.000094 let inside_comment = retval == 1
37 0.000084 let inside_string = retval == 2
37 0.000126 if inside_comment && g:ycm_complete_in_comments || inside_string && g:ycm_complete_in_strings
return 0
endif
37 0.000050 return retval
FUNCTION <SNR>213_make_uniq_nr()
Called 1 time
Total time: 0.000005
Self time: 0.000005
count total (s) self (s)
1 0.000003 let s:uniq_counter += 1
1 0.000001 return s:uniq_counter
FUNCTION <SNR>204_on_searching()
Called 18 times
Total time: 0.047667
Self time: 0.001507
count total (s) self (s)
18 0.000045 try
18 0.046406 0.000246 return call(a:func, a:000)
catch /E16:/ " E16: Invalid range (with /\_[a- )
catch /E33:/ " E33: No previous substitute regular expression
catch /E53:/ " E53: Unmatched %(
catch /E54:/
catch /E55:/
catch /E62:/ " E62: Nested \= (with /a\=\=)
catch /E63:/ " E63: invalid use of \_
catch /E64:/ " E64: \@ follows nothing
catch /E65:/ " E65: Illegal back reference
catch /E66:/ " E66: \z( not allowed here
catch /E67:/ " E67: \z1 et al. not allowed here
catch /E68:/ " E68: Invalid character after \z (with /\za & re=1)
catch /E69:/ " E69: Missing ] after \%[
catch /E70:/ " E70: Empty \%[]
catch /E71:/ " E71: Invalid character after \%
catch /E554:/
catch /E678:/ " E678: Invalid character after \%[dxouU]
catch /E864:/ " E864: \%#= can only be followed by 0, 1, or 2. The
" automatic engine will be used
catch /E865:/ " E865: (NFA) Regexp end encountered prematurely
catch /E866:/ " E866: (NFA regexp) Misplaced @
catch /E867:/ " E867: (NFA) Unknown operator
catch /E869:/ " E869: (NFA) Unknown operator '\@m
catch /E870:/ " E870: (NFA regexp) Error reading repetition limits
catch /E871:/ " E871: (NFA regexp) Can't have a multi follow a multi !
catch /E874:/ " E874: (NFA) Could not pop the stack ! (with \&)
catch /E877:/ " E877: (NFA regexp) Invalid character class: 109
catch /E888:/ " E888: (NFA regexp) cannot repeat (with /\ze*)
call s:hi.disable_all()
catch
echohl ErrorMsg | echom v:throwpoint . ' ' . v:exception | echohl None
endtry
FUNCTION <SNR>172_sort()
Called 49 times
Total time: 0.032204
Self time: 0.009741
count total (s) self (s)
49 0.000505 if type(a:expr) == type(function('function'))
return sort(a:list, a:expr)
endif
49 0.000186 let s:expr = a:expr
49 0.031136 0.008673 return sort(a:list, 's:_compare')
FUNCTION ale#sign#FindCurrentSigns()
Called 4 times
Total time: 0.023445
Self time: 0.000062
count total (s) self (s)
4 0.000991 0.000027 let l:line_list = ale#sign#ReadSigns(a:buffer)
4 0.022449 0.000030 return ale#sign#ParseSigns(l:line_list)
FUNCTION <SNR>213_numbering()
Called 1 time
Total time: 0.000031
Self time: 0.000026
count total (s) self (s)
1 0.000005 let winnr = get(a:, 1, winnr())
1 0.000004 let tabnr = get(a:, 2, tabpagenr())
1 0.000015 0.000010 let uniq_nr = s:make_uniq_nr()
1 0.000005 call settabwinvar(tabnr, winnr, s:prefix . "_gift_uniq_winnr", uniq_nr)
1 0.000002 return uniq_nr
FUNCTION incsearch#parse_pattern()
Called 20 times
Total time: 0.002120
Self time: 0.002120
count total (s) self (s)
" search_key : '/' or '?'
" expr : {pattern\/pattern}/{offset}
" expr : {pattern}/;/{newpattern} :h //;
" return : [{pattern\/pattern}, {offset}]
20 0.000088 let very_magic = '\v'
20 0.000076 let pattern = '(%(\\.|.){-})'
20 0.000125 let slash = '(\' . a:search_key . '&[^\\"|[:alnum:][:blank:]])'
20 0.000062 let offset = '(.*)'
20 0.000171 let parse_pattern = very_magic . pattern . '%(' . slash . offset . ')?$'
20 0.000986 let result = matchlist(a:expr, parse_pattern)[1:3]
20 0.000192 if type(result) == type(0) || empty(result)
return []
endif
20 0.000094 unlet result[1]
20 0.000064 return result
FUNCTION ale#sign#GetSignName()
Called 484 times
Total time: 0.045842
Self time: 0.045842
count total (s) self (s)
484 0.001253 let l:priority = s:style_warning_priority
" Determine the highest priority item for the line.
1540 0.002199 for l:item in a:sublist
1056 0.001743 if l:item.type is# 'I'
let l:item_priority = s:info_priority
elseif l:item.type is# 'W'
1056 0.002707 if get(l:item, 'sub_type', '') is# 'style'
let l:item_priority = s:style_warning_priority
else
1056 0.002237 let l:item_priority = s:warning_priority
1056 0.000807 endif
1056 0.000723 else
if get(l:item, 'sub_type', '') is# 'style'
let l:item_priority = s:style_error_priority
else
let l:item_priority = s:error_priority
endif
endif
1056 0.002006 if l:item_priority < l:priority
484 0.000920 let l:priority = l:item_priority
484 0.000359 endif
1056 0.000962 endfor
484 0.000961 if l:priority is# s:error_priority
return 'ALEErrorSign'
endif
484 0.000915 if l:priority is# s:warning_priority
484 0.000663 return 'ALEWarningSign'
endif
if l:priority is# s:style_error_priority
return 'ALEStyleErrorSign'
endif
if l:priority is# s:style_warning_priority
return 'ALEStyleWarningSign'
endif
if l:priority is# s:info_priority
return 'ALEInfoSign'
endif
" Use the error sign for invalid severities.
return 'ALEErrorSign'
FUNCTION gitgutter#utility#is_file_buffer()
Called 1 time
Total time: 0.000017
Self time: 0.000017
count total (s) self (s)
1 0.000015 return empty(getbufvar(s:bufnr, '&buftype'))
FUNCTION incsearch#over#modules#insert_register#make()
Called 1 time
Total time: 0.000006
Self time: 0.000006
count total (s) self (s)
1 0.000005 return deepcopy(s:InsertRegister)
FUNCTION ale#list#SetLists()
Called 4 times
Total time: 0.000173
Self time: 0.000108
count total (s) self (s)
4 0.000025 if get(g:, 'ale_set_lists_synchronously') == 1|| getbufvar(a:buffer, 'ale_save_event_fired', 0)
" Update lists immediately if running a test synchronously, or if the
" buffer was saved.
"
" The lists need to be updated immediately when saving a buffer so
" that we can reliably close window automatically, if so configured.
call s:SetListsImpl(-1, a:buffer, a:loclist)
else
4 0.000118 0.000053 call ale#util#StartPartialTimer( 0, function('s:SetListsImpl'), [a:buffer, a:loclist],)
4 0.000004 endif
FUNCTION ShouldMatchWhitespace()
Called 2 times
Total time: 0.000108
Self time: 0.000108
count total (s) self (s)
2 0.000037 for ft in g:extra_whitespace_ignored_filetypes
if ft ==# &filetype | return 0 | endif
endfor
2 0.000009 return 1
FUNCTION incsearch#highlight#update()
Called 10 times
Total time: 0.019132
Self time: 0.000198
count total (s) self (s)
" it's intuiive to call incsearch#highlight#on() & off() but there are no
" need to execute `:nohlsearch` when updating.
10 0.010403 0.000076 call s:hi.disable_all()
10 0.008696 0.000089 call s:hi.enable_all()
FUNCTION <SNR>170_is_input_waiting()
Called 9 times
Total time: 0.000857
Self time: 0.000857
count total (s) self (s)
9 0.000766 let num = len(filter(copy(a:keymapping), 'stridx(v:key, a:input) == 0'))
9 0.000073 return num > 1 || (num == 1 && !has_key(a:keymapping, a:input))
FUNCTION <SNR>176_make()
Called 9 times
Total time: 0.005773
Self time: 0.000153
count total (s) self (s)
9 0.005623 0.000050 let module = s:get(a:name)
9 0.000146 0.000099 return call(module.make, a:000, module)
FUNCTION camelcasemotion#Motion()
Called 444 times
Total time: 0.416248
Self time: 0.056871
count total (s) self (s)
"*******************************************************************************
"* PURPOSE:
" Perform the motion over CamelCaseWords or underscore_notation.
"* ASSUMPTIONS / PRECONDITIONS:
" none
"* EFFECTS / POSTCONDITIONS:
" Move cursor / change selection.
"* INPUTS:
" a:direction one of 'w', 'b', 'e'
" a:count number of "words" to move over
" a:mode one of 'n', 'o', 'v', 'iv' (latter one is a special visual mode
" when inside the inner "word" text objects.
"* RETURN VALUES:
" none
"*******************************************************************************
" Visual mode needs special preparations and postprocessing;
" normal and operator-pending mode breeze through to s:Move().
444 0.003760 if a:mode == 'v'
" Visual mode was left when calling this function. Reselecting the current
" selection returns to visual mode and allows to call search() and issue
" normal mode motions while staying in visual mode.
normal! gv
endif
444 0.002679 if a:mode == 'v' || a:mode == 'iv'
" Note_1a:
if &selection != 'exclusive' && a:direction == 'w'
normal! l
endif
endif
444 0.369258 0.009881 call s:Move(a:direction, a:count, a:mode)
444 0.002901 if a:mode == 'v' || a:mode == 'iv'
" Note: 'selection' setting.
if &selection == 'exclusive' && (a:direction == 'e' || a:direction == 'ge')
" When set to 'exclusive', the "forward to end" motion (',e') does not
" include the last character of the moved-over "word". To include that, an
" additional 'l' motion is appended to the motion; similar to the
" special treatment in operator-pending mode.
normal! l
elseif &selection != 'exclusive' && ( (a:direction != 'e' && a:direction == 'ge') || (a:mode == 'iv' && a:direction == 'w'))
" Note_1b:
" The forward and backward motions move to the beginning of the next "word".
" When 'selection' is set to 'inclusive' or 'old', this is one character too far.
" The appended 'h' motion undoes this. Because of this backward step,
" though, the forward motion finds the current "word" again, and would
" be stuck on the current "word". An 'l' motion before the CamelCase
" motion (see Note_1a) fixes that.
" Note_1c:
" A similar problem applies when selecting a whole inner "word": the
" cursor moves to the beginning of the next "word" which for an
" inclusive selection, at least in operator-pending mode, leads to
" counter-intuitive results. (See github issues #28 and #31.) The
" appended 'h' is needed in that case as well. Possibly for 'v' mode
" too.
normal! h
endif
endif
FUNCTION <SNR>213_uniq_nr()
Called 207 times
Total time: 0.008684
Self time: 0.008653
count total (s) self (s)
207 0.001807 let winnr = get(a:, 1, winnr())
207 0.001556 let tabnr = get(a:, 2, tabpagenr())
207 0.002132 let uniq_nr = get(gettabwinvar(tabnr, winnr, ""), s:prefix . "_gift_uniq_winnr", -1)
207 0.000599 if uniq_nr == -1
1 0.000038 0.000007 let uniq_nr = s:numbering(winnr, tabnr)
1 0.000001 endif
207 0.000561 return uniq_nr
FUNCTION vital#_incsearch#Vim#Buffer#import()
Called 1 time
Total time: 0.000029
Self time: 0.000029
count total (s) self (s)
1 0.000028 return map({'_vital_depends': '', 'read_content': '', 'get_selected_text': '', 'is_cmdwin': '', 'edit_content': '', 'open': '', 'get_last_selected': '', '_vital_loaded': ''}, 'function("s:" . v:key)')
FUNCTION <SNR>198_command()
Called 1 time
Total time: 0.000187
Self time: 0.000145
count total (s) self (s)
" Workaround : Vim 7.3.xxx in Travis and Ubuntu
" https://github.com/osyo-manga/vital-palette/issues/5
" call extend(l:, get(a:, 1, {}))
1 0.000001 if a:0 > 0
call s:extend(l:, a:1)
endif
1 0.000029 0.000009 call s:_verbosefile_push(tempname())
1 0.000001 try
1 0.000003 redir =>result
1 0.000104 silent execute a:cmd
1 0.000002 finally
1 0.000002 redir END
1 0.000001 endtry
1 0.000034 0.000012 call s:_verbosefile_pop()
" let result = substitute(result, "<SRN>", "\<SNR>", "g")
" let result = substitute(result, "<SID>", "\<SID>", "g")
1 0.000002 return result
FUNCTION ale#highlight#UpdateHighlights()
Called 4 times
Total time: 0.038455
Self time: 0.026951
count total (s) self (s)
4 0.000019 let l:item_list = g:ale_enabled ? get(b:, 'ale_highlight_items', []) : []
4 0.007126 0.000022 call ale#highlight#RemoveHighlights()
708 0.000858 for l:item in l:item_list
704 0.001085 if l:item.type is# 'W'
704 0.001636 if get(l:item, 'sub_type', '') is# 'style'
let l:group = 'ALEStyleWarning'
else
704 0.000995 let l:group = 'ALEWarning'
704 0.000459 endif
704 0.000795 elseif l:item.type is# 'I'
let l:group = 'ALEInfo'
elseif get(l:item, 'sub_type', '') is# 'style'
let l:group = 'ALEStyleError'
else
let l:group = 'ALEError'
endif
704 0.001099 let l:line = l:item.lnum
704 0.001014 let l:col = l:item.col
704 0.001883 let l:end_line = get(l:item, 'end_lnum', l:line)
704 0.001870 let l:end_col = get(l:item, 'end_col', l:col)
" Set all of the positions, which are chunked into Lists which
" are as large as will be accepted by matchaddpos.
704 0.012292 0.007892 call map( ale#highlight#CreatePositions(l:line, l:col, l:end_line, l:end_col), 'matchaddpos(l:group, v:val)')
704 0.000656 endfor
FUNCTION <SNR>173__vital_loaded()
Called 1 time
Total time: 0.000086
Self time: 0.000015
count total (s) self (s)
1 0.000002 let s:V = a:V
1 0.000083 0.000012 let s:L = s:V.import("Data.List")
FUNCTION <SNR>169__vital_loaded()
Called 1 time
Total time: 0.007290
Self time: 0.000016
count total (s) self (s)
1 0.000002 let s:V = a:V
1 0.007236 0.000006 let s:Cmdline = s:V.import("Over.Commandline.Base")
1 0.000050 0.000006 let s:Modules = s:V.import("Over.Commandline.Modules")
FUNCTION <SNR>129_get_array()
Called 289 times
Total time: 0.005532
Self time: 0.005532
count total (s) self (s)
289 0.002309 let opts=empty(a:opts) ? '' : join(a:opts, ',')
289 0.002856 return g:airline_gui_mode ==# 'gui' ? [ a:fg, a:bg, '', '', opts ] : [ '', '', a:fg, a:bg, opts ]
FUNCTION <SNR>196__vital_loaded()
Called 1 time
Total time: 0.001383
Self time: 0.000008
count total (s) self (s)
1 0.001383 0.000008 let s:Keymapping = a:V.import("Palette.Keymapping")
FUNCTION <SNR>167__dot_to_sharp()
Called 39 times
Total time: 0.000257
Self time: 0.000257
count total (s) self (s)
39 0.000240 return substitute(a:name, '\.', '#', 'g')
FUNCTION incsearch#over#modules#bracketed_paste#make()
Called 1 time
Total time: 0.000005
Self time: 0.000005
count total (s) self (s)
1 0.000005 return deepcopy(s:bracketed_paste)
FUNCTION <SNR>191__vital_loaded()
Called 1 time
Total time: 0.000515
Self time: 0.000008
count total (s) self (s)
1 0.000002 let s:V = a:V
1 0.000513 0.000006 let s:E = s:V.import("Over.Exception")
FUNCTION airline#parts#filetype()
Called 549 times
Total time: 0.007625
Self time: 0.007625
count total (s) self (s)
549 0.006792 return winwidth(0) < 90 && strlen(&filetype) > 3 ? matchstr(&filetype, '...'). (&encoding is? 'utf-8' ? '…' : '>') : &filetype
FUNCTION airline#extensions#netrw#apply()
Called 2 times
Total time: 0.000089
Self time: 0.000089
count total (s) self (s)
2 0.000030 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 <SNR>175__get_key()
Called 1 time
Total time: 0.000023
Self time: 0.000023
count total (s) self (s)
" call extend(l:, a:conf)
1 0.000005 let self = a:conf
1 0.000014 return get(a:conf, "expr", 0) ? s:_safe_eval(a:conf.key, l:) : a:conf.key
FUNCTION <SNR>167__import()
Called 50 times
Total time: 0.068653
Self time: 0.007859
count total (s) self (s)
50 0.000152 if has_key(s:loaded, a:name)
11 0.000078 return copy(s:loaded[a:name])
endif
39 0.023409 0.000202 let module = self._get_module(a:name)
39 0.000104 if has_key(module, '_vital_created')
1 0.000038 0.000014 call module._vital_created(module)
1 0.000001 endif
39 0.000996 let export_module = filter(copy(module), 'v:key =~# "^\\a"')
" Cache module before calling module.vital_loaded() to avoid cyclic
" dependences but remove the cache if module._vital_loaded() fails.
" let s:loaded[a:name] = export_module
39 0.000123 let s:loaded[a:name] = export_module
39 0.000106 if has_key(module, '_vital_loaded')
19 0.000018 try
19 0.000978 0.000689 call module._vital_loaded(vital#{s:plugin_name}#of())
19 0.000019 catch
unlet s:loaded[a:name]
throw 'vital: fail to call ._vital_loaded(): ' . v:exception
endtry
19 0.000008 endif
39 0.000190 return copy(s:loaded[a:name])
FUNCTION airline#parts#iminsert()
Called 547 times
Total time: 0.009170
Self time: 0.009170
count total (s) self (s)
547 0.003489 if g:airline_detect_iminsert && &iminsert && exists('b:keymap_name')
return toupper(b:keymap_name)
endif
547 0.001281 return ''
FUNCTION <SNR>190_make()
Called 1 time
Total time: 0.000004
Self time: 0.000004
count total (s) self (s)
1 0.000004 return deepcopy(s:module)
FUNCTION <SNR>167__function()
Called 9 times
Total time: 0.000040
Self time: 0.000040
count total (s) self (s)
9 0.000036 return function(a:fstr)
FUNCTION gitgutter#utility#use_known_shell()
Called 1 time
Total time: 0.000084
Self time: 0.000084
count total (s) self (s)
1 0.000008 if has('unix')
1 0.000005 if &shell !=# 'sh'
1 0.000009 let s:shell = &shell
1 0.000008 let s:shellcmdflag = &shellcmdflag
1 0.000006 let s:shellredir = &shellredir
1 0.000018 let &shell = 'sh'
1 0.000010 set shellcmdflag=-c
1 0.000009 set shellredir=>%s\ 2>&1
1 0.000002 endif
1 0.000002 endif
FUNCTION <SNR>164_is_visual()
Called 24 times
Total time: 0.000289
Self time: 0.000289
count total (s) self (s)
24 0.000267 return a:mode =~# "[vV\<C-v>]"
FUNCTION vital#_incsearch#Over#Commandline#Modules#IgnoreRegexpBackwardWord#import()
Called 1 time
Total time: 0.000012
Self time: 0.000012
count total (s) self (s)
1 0.000011 return map({'backward_word': '', 'make': ''}, 'function("s:" . v:key)')
FUNCTION <SNR>197__keymapping()
Called 11 times
Total time: 0.000070
Self time: 0.000070
count total (s) self (s)
11 0.000064 return a:str =~ '^[!nvoicsxl]\s'
FUNCTION <SNR>191_make()
Called 1 time
Total time: 0.000236
Self time: 0.000236
count total (s) self (s)
1 0.000003 if has_key(s:cache_command, a:prefix)
unlet! s:cache_command[a:prefix]
endif
1 0.000008 execute "augroup " a:prefix . "-vital-over-commandline-doautocmd-dummy"
1 0.000209 autocmd!
1 0.000001 augroup END
1 0.000005 let module = deepcopy(s:module)
1 0.000002 let module.prefix = a:prefix
1 0.000001 return module
FUNCTION <SNR>129_Get()
Called 336 times
Total time: 0.005235
Self time: 0.005235
count total (s) self (s)
336 0.002132 let res=get(a:dict, a:key, '')
336 0.000905 if res is ''
149 0.000299 return ''
else
187 0.000695 return a:prefix. res
endif
FUNCTION 120()
Called 9 times
Total time: 0.521836
Self time: 0.000427
count total (s) self (s)
" call self.callevent("on_update")
" if !getchar(1)
" continue
" endif
"
" call self.__input(s:getchar(0))
" call self.draw()
9 0.010136 0.000080 call self.callevent("on_update")
9 0.120276 0.000113 call self.__inputting()
" call self.__input(s:Input.getchar())
9 0.000120 0.000082 if self.is_exit()
1 0.000004 return -1
endif
8 0.391205 0.000053 call self.draw()
FUNCTION incsearch#util#import()
Called 5 times
Total time: 0.000513
Self time: 0.000435
count total (s) self (s)
5 0.000108 0.000030 let prefix = '<SNR>' . s:SID() . '_'
5 0.000010 let module = {}
60 0.000067 for func in s:functions
55 0.000222 let module[func] = function(prefix . func)
55 0.000040 endfor
5 0.000026 return copy(module)
FUNCTION vital#_incsearch#Over#Input#import()
Called 1 time
Total time: 0.000009
Self time: 0.000009
count total (s) self (s)
1 0.000009 return map({'getchar': ''}, 'function("s:" . v:key)')
FUNCTION 70()
Called 383 times
Total time: 0.001806
Self time: 0.001806
count total (s) self (s)
383 0.001461 return self.variables.char
FUNCTION 224()
Called 9 times
Total time: 0.001335
Self time: 0.001020
count total (s) self (s)
9 0.000400 0.000085 if a:cmdline.is_input("\<C-r>")
call a:cmdline.setchar('"')
let self.prefix_key = a:cmdline.input_key()
let self.old_line = a:cmdline.getline()
let self.old_pos = a:cmdline.getpos()
return
elseif exists("self.prefix_key") && a:cmdline.get_tap_key() == self.prefix_key
call a:cmdline.setline(self.old_line)
call a:cmdline.setpos(self.old_pos)
let char = a:cmdline.input_key()
if char =~ '^[0-9a-zA-z.%#:/"\-*+]$'
let register = tr(getreg(char), "\n", "\r")
call a:cmdline.setchar(register)
elseif char == "="
call a:cmdline.setchar(s:input(a:cmdline))
elseif char == "\<C-w>"
call a:cmdline.setchar(s:get_cmdline_cword(a:cmdline.backward_word(), self.cword))
elseif char == "\<C-a>"
call a:cmdline.setchar(self.cWORD)
elseif char == "\<C-f>"
call a:cmdline.setchar(self.cfile)
elseif char == "\<C-r>"
call a:cmdline.setchar('"')
else
call a:cmdline.setchar("")
endif
" elseif a:cmdline.is_input('=', self.prefix_key)
" call a:cmdline.setchar(s:input(a:cmdline))
" elseif a:cmdline.is_input("\<C-w>", self.prefix_key)
" call a:cmdline.setchar(self.cword)
" elseif a:cmdline.is_input("\<C-a>", self.prefix_key)
" call a:cmdline.setchar(self.cWORD)
" elseif a:cmdline.is_input("\<C-f>", self.prefix_key)
" call a:cmdline.setchar(self.cfile)
" elseif a:cmdline.is_input("\<C-r>", self.prefix_key)
" call a:cmdline.setchar('"')
" else
" call a:cmdline.setchar("")
" endif
endif
FUNCTION <SNR>184__as_echon()
Called 27 times
Total time: 0.000246
Self time: 0.000246
count total (s) self (s)
27 0.000228 return "echon " . strtrans(string(a:str))
FUNCTION 268()
Called 9 times
Total time: 0.000091
Self time: 0.000091
count total (s) self (s)
9 0.000080 return char2nr(a:char) == 128 || char2nr(a:char) < 27
FUNCTION <SNR>172__compare()
Called 2399 times
Total time: 0.022463
Self time: 0.022463
count total (s) self (s)
2399 0.020651 return eval(s:expr)
FUNCTION <SNR>142_StopCurrentJobs()
Called 2 times
Total time: 0.000262
Self time: 0.000262
count total (s) self (s)
2 0.000029 let l:info = get(g:ale_buffer_info, a:buffer, {})
2 0.000012 let l:new_job_list = []
2 0.000012 let l:new_active_linter_list = []
2 0.000021 for l:job_id in get(l:info, 'job_list', [])
let l:job_info = get(s:job_info_map, l:job_id, {})
if !empty(l:job_info)
if a:include_lint_file_jobs || !l:job_info.linter.lint_file
call ale#job#Stop(l:job_id)
call remove(s:job_info_map, l:job_id)
else
call add(l:new_job_list, l:job_id)
" Linters with jobs still running are still active.
call add(l:new_active_linter_list, l:job_info.linter.name)
endif
endif
endfor
" Remove duplicates from the active linter list.
2 0.000021 call uniq(sort(l:new_active_linter_list))
" Update the List, so it includes only the jobs we still need.
2 0.000019 let l:info.job_list = l:new_job_list
" Update the active linter list, clearing out anything not running.
2 0.000018 let l:info.active_linter_list = l:new_active_linter_list
FUNCTION ale#history#RememberOutput()
Called 4 times
Total time: 0.000144
Self time: 0.000037
count total (s) self (s)
4 0.000131 0.000024 let l:obj = s:FindHistoryItem(a:buffer, a:job_id)
4 0.000010 let l:obj.output = a:output
FUNCTION 102()
Called 4 times
Total time: 0.000028
Self time: 0.000028
count total (s) self (s)
4 0.000021 return self.variables.exit_code
FUNCTION 103()
Called 1 time
Total time: 0.000486
Self time: 0.000486
count total (s) self (s)
1 0.000010 if exists("self.variables.old_guicursor")
1 0.000217 set guicursor&
1 0.000199 let &guicursor = self.variables.old_guicursor
1 0.000006 unlet self.variables.old_guicursor
1 0.000002 endif
1 0.000009 if exists("self.variables.old_t_ve")
1 0.000031 let &t_ve = self.variables.old_t_ve
1 0.000006 unlet self.variables.old_t_ve
1 0.000003 endif
FUNCTION ale#Var()
Called 1782 times
Total time: 0.128555
Self time: 0.128555
count total (s) self (s)
1782 0.018593 let l:nr = str2nr(a:buffer)
1782 0.013812 let l:full_name = 'ale_' . a:variable_name
1782 0.013021 if bufexists(l:nr)
1782 0.016461 let l:vars = getbufvar(l:nr, '')
1782 0.009719 elseif has_key(g:, 'ale_fix_buffer_data')
let l:vars = get(g:ale_fix_buffer_data, l:nr, {'vars': {}}).vars
else
let l:vars = {}
endif
1782 0.019765 return get(l:vars, l:full_name, g:[l:full_name])
FUNCTION 109()
Called 1 time
Total time: 0.000011
Self time: 0.000011
count total (s) self (s)
1 0.000009 return join(self.variables.input_key_stack, "")
FUNCTION <SNR>164_dictfunction()
Called 9 times
Total time: 0.001364
Self time: 0.000932
count total (s) self (s)
9 0.000103 if has('patch-7.4.1842')
9 0.000068 let funcname = '_' . get(a:dictfunc, 'name')
9 0.000016 else
let funcname = '_' . matchstr(string(a:dictfunc), '\d\+')
endif
9 0.000103 let s:funcmanage[funcname] = { 'func': a:dictfunc, 'dict': a:dict }
9 0.000530 0.000098 let prefix = '<SNR>' . s:SID() . '_'
9 0.000083 let fm = printf("%sfuncmanage()['%s']", prefix, funcname)
9 0.000257 execute join([ printf('function! s:%s(...) abort', funcname), printf(" return call(%s['func'], a:000, %s['dict'])", fm, fm), 'endfunction' ], "\n")
9 0.000096 return function(printf('%s%s', prefix, funcname))
FUNCTION 310()
Called 11 times
Total time: 0.000077
Self time: 0.000077
count total (s) self (s)
11 0.000068 return keys(self.variables.hl_list)
FUNCTION airline#extensions#ale#get_error()
Called 2 times
Total time: 0.000196
Self time: 0.000015
count total (s) self (s)
2 0.000193 0.000012 return airline#extensions#ale#get('error')
FUNCTION <SNR>60_ALELintImpl()
Called 2 times
Total time: 0.075924
Self time: 0.000368
count total (s) self (s)
2 0.000715 0.000045 if ale#ShouldDoNothing(a:buffer)
return
endif
" Use the filetype from the buffer
2 0.001880 0.000075 let l:linters = ale#linter#Get(getbufvar(a:buffer, '&filetype'))
2 0.000012 let l:should_lint_file = 0
" Check if we previously requested checking the file.
2 0.000022 if has_key(s:should_lint_file_for_buffer, a:buffer)
unlet s:should_lint_file_for_buffer[a:buffer]
" Lint files if they exist.
let l:should_lint_file = filereadable(expand('#' . a:buffer . ':p'))
endif
2 0.073203 0.000122 call ale#engine#RunLinters(a:buffer, l:linters, l:should_lint_file)
FUNCTION 314()
Called 31 times
Total time: 0.000909
Self time: 0.000618
count total (s) self (s)
31 0.000573 0.000282 if !self.is_added(a:name)
3 0.000007 return -1
endif
28 0.000161 unlet! self.variables.hl_list[a:name]
FUNCTION 316()
Called 1 time
Total time: 0.000197
Self time: 0.000076
count total (s) self (s)
4 0.000032 0.000022 for name in self.hl_list()
3 0.000144 0.000033 call self.delete(name)
3 0.000006 endfor
FUNCTION <SNR>159_OnFileReadyToParse()
Called 1 time
Total time: 0.006155
Self time: 0.005580
count total (s) self (s)
" Accepts an optional parameter that is either 0 or 1. If 1, send a
" FileReadyToParse event notification, whether the buffer has changed or not;
" effectively forcing a parse of the buffer. Default is 0.
1 0.000008 let force_parsing = a:0 > 0 && a:1
" We only want to send a new FileReadyToParse event notification if the buffer
" has changed since the last time we sent one, or if forced.
1 0.000595 0.000020 if force_parsing || s:Pyeval( "ycm_state.NeedsReparse()" )
1 0.005485 exec s:python_command "ycm_state.OnFileReadyToParse()"
1 0.000019 call timer_stop( s:pollers.file_parse_response.id )
1 0.000030 let s:pollers.file_parse_response.id = timer_start( s:pollers.file_parse_response.wait_milliseconds, function( 's:PollFileParseResponse' ) )
1 0.000003 endif
FUNCTION 318()
Called 56 times
Total time: 0.009060
Self time: 0.001463
count total (s) self (s)
56 0.003872 0.000759 let window = get(a:, 1, s:Gift.uniq_winnr())
56 0.005123 0.000639 return self.get_hl_id(a:name, window) != ""
FUNCTION <SNR>146_VimExitCallback()
Called 4 times
Total time: 0.404615
Self time: 0.000510
count total (s) self (s)
4 0.000057 0.000030 let l:job_id = ale#job#ParseVim8ProcessID(string(a:job))
4 0.000018 let l:info = get(s:job_map, l:job_id, {})
4 0.000008 if empty(l:info)
return
endif
4 0.000011 let l:info.exit_code = a:exit_code
" The program can exit before the data has finished being read.
4 0.000018 if ch_status(job_getchannel(a:job)) is# 'closed'
4 0.000004 try
4 0.000016 if !empty(l:info) && has_key(l:info, 'exit_cb')
4 0.404401 0.000323 call ale#util#GetFunction(l:info.exit_cb)(l:job_id, a:exit_code)
4 0.000003 endif
4 0.000005 finally
" Automatically forget about the job after it's done.
4 0.000017 if has_key(s:job_map, l:job_id)
4 0.000016 call remove(s:job_map, l:job_id)
4 0.000004 endif
4 0.000004 endtry
4 0.000003 endif
FUNCTION airline#extensions#po#apply()
Called 2 times
Total time: 0.000036
Self time: 0.000036
count total (s) self (s)
2 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 <SNR>159_DisableOnLargeFile()
Called 484 times
Total time: 0.006782
Self time: 0.006782
count total (s) self (s)
484 0.003728 if exists( 'b:ycm_largefile' )
484 0.002098 return b:ycm_largefile
endif
let threshold = g:ycm_disable_for_files_larger_than_kb * 1024
let b:ycm_largefile = threshold > 0 && getfsize( expand( a:buffer ) ) > threshold
if b:ycm_largefile
exec s:python_command "vimsupport.PostVimMessage(" . "'YouCompleteMe is disabled in this buffer; " . "the file exceeded the max size (see YCM options).' )"
endif
return b:ycm_largefile
FUNCTION vital#_incsearch#Vim#Guard#import()
Called 1 time
Total time: 0.000019
Self time: 0.000019
count total (s) self (s)
1 0.000018 return map({'_vital_depends': '', '_vital_created': '', 'store': '', '_vital_loaded': ''}, 'function("s:" . v:key)')
FUNCTION <SNR>175_as_key_config()
Called 2 times
Total time: 0.000066
Self time: 0.000066
count total (s) self (s)
2 0.000020 let base = { "noremap" : 0, "lock" : 0, "expr" : 0, }
2 0.000043 return type(a:config) == type({}) ? extend(base, a:config) : extend(base, { "key" : a:config, })
FUNCTION 110()
Called 9 times
Total time: 0.000115
Self time: 0.000115
count total (s) self (s)
9 0.000062 let self.variables.input_key_stack = a:stack
9 0.000038 return self.variables.input_key_stack
FUNCTION 111()
Called 9 times
Total time: 0.000163
Self time: 0.000112
count total (s) self (s)
9 0.000154 0.000103 return remove(self.input_key_stack(), 0)
FUNCTION 113()
Called 1 time
Total time: 0.000078
Self time: 0.000029
count total (s) self (s)
1 0.000002 let self.variables.tap_key = ""
1 0.000002 let self.variables.char = ""
1 0.000002 let self.variables.input = ""
1 0.000001 let self.variables.exit = 0
1 0.000002 let self.variables.exit_code = 1
1 0.000002 let self.variables.enable_keymapping = 1
1 0.000002 let self.variables.input_key_stack = []
1 0.000064 0.000015 let self.line = deepcopy(s:String.make())
FUNCTION 114()
Called 1 time
Total time: 0.000535
Self time: 0.000070
count total (s) self (s)
1 0.000085 0.000007 call self.__init_variables()
1 0.000041 0.000006 call self.hl_cursor_off()
1 0.000005 if !hlexists(self.highlights.cursor)
1 0.000360 0.000008 if s:_is_valid_highlight("Cursor")
execute "highlight link " . self.highlights.cursor . " Cursor"
else
" Workaround by CUI Vim Cursor Highlight
" issues #92
" https://github.com/osyo-manga/vital-over/issues/92
1 0.000009 execute "highlight " . self.highlights.cursor . " term=reverse cterm=reverse gui=reverse"
1 0.000001 endif
1 0.000000 endif
1 0.000004 if !hlexists(self.highlights.cursor_on)
1 0.000007 execute "highlight link " . self.highlights.cursor_on . " " . self.highlights.cursor
1 0.000000 endif
1 0.000004 if !hlexists(self.highlights.cursor_insert)
1 0.000008 execute "highlight " . self.highlights.cursor_insert . " cterm=underline term=underline gui=underline"
1 0.000000 endif
FUNCTION 117()
Called 9 times
Total time: 0.102027
Self time: 0.000610
count total (s) self (s)
9 0.000047 let char = a:char
9 0.000043 let self.variables.input_key = char
9 0.000038 let self.variables.char = char
9 0.000390 0.000086 call self.setchar(self.variables.char)
9 0.000035 let self.variables.is_setted = 0
9 0.044538 0.000104 call self.callevent("on_char_pre")
9 0.000662 0.000120 call self.insert(self.variables.input)
9 0.056239 0.000102 call self.callevent("on_char")
FUNCTION ale#command#FormatCommand()
Called 4 times
Total time: 0.001361
Self time: 0.000818
count total (s) self (s)
4 0.000038 let l:temporary_file = ''
4 0.000026 let l:command = a:command
" First replace all uses of %%, used for literal percent characters,
" with an ugly string.
4 0.000081 let l:command = substitute(l:command, '%%', '<<PERCENTS>>', 'g')
" Replace all %s occurences in the string with the name of the current
" file.
4 0.000036 if l:command =~# '%s'
let l:filename = fnamemodify(bufname(a:buffer), ':p')
let l:command = substitute(l:command, '%s', '\=ale#Escape(l:filename)', 'g')
endif
4 0.000032 if l:command =~# '%t'
" Create a temporary filename, <temp_dir>/<original_basename>
" The file itself will not be created by this function.
2 0.000214 0.000033 let l:temporary_file = s:TemporaryFilename(a:buffer)
2 0.000202 0.000073 let l:command = substitute(l:command, '%t', '\=ale#Escape(l:temporary_file)', 'g')
2 0.000006 endif
" Finish formatting so %% becomes %.
4 0.000083 let l:command = substitute(l:command, '<<PERCENTS>>', '%', 'g')
4 0.000036 if a:pipe_file_if_needed && empty(l:temporary_file)
" If we are to send the Vim buffer to a command, we'll do it
" in the shell. We'll write out the file to a temporary file,
" and then read it back in, in the shell.
2 0.000189 0.000053 let l:temporary_file = s:TemporaryFilename(a:buffer)
2 0.000146 0.000049 let l:command = l:command . ' < ' . ale#Escape(l:temporary_file)
2 0.000005 endif
4 0.000027 return [l:temporary_file, l:command]
FUNCTION <SNR>159_IdentifierFinishedOperations()
Called 37 times
Total time: 0.031912
Self time: 0.026496
count total (s) self (s)
37 0.005641 0.000225 if !s:Pyeval( 'base.CurrentIdentifierFinished()' )
24 0.000042 return
endif
13 0.025795 exec s:python_command "ycm_state.OnCurrentIdentifierFinished()"
13 0.000168 let s:force_semantic = 0
13 0.000155 let s:completion = s:default_completion
FUNCTION <SNR>142_HandleExit()
Called 8 times
Total time: 0.404065
Self time: 0.000756
count total (s) self (s)
8 0.000030 if !has_key(s:job_info_map, a:job_id)
4 0.000005 return
endif
4 0.000013 let l:job_info = s:job_info_map[a:job_id]
4 0.000009 let l:linter = l:job_info.linter
4 0.000008 let l:output = l:job_info.output
4 0.000008 let l:buffer = l:job_info.buffer
4 0.000011 let l:next_chain_index = l:job_info.next_chain_index
4 0.000007 if g:ale_history_enabled
4 0.000224 0.000027 call ale#history#SetExitCode(l:buffer, a:job_id, a:exit_code)
4 0.000002 endif
" Remove this job from the list.
4 0.000278 0.000024 call ale#job#Stop(a:job_id)
4 0.000014 call remove(s:job_info_map, a:job_id)
4 0.000026 call filter(g:ale_buffer_info[l:buffer].job_list, 'v:val isnot# a:job_id')
4 0.000026 call filter(g:ale_buffer_info[l:buffer].active_linter_list, 'v:val isnot# l:linter.name')
" Stop here if we land in the handle for a job completing if we're in
" a sandbox.
4 0.000059 0.000015 if ale#util#InSandbox()
return
endif
4 0.000021 if has('nvim') && !empty(l:output) && empty(l:output[-1])
call remove(l:output, -1)
endif
4 0.000017 if l:next_chain_index < len(get(l:linter, 'command_chain', []))
call s:InvokeChain(l:buffer, l:linter, l:next_chain_index, l:output)
return
endif
" Log the output of the command for ALEInfo if we should.
4 0.000008 if g:ale_history_enabled && g:ale_history_log_output
4 0.000261 0.000117 call ale#history#RememberOutput(l:buffer, a:job_id, l:output[:])
4 0.000003 endif
4 0.024570 0.000059 let l:loclist = ale#util#GetFunction(l:linter.callback)(l:buffer, l:output)
4 0.378385 0.000226 call s:HandleLoclist(l:linter.name, l:buffer, l:loclist)
FUNCTION 320()
Called 10 times
Total time: 0.008607
Self time: 0.000572
count total (s) self (s)
38 0.000236 0.000169 for name in self.hl_list()
28 0.008228 0.000260 call self.enable(name)
28 0.000058 endfor
FUNCTION 321()
Called 28 times
Total time: 0.010361
Self time: 0.001910
count total (s) self (s)
28 0.004966 0.000261 if !self.is_enabled(a:name)
return -1
endif
28 0.000089 let id = -1
28 0.002820 0.000595 silent! let id = matchdelete(self.get_hl_id(a:name))
28 0.000085 if id == -1
return -1
endif
28 0.001889 0.000368 let winnr = get(a:, 1, s:Gift.uniq_winnr())
28 0.000188 unlet! self.variables.id_list[winnr][a:name]
FUNCTION 322()
Called 11 times
Total time: 0.012009
Self time: 0.000641
count total (s) self (s)
39 0.001204 0.000197 for name in self.enable_list()
28 0.010630 0.000269 call self.disable(name)
28 0.000077 endfor
FUNCTION <SNR>154_SetListsImpl()
Called 4 times
Total time: 0.015988
Self time: 0.001575
count total (s) self (s)
4 0.000048 let l:title = expand('#' . a:buffer . ':p')
4 0.000007 if g:ale_set_quickfix
let l:quickfix_list = ale#list#GetCombinedList()
if has('nvim')
call setqflist(s:FixList(l:quickfix_list), ' ', l:title)
else
call setqflist(s:FixList(l:quickfix_list))
call setqflist([], 'r', {'title': l:title})
endif
elseif g:ale_set_loclist
" If windows support is off, bufwinid() may not exist.
" We'll set result in the current window, which might not be correct,
" but is better than nothing.
4 0.000057 0.000028 let l:win_id = s:BufWinId(a:buffer)
4 0.000020 if has('nvim')
call setloclist(l:win_id, s:FixList(a:loclist), ' ', l:title)
else
4 0.015017 0.001105 call setloclist(l:win_id, s:FixList(a:loclist))
4 0.000023 call setloclist(l:win_id, [], 'r', {'title': l:title})
4 0.000004 endif
4 0.000003 endif
" Open a window to show the problems if we need to.
"
" We'll check if the current buffer's List is not empty here, so the
" window will only be opened if the current buffer has problems.
4 0.000204 0.000048 if s:ShouldOpen(a:buffer) && !empty(a:loclist)
let l:winnr = winnr()
let l:mode = mode()
let l:reset_visual_selection = l:mode is? 'v' || l:mode is# "\<c-v>"
let l:reset_character_selection = l:mode is? 's' || l:mode is# "\<c-s>"
if g:ale_set_quickfix
if !ale#list#IsQuickfixOpen()
silent! execute 'copen ' . str2nr(ale#Var(a:buffer, 'list_window_size'))
endif
elseif g:ale_set_loclist
silent! execute 'lopen ' . str2nr(ale#Var(a:buffer, 'list_window_size'))
endif
" If focus changed, restore it (jump to the last window).
if l:winnr isnot# winnr()
wincmd p
endif
if l:reset_visual_selection || l:reset_character_selection
" If we were in a selection mode before, select the last selection.
normal! gv
if l:reset_character_selection
" Switch back to Select mode, if we were in that.
normal! "\<c-g>"
endif
endif
endif
" If ALE isn't currently checking for more problems, close the window if
" needed now. This check happens inside of this timer function, so
" the window can be closed reliably.
4 0.000055 0.000017 if !ale#engine#IsCheckingBuffer(a:buffer)
4 0.000305 0.000027 call s:CloseWindowIfNeeded(a:buffer)
4 0.000001 endif
FUNCTION <SNR>163__execute_search()
Called 11 times
Total time: 0.008112
Self time: 0.008112
count total (s) self (s)
" :nohlsearch
" Please do not highlight at the first place if you set back
" info! I'll handle it myself :h function-search-undo
11 0.008073 execute s:keeppattern 'keepjumps' 'normal!' a:cmd | nohlsearch
FUNCTION <SNR>212_uniq_winnr()
Called 207 times
Total time: 0.011421
Self time: 0.002737
count total (s) self (s)
207 0.011260 0.002576 return call(s:Window.uniq_nr, a:000, s:Window)
FUNCTION <SNR>142_CreateTemporaryFileForJob()
Called 4 times
Total time: 0.034786
Self time: 0.003297
count total (s) self (s)
4 0.000040 if empty(a:temporary_file)
" There is no file, so we didn't create anything.
return 0
endif
4 0.000049 let l:temporary_directory = fnamemodify(a:temporary_file, ':h')
" Create the temporary directory for the file, unreadable by 'other'
" users.
4 0.000120 call mkdir(l:temporary_directory, '', 0750)
" Automatically delete the directory later.
4 0.000207 0.000106 call ale#engine#ManageDirectory(a:buffer, l:temporary_directory)
" Write the buffer out to a file.
4 0.002769 let l:lines = getbufline(a:buffer, 1, '$')
4 0.031490 0.000102 call ale#util#Writefile(a:buffer, l:lines, a:temporary_file)
4 0.000026 return 1
FUNCTION gitgutter#utility#not_git_dir()
Called 1 time
Total time: 0.000094
Self time: 0.000069
count total (s) self (s)
1 0.000093 0.000068 return gitgutter#utility#full_path_to_directory_of_file() !~ '[/\\]\.git\($\|[/\\]\)'
FUNCTION ale#engine#RemoveManagedFiles()
Called 2 times
Total time: 0.000311
Self time: 0.000286
count total (s) self (s)
2 0.000009 let l:info = get(g:ale_buffer_info, a:buffer, {})
" We can't delete anything in a sandbox, so wait until we escape from
" it to delete temporary files and directories.
2 0.000031 0.000006 if ale#util#InSandbox()
return
endif
" Delete files with a call akin to a plan `rm` command.
2 0.000006 if has_key(l:info, 'temporary_file_list')
2 0.000005 for l:filename in l:info.temporary_file_list
call delete(l:filename)
endfor
2 0.000005 let l:info.temporary_file_list = []
2 0.000001 endif
" Delete directories like `rm -rf`.
" Directories are handled differently from files, so paths that are
" intended to be single files can be set up for automatic deletion without
" accidentally deleting entire directories.
2 0.000005 if has_key(l:info, 'temporary_directory_list')
6 0.000011 for l:directory in l:info.temporary_directory_list
4 0.000187 call delete(l:directory, 'rf')
4 0.000006 endfor
2 0.000005 let l:info.temporary_directory_list = []
2 0.000002 endif
FUNCTION 168()
Called 1 time
Total time: 0.000004
Self time: 0.000004
count total (s) self (s)
1 0.000003 if empty(a:slot)
1 0.000001 return -1
endif
for i in range(len(self.variables.slots))
if self.variables.slots[i].id == a:slot.id
unlet self.variables.slots[i]
return
endif
endfor
return -1
FUNCTION <SNR>142_RunLinter()
Called 6 times
Total time: 0.068165
Self time: 0.000855
count total (s) self (s)
6 0.000050 if !empty(a:linter.lsp)
return s:CheckWithLSP(a:buffer, a:linter)
else
6 0.000766 0.000164 let l:executable = ale#linter#GetExecutable(a:buffer, a:linter)
6 0.000735 0.000149 if ale#engine#IsExecutable(a:buffer, l:executable)
4 0.066462 0.000340 return s:InvokeChain(a:buffer, a:linter, 0, [])
endif
2 0.000005 endif
2 0.000007 return 0
FUNCTION <SNR>178_capture()
Called 1 time
Total time: 0.000019
Self time: 0.000019
count total (s) self (s)
1 0.000001 try
1 0.000003 redir => out
1 0.000009 silent execute a:command
1 0.000001 finally
1 0.000002 redir END
1 0.000001 endtry
1 0.000001 return out
FUNCTION 122()
Called 1 time
Total time: 0.000502
Self time: 0.000016
count total (s) self (s)
1 0.000501 0.000015 call self.hl_cursor_on()
FUNCTION ale#history#SetExitCode()
Called 4 times
Total time: 0.000197
Self time: 0.000057
count total (s) self (s)
4 0.000173 0.000033 let l:obj = s:FindHistoryItem(a:buffer, a:job_id)
" If we find a match, then set the code and status.
4 0.000009 let l:obj.exit_code = a:exit_code
4 0.000008 let l:obj.status = 'finished'
FUNCTION 125()
Called 9 times
Total time: 0.007468
Self time: 0.004783
count total (s) self (s)
9 0.000047 let result = {}
" for module in values(self.variables.modules)
216 0.003051 0.000613 for module in self.variables.modules.slots()
207 0.001017 if has_key(module, "keymapping")
18 0.000063 if module isnot self
9 0.000245 0.000193 call extend(result, module.keymapping(self))
9 0.000017 endif
18 0.000028 endif
207 0.000305 endfor
9 0.000372 0.000177 return extend(extend(result, self.variables.keymapping), self.keymapping())
FUNCTION <SNR>153_UpdateLineNumbers()
Called 4 times
Total time: 0.016874
Self time: 0.016874
count total (s) self (s)
4 0.000010 let l:line_map = {}
4 0.000008 let l:line_numbers_changed = 0
488 0.000814 for [l:line, l:sign_id, l:name] in a:current_sign_list
484 0.001418 let l:line_map[l:sign_id] = l:line
484 0.000362 endfor
1060 0.001132 for l:item in a:loclist
1056 0.001620 if l:item.bufnr == a:buffer
1056 0.004302 let l:lnum = get(l:line_map, get(l:item, 'sign_id', 0), 0)
1056 0.001874 if l:lnum && l:item.lnum != l:lnum
let l:item.lnum = l:lnum
let l:line_numbers_changed = 1
endif
1056 0.000643 endif
1056 0.000696 endfor
" When the line numbers change, sort the list again
4 0.000006 if l:line_numbers_changed
call sort(a:loclist, 'ale#util#LocItemCompare')
endif
FUNCTION <SNR>156_StopCursorTimer()
Called 447 times
Total time: 0.009886
Self time: 0.009886
count total (s) self (s)
447 0.002247 if s:cursor_timer != -1
446 0.003302 call timer_stop(s:cursor_timer)
446 0.002221 let s:cursor_timer = -1
446 0.000970 endif
FUNCTION ale#util#Writefile()
Called 4 times
Total time: 0.031388
Self time: 0.031388
count total (s) self (s)
4 0.000086 let l:corrected_lines = getbufvar(a:buffer, '&fileformat') is# 'dos' ? map(copy(a:lines), 'v:val . "\r"') : a:lines
4 0.031284 call writefile(l:corrected_lines, a:filename) " no-custom-checks
FUNCTION <SNR>176_get()
Called 16 times
Total time: 0.012138
Self time: 0.000266
count total (s) self (s)
16 0.000054 if exists("s:" . a:name)
return s:{a:name}
endif
16 0.011994 0.000122 let s:{a:name} = s:V.import('Over.Commandline.Modules.' . a:name)
16 0.000045 return s:{a:name}
FUNCTION ale#sign#GetSignCommands()
Called 4 times
Total time: 0.015251
Self time: 0.015251
count total (s) self (s)
4 0.000008 let l:command_list = []
4 0.000009 let l:is_dummy_sign_set = a:was_sign_set
" Set the dummy sign if we need to.
" The dummy sign is needed to keep the sign column open while we add
" and remove signs.
4 0.000016 if !l:is_dummy_sign_set && (!empty(a:sign_map) || g:ale_sign_column_always)
4 0.000026 call add(l:command_list, 'sign place ' . g:ale_sign_offset . ' line=1 name=ALEDummySign buffer=' . a:buffer)
4 0.000008 let l:is_dummy_sign_set = 1
4 0.000002 endif
" Place new items first.
488 0.001012 for [l:line_str, l:info] in items(a:sign_map)
484 0.000585 if l:info.new_id
" Save the sign IDs we are setting back on our loclist objects.
" These IDs will be used to preserve items which are set many times.
1540 0.001806 for l:item in l:info.items
1056 0.001956 let l:item.sign_id = l:info.new_id
1056 0.000818 endfor
484 0.000778 if l:info.new_id isnot l:info.current_id
call add(l:command_list, 'sign place ' . (l:info.new_id) . ' line=' . l:line_str . ' name=' . (l:info.new_name) . ' buffer=' . a:buffer)
endif
484 0.000337 endif
484 0.000318 endfor
" Remove signs without new IDs.
488 0.000523 for l:info in values(a:sign_map)
484 0.000893 if l:info.current_id && l:info.current_id isnot l:info.new_id
call add(l:command_list, 'sign unplace ' . (l:info.current_id) . ' buffer=' . a:buffer)
endif
484 0.000307 endfor
" Remove the dummy sign to close the sign column if we need to.
4 0.000009 if l:is_dummy_sign_set && !g:ale_sign_column_always
4 0.000024 call add(l:command_list, 'sign unplace ' . g:ale_sign_offset . ' buffer=' . a:buffer)
4 0.000004 endif
4 0.000006 return l:command_list
FUNCTION <SNR>135_CreateCountDict()
Called 4 times
Total time: 0.000029
Self time: 0.000029
count total (s) self (s)
" Keys 0 and 1 are for backwards compatibility.
" The count object used to be a List of [error_count, warning_count].
4 0.000021 return { '0': 0, '1': 0, 'error': 0, 'warning': 0, 'info': 0, 'style_error': 0, 'style_warning': 0, 'total': 0,}
FUNCTION ale#cursor#EchoCursorWarning()
Called 426 times
Total time: 0.715933
Self time: 0.017642
count total (s) self (s)
426 0.714604 0.016313 return ale#CallWithCooldown('dont_echo_until', function('s:EchoImpl'), [])
FUNCTION airline#highlighter#get_highlight()
Called 289 times
Total time: 0.072806
Self time: 0.030927
count total (s) self (s)
289 0.002416 if get(g:, 'airline_highlighting_cache', 0) && has_key(s:hl_groups, a:group)
return s:hl_groups[a:group]
else
289 0.021572 0.003016 let fg = s:get_syn(a:group, 'fg')
289 0.020651 0.002860 let bg = s:get_syn(a:group, 'bg')
289 0.007177 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')
289 0.002881 let bold = synIDattr(synIDtrans(hlID(a:group)), 'bold')
289 0.000983 let opts = a:000
289 0.000675 if bold
42 0.000142 let opts = ['bold']
42 0.000068 endif
289 0.009530 0.003998 let res = reverse ? s:get_array(bg, fg, opts) : s:get_array(fg, bg, opts)
289 0.000513 endif
289 0.001785 let s:hl_groups[a:group] = res
289 0.000739 return res
FUNCTION <SNR>210__vital_created()
Called 1 time
Total time: 0.000024
Self time: 0.000024
count total (s) self (s)
" define constant variables
1 0.000003 if !exists('s:const')
1 0.000002 let s:const = {}
1 0.000004 let s:const.is_local_variable_supported = v:version > 703 || (v:version == 703 && has('patch560'))
" NOTE:
" The third argument is available from 7.4.242 but it had bug and that
" bug was fixed from 7.4.513
1 0.000006 let s:const.is_third_argument_of_getreg_supported = has('patch-7.4.513')
1 0.000002 lockvar s:const
1 0.000001 endif
1 0.000004 call extend(a:module, s:const)
FUNCTION <SNR>163_search()
Called 1 time
Total time: 0.006227
Self time: 0.000249
count total (s) self (s)
1 0.000953 0.000227 call incsearch#autocmd#auto_nohlsearch(1) " NOTE: `.` repeat doesn't handle this
1 0.005272 0.000020 return a:cli._generate_command(a:input)
FUNCTION <SNR>154_ShouldOpen()
Called 8 times
Total time: 0.000300
Self time: 0.000102
count total (s) self (s)
8 0.000236 0.000038 let l:val = ale#Var(a:buffer, 'open_list')
8 0.000030 let l:saved = getbufvar(a:buffer, 'ale_save_event_fired', 0)
8 0.000020 return l:val is 1 || (l:val is# 'on_save' && l:saved)
FUNCTION ale#sign#ReadSigns()
Called 4 times
Total time: 0.000964
Self time: 0.000964
count total (s) self (s)
4 0.000018 redir => l:output
4 0.000700 silent execute 'sign place buffer=' . a:buffer
4 0.000018 redir end
4 0.000218 return split(l:output, "\n")
FUNCTION <SNR>213__vital_loaded()
Called 1 time
Total time: 0.000581
Self time: 0.000010
count total (s) self (s)
1 0.000002 let s:V = a:V
1 0.000578 0.000007 let s:Tabpage = s:V.import("Gift.Tabpage")
FUNCTION 285()
Called 1 time
Total time: 0.000016
Self time: 0.000016
count total (s) self (s)
1 0.000003 if !exists('&t_BE')
return
endif
1 0.000002 let self.t_BE = &t_BE
1 0.000009 set t_BE=
FUNCTION <SNR>177_parse_to_name()
Called 1 time
Total time: 0.000010
Self time: 0.000010
count total (s) self (s)
1 0.000010 return matchstr(a:highlight, '^\zs\w\+\ze')
FUNCTION xolox#misc#cursorhold#autocmd()
Called 1 time
Total time: 0.000097
Self time: 0.000097
count total (s) self (s)
" The 'top level event handler' that's called by Vim whenever the
" [CursorHold][] or [CursorHoldI][] event fires. It iterates through the
" event handlers registered using `xolox#misc#cursorhold#register()` and
" calls each event handler at the appropriate interval, keeping track of
" the time when each event handler was last run.
1 0.000009 for handler in g:xolox#misc#cursorhold#handlers
let function = handler['function']
let last_run = get(handler, 'last_run', 0)
let interval = get(handler, 'interval', 4)
call xolox#misc#msg#debug("vim-misc %s: Checking handler %s with interval %i and last run %i ..", g:xolox#misc#version, function, interval, last_run)
" Rate limit in case &updatetime is set (very) low.
let time_until_next_run = (last_run + interval) - localtime()
if time_until_next_run > 0
call xolox#misc#msg#debug("vim-misc %s: Rate limiting handler %s (time until next run: %i seconds).", g:xolox#misc#version, function, time_until_next_run)
else
call xolox#misc#msg#debug("vim-misc %s: Running handler %s ..", g:xolox#misc#version, function)
call call(function, get(handler, 'arguments', []))
let handler['last_run'] = localtime()
endif
endfor
FUNCTION incsearch#go()
Called 1 time
Total time: 0.000538
Self time: 0.000098
count total (s) self (s)
1 0.000509 0.000075 let config = incsearch#config#make(get(a:, 1, {}))
" FIXME?: this condition should not be config.is_expr?
1 0.000002 if config.is_expr
return incsearch#_go(config)
else
1 0.000002 let g:incsearch#_go_config = config
1 0.000016 0.000010 let esc = s:U.is_visual(g:incsearch#_go_config.mode) ? "\<ESC>" : ''
1 0.000005 return printf("%s:\<C-u>call incsearch#_go(g:incsearch#_go_config)\<CR>", esc)
endif
FUNCTION vital#_incsearch#Over#Commandline#Modules#ExceptionExit#import()
Called 1 time
Total time: 0.000009
Self time: 0.000009
count total (s) self (s)
1 0.000009 return map({'make': ''}, 'function("s:" . v:key)')
FUNCTION vital#_incsearch#Data#Dict#import()
Called 1 time
Total time: 0.000041
Self time: 0.000041
count total (s) self (s)
1 0.000039 return map({'pick': '', 'clear': '', 'max_by': '', 'foldl': '', 'swap': '', 'omit': '', 'min_by': '', 'foldr': '', 'make_index': '', 'make': ''}, 'function("s:" . v:key)')
FUNCTION <SNR>156_FindItemAtCursor()
Called 426 times
Total time: 0.311725
Self time: 0.034669
count total (s) self (s)
426 0.003414 let l:buf = bufnr('')
426 0.005249 let l:info = get(g:ale_buffer_info, l:buf, {})
426 0.003974 let l:loclist = get(l:info, 'loclist', [])
426 0.003288 let l:pos = getcurpos()
426 0.286453 0.009397 let l:index = ale#util#BinarySearch(l:loclist, l:buf, l:pos[1], l:pos[2])
426 0.004401 let l:loc = l:index >= 0 ? l:loclist[l:index] : {}
426 0.002588 return [l:info, l:loc]
FUNCTION 142()
Called 11 times
Total time: 0.000705
Self time: 0.000261
count total (s) self (s)
11 0.000694 0.000250 return type(a:item) == type("") ? self.set_str(a:item) : type(a:item) == type(0) ? self.set_pos(a:item) : self
FUNCTION 143()
Called 40 times
Total time: 0.000389
Self time: 0.000389
count total (s) self (s)
40 0.000340 return join(self.list, "")
FUNCTION ale#sign#SetSigns()
Called 4 times
Total time: 0.155864
Self time: 0.013702
count total (s) self (s)
4 0.000017 if !bufexists(str2nr(a:buffer))
" Stop immediately when attempting to set signs for a buffer which
" does not exist.
return
endif
" Find the current markers
4 0.023520 0.000075 let [l:is_dummy_sign_set, l:current_sign_list] = ale#sign#FindCurrentSigns(a:buffer)
" Update the line numbers for items from before which may have moved.
4 0.016947 0.000073 call s:UpdateLineNumbers(a:buffer, l:current_sign_list, a:loclist)
" Group items after updating the line numbers.
4 0.017837 0.000046 let l:grouped_items = s:GroupLoclistItems(a:buffer, a:loclist)
" Build a map of current and new signs, with the lines as the keys.
4 0.068846 0.000045 let l:sign_map = s:BuildSignMap(l:current_sign_list, l:grouped_items)
4 0.015299 0.000048 let l:command_list = ale#sign#GetSignCommands( a:buffer, l:is_dummy_sign_set, l:sign_map,)
" Change the sign column color if the option is on.
4 0.000010 if g:ale_change_sign_column_color && !empty(a:loclist)
highlight clear SignColumn
highlight link SignColumn ALESignColumnWithErrors
endif
12 0.000023 for l:command in l:command_list
8 0.013265 silent! execute l:command
8 0.000008 endfor
" Reset the sign column color when there are no more errors.
4 0.000012 if g:ale_change_sign_column_color && empty(a:loclist)
highlight clear SignColumn
highlight link SignColumn ALESignColumnWithoutErrors
endif
FUNCTION 145()
Called 9 times
Total time: 0.000136
Self time: 0.000136
count total (s) self (s)
9 0.000122 return self.col > 0 ? join(self.list[ : self.col-1], '') : ""
FUNCTION 147()
Called 18 times
Total time: 0.000123
Self time: 0.000123
count total (s) self (s)
18 0.000108 return get(self.list, self.col, "")
FUNCTION 148()
Called 10 times
Total time: 0.000390
Self time: 0.000390
count total (s) self (s)
10 0.000274 let self.list = split(a:str, '\zs')
10 0.000069 let self.col = strchars(a:str)
10 0.000030 return self
FUNCTION 149()
Called 9 times
Total time: 0.000049
Self time: 0.000049
count total (s) self (s)
9 0.000033 return self.col
FUNCTION <SNR>68_GetCharAhead()
Called 17 times
Total time: 0.000312
Self time: 0.000312
count total (s) self (s)
17 0.000102 if col('$') == col('.')
return "\0"
endif
17 0.000140 return strpart(getline('.'), col('.')-2 + a:len, 1)
FUNCTION <SNR>171_make()
Called 1 time
Total time: 0.000049
Self time: 0.000021
count total (s) self (s)
1 0.000005 let default = get(a:, 1, "")
1 0.000007 let result = deepcopy(s:base)
1 0.000036 0.000008 call result.set(default)
1 0.000001 return result
FUNCTION ale#job#Stop()
Called 4 times
Total time: 0.000254
Self time: 0.000167
count total (s) self (s)
4 0.000015 if !has_key(s:job_map, a:job_id)
return
endif
4 0.000019 if has('nvim')
" FIXME: NeoVim kills jobs on a timer, but will not kill any processes
" which are child processes on Unix. Some work needs to be done to
" kill child processes to stop long-running processes like pylint.
call jobstop(a:job_id)
else
4 0.000014 let l:job = s:job_map[a:job_id].job
" We must close the channel for reading the buffer if it is open
" when stopping a job. Otherwise, we will get errors in the status line.
4 0.000015 if ch_status(job_getchannel(l:job)) is# 'open'
call ch_close_in(job_getchannel(l:job))
endif
" Ask nicely for the job to stop.
4 0.000015 call job_stop(l:job)
4 0.000110 0.000023 if ale#job#IsRunning(l:job)
" Set a 100ms delay for killing the job with SIGKILL.
let s:job_kill_timers[timer_start(100, function('s:KillHandler'))] = l:job
endif
4 0.000002 endif
FUNCTION ale#engine#InitBufferInfo()
Called 2 times
Total time: 0.000078
Self time: 0.000078
count total (s) self (s)
2 0.000022 if !has_key(g:ale_buffer_info, a:buffer)
" job_list will hold the list of job IDs
" active_linter_list will hold the list of active linter names
" loclist holds the loclist items after all jobs have completed.
" temporary_file_list holds temporary files to be cleaned up
" temporary_directory_list holds temporary directories to be cleaned up
let g:ale_buffer_info[a:buffer] = { 'job_list': [], 'active_linter_list': [], 'loclist': [], 'temporary_file_list': [], 'temporary_directory_list': [],}
return 1
endif
2 0.000006 return 0
FUNCTION airline#extensions#ale#get()
Called 550 times
Total time: 0.101097
Self time: 0.058630
count total (s) self (s)
550 0.005257 if !exists(':ALELint')
return ''
endif
550 0.003002 let is_err = a:type ==# 'error'
550 0.003456 let symbol = is_err ? s:error_symbol : s:warning_symbol
550 0.002508 let is_err = a:type ==# 'error'
550 0.045345 0.007575 let counts = ale#statusline#Count(bufnr(''))
550 0.003524 let symbol = is_err ? s:error_symbol : s:warning_symbol
550 0.006048 if type(counts) == type({}) && has_key(counts, 'error')
" Use the current Dictionary format.
550 0.003916 let errors = counts.error + counts.style_error
550 0.003997 let num = is_err ? errors : counts.total - errors
550 0.001090 else
" Use the old List format.
let num = is_err ? counts[0] : counts[1]
endif
550 0.011148 0.006451 return s:airline_ale_count(num, symbol)
FUNCTION 68()
Called 40 times
Total time: 0.000776
Self time: 0.000387
count total (s) self (s)
40 0.000728 0.000339 return self.line.str()
FUNCTION vital#_incsearch#Over#Commandline#Modules#Delete#import()
Called 1 time
Total time: 0.000009
Self time: 0.000009
count total (s) self (s)
1 0.000009 return map({'make': ''}, 'function("s:" . v:key)')
FUNCTION <SNR>189_make()
Called 1 time
Total time: 0.000005
Self time: 0.000005
count total (s) self (s)
1 0.000004 return deepcopy(s:module)
FUNCTION <SNR>181_make()
Called 1 time
Total time: 0.000004
Self time: 0.000004
count total (s) self (s)
1 0.000004 return deepcopy(s:module)
FUNCTION 150()
Called 9 times
Total time: 0.000360
Self time: 0.000360
count total (s) self (s)
9 0.000188 call extend(self.list, split(a:str, '\zs'), self.col)
9 0.000134 let self.col += len(split(a:str, '\zs'))
9 0.000026 return self
FUNCTION 151()
Called 12 times
Total time: 0.000094
Self time: 0.000094
count total (s) self (s)
12 0.000078 return len(self.list)
FUNCTION 154()
Called 1 time
Total time: 0.000147
Self time: 0.000058
count total (s) self (s)
1 0.000024 0.000014 if a:index < 0 || self.length() <= a:index
return ""
endif
1 0.000009 let result = self.list[a:index]
1 0.000008 unlet self.list[a:index]
1 0.000005 if a:index < self.col
1 0.000090 0.000011 call self.set(self.col - 1)
1 0.000001 endif
1 0.000001 return result
FUNCTION 156()
Called 1 time
Total time: 0.000165
Self time: 0.000018
count total (s) self (s)
1 0.000164 0.000017 return self.remove(self.col - 1)
FUNCTION ale#statusline#Count()
Called 550 times
Total time: 0.037770
Self time: 0.010086
count total (s) self (s)
" The Dictionary is copied here before exposing it to other plugins.
550 0.036433 0.008749 return copy(s:GetCounts(a:buffer))
FUNCTION <SNR>167__runtime()
Called 39 times
Total time: 0.018912
Self time: 0.003089
count total (s) self (s)
39 0.018892 0.003069 execute 'runtime' fnameescape(a:path)
FUNCTION airline#extensions#default#apply()
Called 2 times
Total time: 0.002788
Self time: 0.000171
count total (s) self (s)
2 0.000008 let winnr = a:context.winnr
2 0.000005 let active = a:context.active
2 0.000030 0.000017 if airline#util#getwinvar(winnr, 'airline_render_left', active || (!active && !g:airline_inactive_collapse))
2 0.000898 0.000030 call s:build_sections(a:builder, a:context, s:layout[0])
2 0.000002 else
let text = s:get_section(winnr, 'c')
if empty(text)
let text = ' %f%m '
endif
call a:builder.add_section('airline_c'.(a:context.bufnr), text)
endif
2 0.000162 0.000029 call a:builder.split(s:get_section(winnr, 'gutter', '', ''))
2 0.000025 0.000014 if airline#util#getwinvar(winnr, 'airline_render_right', 1)
2 0.001612 0.000020 call s:build_sections(a:builder, a:context, s:layout[1])
2 0.000003 endif
2 0.000003 return 1
FUNCTION 82()
Called 18 times
Total time: 0.000080
Self time: 0.000080
count total (s) self (s)
18 0.000059 return self.variables.suffix
FUNCTION ale#FileTooLarge()
Called 879 times
Total time: 0.087062
Self time: 0.025870
count total (s) self (s)
879 0.076201 0.015009 let l:max = ale#Var(bufnr(''), 'maximum_file_size')
879 0.008410 return l:max > 0 ? (line2byte(line('$') + 1) > l:max) : 0
FUNCTION <SNR>182__vital_loaded()
Called 1 time
Total time: 0.000048
Self time: 0.000007
count total (s) self (s)
1 0.000048 0.000007 let s:Input = a:V.import("Over.Input")
FUNCTION ale#Has()
Called 4 times
Total time: 0.000089
Self time: 0.000089
count total (s) self (s)
4 0.000083 return get(g:ale_has_override, a:feature, has(a:feature))
FUNCTION vital#_incsearch#Over#Commandline#Modules#Digraphs#import()
Called 1 time
Total time: 0.000020
Self time: 0.000020
count total (s) self (s)
1 0.000020 return map({'capture': '', '_vital_depends': '', 'digraph': '', 'make': '', '_vital_loaded': ''}, 'function("s:" . v:key)')
FUNCTION ale#engine#ManageDirectory()
Called 4 times
Total time: 0.000101
Self time: 0.000101
count total (s) self (s)
4 0.000081 call add(g:ale_buffer_info[a:buffer].temporary_directory_list, a:directory)
FUNCTION incsearch#cli()
Called 1 time
Total time: 0.000049
Self time: 0.000013
count total (s) self (s)
1 0.000048 0.000012 return incsearch#cli#get()
FUNCTION <SNR>172_sort_by()
Called 49 times
Total time: 0.043933
Self time: 0.011101
count total (s) self (s)
49 0.009224 0.008596 let pairs = map(a:list, printf('[v:val, %s]', a:expr))
49 0.034629 0.002425 return map(s:sort(pairs, 'a:a[1] ==# a:b[1] ? 0 : a:a[1] ># a:b[1] ? 1 : -1'), 'v:val[0]')
FUNCTION 71()
Called 13 times
Total time: 0.000393
Self time: 0.000393
count total (s) self (s)
" 1 の場合は既に設定されていても上書きする
" 0 の場合は既に設定されていれば上書きしない
13 0.000138 let overwrite = get(a:, 1, 1)
13 0.000064 if overwrite || self.variables.is_setted == 0
11 0.000058 let self.variables.input = a:char
11 0.000041 let self.variables.is_setted = 1
11 0.000018 endif
FUNCTION 72()
Called 9 times
Total time: 0.000138
Self time: 0.000089
count total (s) self (s)
9 0.000127 0.000078 return self.line.pos()
FUNCTION 73()
Called 9 times
Total time: 0.000526
Self time: 0.000115
count total (s) self (s)
9 0.000513 0.000102 return self.line.set_pos(a:pos)
FUNCTION 75()
Called 9 times
Total time: 0.000124
Self time: 0.000124
count total (s) self (s)
9 0.000045 if self.variables.tap_key == a:key
let self.variables.tap_key = ""
return 1
endif
FUNCTION 76()
Called 419 times
Total time: 0.002034
Self time: 0.002034
count total (s) self (s)
419 0.001650 return self.variables.tap_key
FUNCTION 77()
Called 410 times
Total time: 0.013413
Self time: 0.009662
count total (s) self (s)
410 0.003206 let prekey = get(a:, 1, "")
410 0.009625 0.005874 return self.get_tap_key() ==# prekey && self.char() ==# a:key
" \ && self.char() == (prekey . a:key)
FUNCTION 79()
Called 2 times
Total time: 0.000006
Self time: 0.000006
count total (s) self (s)
2 0.000005 let self.variables.prompt = a:prompt
FUNCTION <SNR>185_make()
Called 1 time
Total time: 0.000012
Self time: 0.000012
count total (s) self (s)
1 0.000005 let result = deepcopy(s:module)
1 0.000005 let result.exit_code = get(a:, 1, 0)
1 0.000001 return result
FUNCTION <SNR>163_get_input()
Called 1 time
Total time: 0.576751
Self time: 0.000041
count total (s) self (s)
" Handle visual mode highlight
1 0.000013 0.000006 if s:U.is_visual(a:cli._mode)
let visual_hl = incsearch#highlight#get_visual_hlobj()
try
call incsearch#highlight#turn_off(visual_hl)
call incsearch#highlight#emulate_visual_highlight(a:cli._mode, visual_hl)
let input = a:cli.get(a:cli._pattern)
finally
call incsearch#highlight#turn_on(visual_hl)
endtry
else
1 0.576714 0.000011 let input = a:cli.get(a:cli._pattern)
1 0.000002 endif
1 0.000003 return input
FUNCTION <SNR>210__vital_loaded()
Called 1 time
Total time: 0.000843
Self time: 0.000034
count total (s) self (s)
1 0.000002 let s:V = a:V
1 0.000073 0.000011 let s:Prelude = s:V.import('Prelude')
1 0.000088 0.000013 let s:List = s:V.import('Data.List')
1 0.000680 0.000008 let s:Dict = s:V.import('Data.Dict')
FUNCTION <SNR>179_make()
Called 1 time
Total time: 0.000005
Self time: 0.000005
count total (s) self (s)
1 0.000004 return deepcopy(s:module)
FUNCTION <SNR>159_OnTextChangedInsertMode()
Called 37 times
Total time: 0.323735
Self time: 0.033700
count total (s) self (s)
37 0.002797 0.000204 if !s:AllowedToCompleteInCurrentBuffer()
return
endif
37 0.000071 if s:completion_stopped
let s:completion_stopped = 0
let s:completion = s:default_completion
return
endif
37 0.032163 0.000251 call s:IdentifierFinishedOperations()
" We have to make sure we correctly leave semantic mode even when the user
" inserts something like a "operator[]" candidate string which fails
" CurrentIdentifierFinished check.
37 0.000174 if s:force_semantic && !s:Pyeval( 'base.LastEnteredCharIsIdentifierChar()' )
let s:force_semantic = 0
endif
37 0.096197 0.000633 if &completefunc == "youcompleteme#CompleteFunc" && ( g:ycm_auto_trigger || s:force_semantic ) && !s:InsideCommentOrStringAndShouldStop() && !s:OnBlankLine()
" Immediately call previous completion to avoid flickers.
37 0.001111 0.000287 call s:Complete()
37 0.159358 0.000216 call s:InvokeCompletion()
37 0.000049 endif
37 0.030625 exec s:python_command "ycm_state.OnCursorMoved()"
37 0.000152 if g:ycm_autoclose_preview_window_after_completion
call s:ClosePreviewWindowIfNeeded()
endif
FUNCTION ale#engine#IsCheckingBuffer()
Called 10 times
Total time: 0.000133
Self time: 0.000133
count total (s) self (s)
10 0.000063 let l:info = get(g:ale_buffer_info, a:buffer, {})
10 0.000054 return !empty(get(l:info, 'active_linter_list', []))
FUNCTION ale#job#ValidateArguments()
Called 4 times
Total time: 0.000070
Self time: 0.000070
count total (s) self (s)
4 0.000031 if a:options.mode isnot# 'nl' && a:options.mode isnot# 'raw'
throw 'Invalid mode: ' . a:options.mode
endif
FUNCTION <SNR>193_make()
Called 1 time
Total time: 0.000015
Self time: 0.000015
count total (s) self (s)
1 0.000004 let result = deepcopy(s:module)
1 0.000005 let result.prefix = get(a:, 1, "vital-over(".s:vname.") Exception")
1 0.000004 let result.command = get(a:, 2, "echom")
1 0.000001 return result
FUNCTION 167()
Called 23 times
Total time: 0.000248
Self time: 0.000248
count total (s) self (s)
23 0.000048 let self.variables.counter += 1
23 0.000079 let slot = { "id" : self.variables.counter, "slot" : a:slot }
23 0.000065 call add(self.variables.slots, slot)
23 0.000032 return slot
FUNCTION 104()
Called 1 time
Total time: 0.000035
Self time: 0.000035
count total (s) self (s)
1 0.000003 if exists("self.variables.old_t_ve")
return
endif
1 0.000003 let self.variables.old_guicursor = &guicursor
1 0.000011 set guicursor=n:block-NONE
1 0.000003 let self.variables.old_t_ve = &t_ve
1 0.000010 set t_ve=
FUNCTION 169()
Called 1 time
Total time: 0.000062
Self time: 0.000009
count total (s) self (s)
1 0.000061 0.000008 return self.disconnect(self.find_first_by(a:expr))
FUNCTION <SNR>143_FindHistoryItem()
Called 8 times
Total time: 0.000247
Self time: 0.000182
count total (s) self (s)
" Search backwards to find a matching job ID. IDs might be recycled,
" so finding the last one should be good enough.
20 0.000139 0.000074 for l:obj in reverse(ale#history#Get(a:buffer))
20 0.000036 if l:obj.job_id == a:job_id
8 0.000011 return l:obj
endif
12 0.000008 endfor
return {}
FUNCTION airline#highlighter#add_separator()
Called 10 times
Total time: 0.007898
Self time: 0.000197
count total (s) self (s)
10 0.000081 let s:separators[a:from.a:to] = [a:from, a:to, a:inverse]
10 0.007807 0.000106 call <sid>exec_separator({}, a:from, a:to, a:inverse, '')
FUNCTION ale_linters#tex#lacheck#Handle()
Called 2 times
Total time: 0.010103
Self time: 0.003435
count total (s) self (s)
" Mattes lines like:
"
" "book.tex", line 37: possible unwanted space at "{"
" "book.tex", line 38: missing `\ ' after "etc."
2 0.000005 let l:pattern = '^".\+", line \(\d\+\): \(.\+\)$'
2 0.000004 let l:output = []
178 0.007064 0.000396 for l:match in ale#util#GetMatches(a:lines, l:pattern)
" lacheck follows `\input{}` commands. If the cwd is not the same as the
" file in the buffer then it will fail to find the inputed items. We do not
" want warnings from those items anyway
176 0.001265 if !empty(matchstr(l:match[2], '^Could not open ".\+"$'))
continue
endif
176 0.001058 call add(l:output, { 'lnum': l:match[1] + 0, 'text': l:match[2], 'type': 'W',})
176 0.000164 endfor
2 0.000004 return l:output
FUNCTION 107()
Called 1 time
Total time: 0.576703
Self time: 0.000054
count total (s) self (s)
1 0.000003 let Old_execute = self.execute
1 0.000003 let self.execute = self.__empty
1 0.000001 try
1 0.576638 0.000012 let exit_code = call(self.start, a:000, self)
1 0.000005 if exit_code == 0
1 0.000035 0.000012 return self.getline()
endif
finally
1 0.000007 let self.execute = Old_execute
1 0.000004 endtry
return ""
FUNCTION <SNR>163__searchforward_cmd()
Called 1 time
Total time: 0.000067
Self time: 0.000018
count total (s) self (s)
1 0.000059 0.000010 let d = (g:incsearch#consistent_n_direction ? s:DIRECTION.forward : (incsearch#cli()._base_key is# '/' ? 1 : 0))
1 0.000007 return printf(":\<C-u>let v:searchforward=%d\<CR>", d)
FUNCTION <SNR>164_funcmanage()
Called 18 times
Total time: 0.000093
Self time: 0.000093
count total (s) self (s)
18 0.000066 return s:funcmanage
FUNCTION <SNR>154_FixList()
Called 4 times
Total time: 0.013912
Self time: 0.013912
count total (s) self (s)
4 0.000008 let l:new_list = []
1060 0.001234 for l:item in a:list
1056 0.001409 if l:item.bufnr == -1
" If the buffer number is invalid, remove it.
let l:fixed_item = copy(l:item)
call remove(l:fixed_item, 'bufnr')
else
" Don't copy the Dictionary if we do not need to.
1056 0.001691 let l:fixed_item = l:item
1056 0.000732 endif
1056 0.002483 call add(l:new_list, l:fixed_item)
1056 0.000820 endfor
4 0.000006 return l:new_list
FUNCTION 80()
Called 19 times
Total time: 0.000089
Self time: 0.000089
count total (s) self (s)
19 0.000070 return self.variables.prompt
FUNCTION 83()
Called 9 times
Total time: 0.000542
Self time: 0.000182
count total (s) self (s)
9 0.000029 if a:0
call self.line.set(a:1)
endif
9 0.000440 0.000080 call self.line.input(a:word)
FUNCTION 84()
Called 9 times
Total time: 0.000153
Self time: 0.000072
count total (s) self (s)
9 0.000144 0.000063 return self.line.forward()
FUNCTION 85()
Called 9 times
Total time: 0.000219
Self time: 0.000083
count total (s) self (s)
9 0.000204 0.000068 return self.line.backward()
FUNCTION 87()
Called 32 times
Total time: 0.008290
Self time: 0.006411
count total (s) self (s)
32 0.000105 if type(a:module) == type("")
9 0.005856 0.000083 return call(self.connect, [s:Module.make(a:module)] + a:000, self)
endif
23 0.000044 if empty(a:module)
return
endif
23 0.000064 let name = a:0 > 0 ? a:1 : a:module.name
23 0.000895 0.000168 let slot = self.variables.modules.find_first_by("get(v:val.slot, 'name', '') == " . string(name))
23 0.000048 if empty(slot)
23 0.000399 0.000151 call self.variables.modules.connect({ "name" : name, "module" : a:module })
23 0.000021 else
let slot.slot.module = a:module
endif
" let self.variables.modules[name] = a:module
FUNCTION <SNR>159_AllowedToCompleteInCurrentBuffer()
Called 484 times
Total time: 0.065442
Self time: 0.006829
count total (s) self (s)
484 0.064941 0.006328 return s:AllowedToCompleteInBuffer( '%' )
FUNCTION ale#job#ParseVim8ProcessID()
Called 540 times
Total time: 0.004719
Self time: 0.004719
count total (s) self (s)
540 0.004393 return matchstr(a:job_string, '\d\+') + 0
FUNCTION ale#highlight#SetHighlights()
Called 4 times
Total time: 0.040153
Self time: 0.001698
count total (s) self (s)
4 0.001245 let l:new_list = g:ale_enabled ? filter(copy(a:loclist), 'v:val.bufnr == a:buffer && v:val.col > 0') : []
" Set the list in the buffer variable.
4 0.000323 call setbufvar(str2nr(a:buffer), 'ale_highlight_items', l:new_list)
" Update highlights for the current buffer, which may or may not
" be the buffer we just set highlights for.
4 0.038572 0.000117 call ale#highlight#UpdateHighlights()
FUNCTION gitgutter#utility#set_buffer()
Called 1 time
Total time: 0.000032
Self time: 0.000032
count total (s) self (s)
1 0.000006 let s:bufnr = a:bufnr
1 0.000023 let s:file = resolve(bufname(a:bufnr))
FUNCTION <SNR>177__vital_loaded()
Called 1 time
Total time: 0.000563
Self time: 0.000010
count total (s) self (s)
1 0.000003 let s:V = a:V
1 0.000560 0.000007 let s:Message = s:V.import("Vim.Message")
FUNCTION airline#util#wrap()
Called 2742 times
Total time: 0.042398
Self time: 0.042398
count total (s) self (s)
2742 0.016984 if a:minwidth > 0 && winwidth(0) < a:minwidth
return ''
endif
2742 0.008890 return a:text
FUNCTION <SNR>168__vital_loaded()
Called 1 time
Total time: 0.007960
Self time: 0.000015
count total (s) self (s)
1 0.000002 let s:V = a:V
1 0.007911 0.000007 let s:Maker = s:V.import("Over.Commandline.Maker")
1 0.000047 0.000006 let s:Modules = s:V.import("Over.Commandline.Modules")
FUNCTION incsearch#cli#set()
Called 1 time
Total time: 0.000054
Self time: 0.000051
count total (s) self (s)
1 0.000003 let a:cli._base_key = a:config.command
1 0.000005 let a:cli._vcount1 = max([1, a:config.count])
1 0.000002 let a:cli._has_count = a:config.count > 0
1 0.000002 let a:cli._is_expr = a:config.is_expr
1 0.000002 let a:cli._mode = a:config.mode
1 0.000003 let a:cli._pattern = a:config.pattern
1 0.000002 let a:cli._prompt = a:config.prompt
1 0.000002 let a:cli._keymap = a:config.keymap
1 0.000002 let a:cli._converters = a:config.converters
1 0.000004 let a:cli._flag = a:config.is_stay ? 'n' : a:config.command is# '/' ? '' : a:config.command is# '?' ? 'b' : ''
1 0.000004 let a:cli._direction = (a:cli._base_key is# '/' ? s:DIRECTION.forward : s:DIRECTION.backward)
" TODO: provide config? but it may conflict with <expr> mapping
" NOTE: _w: default cursor view
1 0.000005 let a:cli._w = winsaveview()
1 0.000002 for module in a:config.modules
call a:cli.connect(module)
endfor
1 0.000007 0.000004 call a:cli.set_prompt(a:cli._prompt)
1 0.000002 return a:cli
FUNCTION 170()
Called 49 times
Total time: 0.513402
Self time: 0.001177
count total (s) self (s)
49 0.513358 0.001133 return call("s:call", [self.slots(), a:func] + a:000)
FUNCTION 172()
Called 26 times
Total time: 0.000884
Self time: 0.000166
count total (s) self (s)
26 0.000870 0.000152 return get(self.find_by(a:expr), 0, {})
FUNCTION 173()
Called 49 times
Total time: 0.044643
Self time: 0.000710
count total (s) self (s)
49 0.044594 0.000661 let self.variables.slots = s:L.sort_by(self.variables.slots, a:expr)
FUNCTION 175()
Called 58 times
Total time: 0.013205
Self time: 0.007682
count total (s) self (s)
58 0.013159 0.007636 return map(copy(self.variables.slots), "self.get_slot(v:val)")
FUNCTION ale#engine#ProcessChain()
Called 4 times
Total time: 0.002975
Self time: 0.000955
count total (s) self (s)
4 0.000078 let l:output_stream = get(a:linter, 'output_stream', 'stdout')
4 0.000030 let l:read_buffer = a:linter.read_buffer
4 0.000025 let l:chain_index = a:chain_index
4 0.000020 let l:input = a:input
4 0.000030 if has_key(a:linter, 'command_chain')
while l:chain_index < len(a:linter.command_chain)
" Run a chain of commands, one asychronous command after the other,
" so that many programs can be run in a sequence.
let l:chain_item = a:linter.command_chain[l:chain_index]
if l:chain_index == 0
" The first callback in the chain takes only a buffer number.
let l:command = ale#util#GetFunction(l:chain_item.callback)( a:buffer)
else
" The second callback in the chain takes some input too.
let l:command = ale#util#GetFunction(l:chain_item.callback)( a:buffer, l:input)
endif
if !empty(l:command)
" We hit a command to run, so we'll execute that
" The chain item can override the output_stream option.
if has_key(l:chain_item, 'output_stream')
let l:output_stream = l:chain_item.output_stream
endif
" The chain item can override the read_buffer option.
if has_key(l:chain_item, 'read_buffer')
let l:read_buffer = l:chain_item.read_buffer
elseif l:chain_index != len(a:linter.command_chain) - 1
" Don't read the buffer for commands besides the last one
" in the chain by default.
let l:read_buffer = 0
endif
break
endif
" Command chain items can return an empty string to indicate that
" a command should be skipped, so we should try the next item
" with no input.
let l:input = []
let l:chain_index += 1
endwhile
else
4 0.002100 0.000080 let l:command = ale#linter#GetCommand(a:buffer, a:linter)
4 0.000027 endif
4 0.000093 return { 'command': l:command, 'buffer': a:buffer, 'linter': a:linter, 'output_stream': l:output_stream, 'next_chain_index': l:chain_index + 1, 'read_buffer': l:read_buffer,}
FUNCTION ale#ShouldDoNothing()
Called 879 times
Total time: 0.247311
Self time: 0.066492
count total (s) self (s)
" Do nothing for blacklisted files
" OR if ALE is running in the sandbox
879 0.243787 0.062968 return index(g:ale_filetype_blacklist, &filetype) >= 0 || (exists('*getcmdwintype') && !empty(getcmdwintype())) || ale#util#InSandbox() || !ale#Var(a:buffer, 'enabled') || ale#FileTooLarge() || getbufvar(a:buffer, '&l:statusline') =~# 'CtrlPMode.*funky'
FUNCTION 88()
Called 1 time
Total time: 0.000074
Self time: 0.000012
count total (s) self (s)
1 0.000073 0.000011 return self.variables.modules.disconnect_by( "get(v:val.slot, 'name', '') == " . string(a:name) )
" unlet self.variables.modules[a:name]
FUNCTION 69()
Called 9 times
Total time: 0.000702
Self time: 0.000104
count total (s) self (s)
9 0.000693 0.000095 return self.line.set(a:line)
FUNCTION 383()
Called 49 times
Total time: 0.000285
Self time: 0.000285
count total (s) self (s)
49 0.000231 return a:event is# 'on_char' ? 10 : 0
FUNCTION <SNR>167_import()
Called 50 times
Total time: 0.070586
Self time: 0.001445
count total (s) self (s)
50 0.000099 let target = {}
50 0.000077 let functions = []
50 0.000088 for a in a:000
if type(a) == type({})
let target = a
elseif type(a) == type([])
let functions = a
endif
unlet a
endfor
50 0.026558 0.013901 let module = self._import(a:name)
50 0.000102 if empty(functions)
50 0.000260 call extend(target, module, 'keep')
50 0.000045 else
for f in functions
if has_key(module, f) && !has_key(target, f)
let target[f] = module[f]
endif
endfor
endif
50 0.000066 return target
FUNCTION 385()
Called 1 time
Total time: 0.036611
Self time: 0.034665
count total (s) self (s)
1 0.001695 0.000013 call s:hi.disable_all()
1 0.000215 0.000018 call s:hi.delete_all()
" redraw: hide pseud-cursor
1 0.034508 redraw " need to redraw for handling non-<expr> mappings
1 0.000041 0.000016 if a:cmdline.getline() ==# ''
echo ''
else
1 0.000090 0.000059 echo a:cmdline.get_prompt() . a:cmdline.getline()
1 0.000003 endif
" NOTE:
" push rest of keymappings with feedkeys()
" FIXME: assume 'noremap' but it should take care wheter or not the
" mappings should be remapped or not
1 0.000031 0.000020 if a:cmdline.input_key_stack_string() !=# ''
call feedkeys(a:cmdline.input_key_stack_string(), 'n')
endif
FUNCTION 386()
Called 9 times
Total time: 0.007740
Self time: 0.000179
count total (s) self (s)
9 0.007732 0.000171 call s:on_searching(function('s:on_char_pre'), a:cmdline)
FUNCTION 389()
Called 1 time
Total time: 0.005252
Self time: 0.000116
count total (s) self (s)
1 0.000020 0.000013 let is_cancel = self.exit_code()
1 0.000004 if is_cancel
return s:U.is_visual(self._mode) ? '\<ESC>gv' : "\<ESC>"
else
1 0.004783 0.000017 call self._call_execute_event()
1 0.000176 0.000026 let [pattern, offset] = incsearch#parse_pattern(a:input, self._base_key)
" TODO: implement convert input method
1 0.000088 0.000025 let p = self._combine_pattern(self._convert(pattern), offset)
1 0.000165 0.000015 return self._build_search_cmd(p)
endif
FUNCTION <SNR>165_lazy_config()
Called 1 time
Total time: 0.000020
Self time: 0.000014
count total (s) self (s)
1 0.000003 let m = mode(1)
1 0.000016 0.000010 return { 'count': v:count, 'mode': m, 'is_expr': (m is# 'no'), 'keymap': s:keymap() }
FUNCTION 94()
Called 9 times
Total time: 0.000195
Self time: 0.000098
count total (s) self (s)
9 0.000183 0.000086 return self.__keymapping__()
FUNCTION 97()
Called 9 times
Total time: 0.401534
Self time: 0.000202
count total (s) self (s)
9 0.389652 0.000084 call self.callevent("on_draw_pre")
9 0.011872 0.000108 call self.callevent("on_draw")
FUNCTION <SNR>153_BuildSignMap()
Called 4 times
Total time: 0.068801
Self time: 0.022959
count total (s) self (s)
4 0.000009 let l:sign_map = {}
4 0.000009 let l:sign_offset = g:ale_sign_offset
488 0.000933 for [l:line, l:sign_id, l:name] in a:current_sign_list
484 0.003370 let l:sign_map[l:line] = { 'current_id': l:sign_id, 'current_name': l:name, 'new_id': 0, 'new_name': '', 'items': [],}
484 0.000997 if l:sign_id > l:sign_offset
312 0.000627 let l:sign_offset = l:sign_id
312 0.000245 endif
484 0.000362 endfor
488 0.000571 for l:group in a:grouped_items
484 0.001193 let l:line = l:group[0].lnum
484 0.003220 let l:sign_info = get(l:sign_map, l:line, { 'current_id': 0, 'current_name': '', 'new_id': 0, 'new_name': '', 'items': [],})
484 0.048619 0.002777 let l:sign_info.new_name = ale#sign#GetSignName(l:group)
484 0.001027 let l:sign_info.items = l:group
484 0.001081 if l:sign_info.current_name isnot# l:sign_info.new_name
let l:sign_info.new_id = l:sign_offset + 1
let l:sign_offset += 1
else
484 0.001000 let l:sign_info.new_id = l:sign_info.current_id
484 0.000356 endif
484 0.001463 let l:sign_map[l:line] = l:sign_info
484 0.000418 endfor
4 0.000006 return l:sign_map
FUNCTION 319()
Called 28 times
Total time: 0.007968
Self time: 0.002173
count total (s) self (s)
28 0.000217 let hl = get(self.variables.hl_list, a:name, {})
28 0.000111 if empty(hl)
return -1
endif
28 0.004578 0.000223 if self.is_enabled(a:name)
call self.disable(a:name)
endif
28 0.001697 0.000257 let winnr = s:Gift.uniq_winnr()
28 0.000188 if !has_key(self.variables.id_list, winnr)
1 0.000003 let self.variables.id_list[winnr] = {}
1 0.000001 endif
28 0.000669 let self.variables.id_list[winnr][a:name] = matchadd(hl.group, hl.pattern, hl.priority)
FUNCTION ale#linter#GetExecutable()
Called 6 times
Total time: 0.000602
Self time: 0.000242
count total (s) self (s)
6 0.000594 0.000234 return has_key(a:linter, 'executable_callback') ? ale#util#GetFunction(a:linter.executable_callback)(a:buffer) : a:linter.executable
FUNCTION 196()
Called 9 times
Total time: 0.000721
Self time: 0.000424
count total (s) self (s)
9 0.000389 0.000092 if a:cmdline.is_input("\<C-k>")
call a:cmdline.tap_keyinput(self.prefix_key)
call a:cmdline.disable_keymapping()
call a:cmdline.setpos(a:cmdline.getpos()-1)
else
9 0.000050 if exists("self.prefix_key")
call a:cmdline.untap_keyinput(self.prefix_key)
call a:cmdline.enable_keymapping()
unlet! self.prefix_key
endif
9 0.000014 endif
FUNCTION <SNR>133_get_transitioned_seperator()
Called 10 times
Total time: 0.008185
Self time: 0.000287
count total (s) self (s)
10 0.000025 let line = ''
10 0.007992 0.000094 call airline#highlighter#add_separator(a:prev_group, a:group, a:side)
10 0.000048 let line .= '%#'.a:prev_group.'_to_'.a:group.'#'
10 0.000049 let line .= a:side ? a:self._context.left_sep : a:self._context.right_sep
10 0.000033 let line .= '%#'.a:group.'#'
10 0.000019 return line
FUNCTION 188()
Called 9 times
Total time: 0.000934
Self time: 0.000293
count total (s) self (s)
9 0.000814 0.000173 if a:cmdline.is_input("\<Esc>") || a:cmdline.is_input("\<C-c>")
" call a:cmdline.cancel()
call a:cmdline.exit(1)
call a:cmdline.setchar("")
endif
FUNCTION 392()
Called 19 times
Total time: 0.003182
Self time: 0.000849
count total (s) self (s)
19 0.000111 if v:version == 704 && !has('patch421')
" Ignore \ze* which clash vim 7.4 without 421 patch
" Assume `\m`
let [p, o] = incsearch#parse_pattern(self.getline(), self._base_key)
let p = (p =~# s:non_escaped_backslash . 'z[se]\%(\*\|\\+\)' ? '' : p)
return [p, o]
else
19 0.002677 0.000344 return incsearch#parse_pattern(self.getline(), self._base_key)
endif
FUNCTION 393()
Called 11 times
Total time: 0.000115
Self time: 0.000115
count total (s) self (s)
11 0.000101 return empty(a:offset) ? a:pattern : a:pattern . self._base_key . a:offset
FUNCTION 394()
Called 20 times
Total time: 0.000695
Self time: 0.000448
count total (s) self (s)
20 0.000078 if a:pattern is# ''
1 0.000004 return a:pattern
elseif empty(self._converters)
19 0.000417 0.000170 return incsearch#magic() . a:pattern
elseif has_key(self._converter_cache, a:pattern)
return self._converter_cache[a:pattern]
else
let ps = [incsearch#magic() . a:pattern]
for l:Converter in self._converters
let l:Convert = type(l:Converter) is type(function('function')) ? l:Converter : l:Converter.convert
let ps += [l:Convert(a:pattern)]
unlet l:Converter
endfor
" Converters may return upper case even if a:pattern doesn't contain upper
" case letter, so prepend case flag explicitly
" let case = incsearch#detect_case(a:pattern)
let case = incsearch#detect_case(a:pattern)
let self._converter_cache[a:pattern] = case . s:U.regexp_join(ps)
return self._converter_cache[a:pattern]
endif
FUNCTION vital#_incsearch#Over#Keymapping#import()
Called 1 time
Total time: 0.000020
Self time: 0.000020
count total (s) self (s)
1 0.000020 return map({'_vital_depends': '', 'unmapping': '', 'as_key_config': '', 'match_key': '', '_vital_loaded': ''}, 'function("s:" . v:key)')
FUNCTION ale_linters#tex#chktex#GetCommand()
Called 2 times
Total time: 0.001449
Self time: 0.000209
count total (s) self (s)
" Check for optional .chktexrc
2 0.001009 0.000059 let l:chktex_config = ale#path#FindNearestFile( a:buffer, '.chktexrc')
2 0.000184 0.000037 let l:command = ale#Var(a:buffer, 'tex_chktex_executable')
" Avoid bug when used without -p (last warning has gibberish for a filename)
2 0.000015 let l:command .= ' -v0 -p stdin -q'
2 0.000014 if !empty(l:chktex_config)
let l:command .= ' -l ' . ale#Escape(l:chktex_config)
endif
2 0.000178 0.000035 let l:command .= ' ' . ale#Var(a:buffer, 'tex_chktex_options')
2 0.000008 return l:command
FUNCTION airline#util#getwinvar()
Called 28 times
Total time: 0.000191
Self time: 0.000191
count total (s) self (s)
28 0.000165 return getwinvar(a:winnr, a:key, a:def)
FUNCTION ale#CallWithCooldown()
Called 875 times
Total time: 0.990601
Self time: 0.076902
count total (s) self (s)
875 0.027986 0.012381 let l:now = ale#util#ClockMilliseconds()
875 0.010626 if l:now < get(s:timestamp_map, a:timestamp_key, -1)
return 0
endif
875 0.012474 let s:timestamp_map[a:timestamp_key] = l:now + s:error_delay_ms
875 0.914816 0.016722 let l:return_value = call(a:func, a:arglist)
875 0.007674 let s:timestamp_map[a:timestamp_key] = -1
875 0.004089 return l:return_value
FUNCTION <SNR>197_rhs_key_list()
Called 1 time
Total time: 0.001041
Self time: 0.000105
count total (s) self (s)
1 0.000003 let mode = get(a:, 1, "")
1 0.000003 let abbr = get(a:, 2, 0)
1 0.000003 let dict = get(a:, 3, 0)
1 0.000002 let result = []
2 0.000007 for m in split(mode, '\zs')
1 0.000999 0.000063 let result += map(s:parse_lhs_list(m), "s:_maparg(v:val, m, abbr, dict)")
1 0.000002 endfor
1 0.000014 return filter(result, "empty(v:val) == 0")
FUNCTION <SNR>196_make_emacs()
Called 1 time
Total time: 0.000004
Self time: 0.000004
count total (s) self (s)
1 0.000004 return deepcopy(s:emacs)
FUNCTION <SNR>156_EchoImpl()
Called 426 times
Total time: 0.649379
Self time: 0.051218
count total (s) self (s)
426 0.132037 0.006274 if ale#ShouldDoNothing(bufnr(''))
return
endif
" Only echo the warnings in normal mode, otherwise we will get problems.
426 0.002828 if mode() isnot# 'n'
return
endif
426 0.319285 0.007560 let [l:info, l:loc] = s:FindItemAtCursor()
426 0.002613 if !empty(l:loc)
363 0.052743 0.008146 let l:msg = s:GetMessage(l:loc.linter_name, l:loc.type, l:loc.text)
363 0.121650 0.005574 call ale#cursor#TruncatedEcho(l:msg)
363 0.002391 let l:info.echoed = 1
363 0.001946 elseif get(l:info, 'echoed')
" We'll only clear the echoed message when moving off errors once,
" so we don't continually clear the echo line.
6 0.000194 echo
6 0.000041 let l:info.echoed = 0
6 0.000025 endif
FUNCTION 384()
Called 1 time
Total time: 0.000397
Self time: 0.000053
count total (s) self (s)
1 0.000001 nohlsearch " disable previous highlight
1 0.000004 let a:cmdline._w = winsaveview()
1 0.000055 0.000012 let hgm = incsearch#highlight#hgm()
1 0.000002 let c = hgm.cursor
1 0.000035 0.000007 call s:hi.add(c.group, c.group, '\%#', c.priority)
1 0.000274 0.000007 call incsearch#highlight#update()
" XXX: Manipulate search history for magic option
" In the first place, I want to omit magic flag when histadd(), but
" when returning cmd as expr mapping and feedkeys() cannot handle it, so
" remove no user intended magic flag at on_enter.
" Maybe I can also handle it with autocmd, should I use autocmd instead?
1 0.000004 let hist = histget('/', -1)
1 0.000014 0.000008 if len(hist) > 2 && hist[:1] ==# incsearch#magic()
call histdel('/', -1)
call histadd('/', hist[2:])
endif
FUNCTION vital#_incsearch#Gift#Tabpage#import()
Called 1 time
Total time: 0.000018
Self time: 0.000018
count total (s) self (s)
1 0.000018 return map({'uniq_nr': '', 'make_uniq_nr': '', 'numbering': '', 'set_prefix': ''}, 'function("s:" . v:key)')
FUNCTION 194()
Called 1 time
Total time: 0.000010
Self time: 0.000010
count total (s) self (s)
" Delete cache to handle additional digraphs definition
1 0.000006 let self.digraphs = {}
FUNCTION 195()
Called 9 times
Total time: 0.001124
Self time: 0.000809
count total (s) self (s)
9 0.000404 0.000089 if a:cmdline.is_input("\<C-k>")
if empty(self.digraphs)
" Get digraphs when inputting <C-k> instead of on_enter because it cause
" flicker in some environments #107
let self.digraphs = s:digraph()
endif
call a:cmdline.setchar('?')
let self.prefix_key = a:cmdline.input_key()
let self.old_line = a:cmdline.getline()
let self.old_pos = a:cmdline.getpos()
return
elseif exists("self.prefix_key") && a:cmdline.get_tap_key() == self.prefix_key
call a:cmdline.setline(self.old_line)
call a:cmdline.setpos(self.old_pos)
let x = a:cmdline.input_key()
let y = s:Input.getchar()
" For CTRL-K, there is one general digraph: CTRL-K <Space> {char} will
" enter {char} with the highest bit set. You can use this to enter
" meta-characters.
let char = x ==# "\<Space>" ? nr2char(char2nr(y) + 128) : get(self.digraphs, x . y, y)
call a:cmdline.setchar(char)
endif
FUNCTION 387()
Called 9 times
Total time: 0.040265
Self time: 0.000159
count total (s) self (s)
9 0.040257 0.000151 call s:on_searching(function('s:on_char'), a:cmdline)
FUNCTION 198()
Called 9 times
Total time: 0.002641
Self time: 0.001021
count total (s) self (s)
9 0.000821 0.000164 if a:cmdline.is_input("\<C-h>") || a:cmdline.is_input("\<BS>")
1 0.000019 0.000011 if a:cmdline.line.length() == 0
return a:cmdline.exit(1)
else
1 0.000181 0.000016 call a:cmdline.line.remove_prev()
1 0.000018 0.000005 call a:cmdline.setchar('')
1 0.000001 endif
1 0.000002 elseif a:cmdline.is_input("\<Del>")
call a:cmdline.line.remove_pos()
call a:cmdline.setchar('')
elseif a:cmdline.is_input("\<C-w>")
let word = a:cmdline.backward_word()
let backward = a:cmdline.backward()[ : -strlen(word)-1 ]
call a:cmdline.setline(backward . a:cmdline.line.pos_char() . a:cmdline.forward())
call a:cmdline.setline(strchars(backward))
call a:cmdline.setchar('')
elseif a:cmdline.is_input("\<C-u>")
call a:cmdline.setline(a:cmdline.line.pos_char() . a:cmdline.forward())
call a:cmdline.setline(0)
call a:cmdline.setchar('')
endif
FUNCTION <SNR>129_exec_separator()
Called 39 times
Total time: 0.036323
Self time: 0.002638
count total (s) self (s)
39 0.000160 if pumvisible()
return
endif
39 0.009053 0.000396 let l:from = airline#themes#get_highlight(a:from.a:suffix)
39 0.008833 0.000359 let l:to = airline#themes#get_highlight(a:to.a:suffix)
39 0.000223 let group = a:from.'_to_'.a:to.a:suffix
39 0.000084 if a:inverse
8 0.000069 let colors = [ l:from[1], l:to[1], l:from[3], l:to[3] ]
8 0.000013 else
31 0.000267 let colors = [ l:to[1], l:from[1], l:to[3], l:from[3] ]
31 0.000046 endif
39 0.000178 let a:dict[group] = colors
39 0.016934 0.000380 call airline#highlighter#exec(group, colors)
FUNCTION <SNR>163_set_search_related_stuff()
Called 1 time
Total time: 0.003624
Self time: 0.000757
count total (s) self (s)
" For stay motion
1 0.000013 let should_set_jumplist = get(a:, 1, s:TRUE)
1 0.000019 0.000013 let is_cancel = a:cli.exit_code()
1 0.000004 if is_cancel
" Restore cursor position and return
" NOTE: Should I request on_cancel event to vital-over and use it?
call winrestview(a:cli._w)
call s:cleanup_cmdline()
return
endif
1 0.000220 0.000014 let [raw_pattern, offset] = a:cli._parse_pattern()
1 0.000011 let should_execute = !empty(offset) || empty(raw_pattern)
1 0.000004 if should_execute
" Execute with feedkeys() to work with
" 1. :h {offset} for `n` and `N`
" 2. empty input (:h last-pattern)
" NOTE: Don't use feedkeys() as much as possible to avoid flickering
call winrestview(a:cli._w)
call feedkeys(a:cmd, 'n')
if g:incsearch#consistent_n_direction
call feedkeys("\<Plug>(_incsearch-searchforward)", 'm')
endif
else
" Add history if necessary
" Do not save converted pattern to history
1 0.000062 0.000015 let pattern = a:cli._convert(raw_pattern)
1 0.000027 0.000015 let input = a:cli._combine_pattern(raw_pattern, offset)
1 0.000014 call histadd(a:cli._base_key, input)
1 0.000054 0.000038 call s:set_search_reg(pattern, a:cli._base_key)
1 0.000011 let target_view = winsaveview()
1 0.000066 call winrestview(a:cli._w) " Get back start position temporarily for emulation
" Set jump list
1 0.000004 if should_set_jumplist
1 0.000085 normal! m`
1 0.000003 endif
" Emulate errors, and handling `n` and `N` preparation
1 0.002382 0.000030 call s:emulate_search_error(a:cli._direction, a:cli._w)
" winrestview() between error and wraning emulation to avoid flickering
1 0.000108 call winrestview(target_view)
" Emulate warning
1 0.000150 0.000045 call s:emulate_search_warning(a:cli._direction, a:cli._w, target_view)
1 0.000149 0.000026 call s:silent_after_search()
" Open fold
1 0.000037 if &foldopen =~# '\vsearch|all'
1 0.000118 normal! zv
1 0.000003 endif
1 0.000002 endif
FUNCTION <SNR>199_make()
Called 1 time
Total time: 0.000004
Self time: 0.000004
count total (s) self (s)
1 0.000003 return deepcopy(s:module)
FUNCTION airline#themes#patch()
Called 1 time
Total time: 0.000639
Self time: 0.000639
count total (s) self (s)
12 0.000055 for mode in keys(a:palette)
11 0.000107 if !has_key(a:palette[mode], 'airline_warning')
let a:palette[mode]['airline_warning'] = [ '#000000', '#df5f00', 232, 166 ]
endif
11 0.000118 if !has_key(a:palette[mode], 'airline_error')
let a:palette[mode]['airline_error'] = [ '#000000', '#990000', 232, 160 ]
endif
11 0.000035 endfor
1 0.000011 let a:palette.accents = get(a:palette, 'accents', {})
1 0.000012 let a:palette.accents.none = [ '', '', '', '', '' ]
1 0.000010 let a:palette.accents.bold = [ '', '', '', '', 'bold' ]
1 0.000008 let a:palette.accents.italic = [ '', '', '', '', 'italic' ]
1 0.000008 if !has_key(a:palette.accents, 'red')
let a:palette.accents.red = [ '#ff0000' , '' , 160 , '' ]
endif
1 0.000007 if !has_key(a:palette.accents, 'green')
let a:palette.accents.green = [ '#008700' , '' , 22 , '' ]
endif
1 0.000007 if !has_key(a:palette.accents, 'blue')
let a:palette.accents.blue = [ '#005fff' , '' , 27 , '' ]
endif
1 0.000008 if !has_key(a:palette.accents, 'yellow')
let a:palette.accents.yellow = [ '#dfff00' , '' , 190 , '' ]
endif
1 0.000007 if !has_key(a:palette.accents, 'orange')
let a:palette.accents.orange = [ '#df5f00' , '' , 166 , '' ]
endif
1 0.000006 if !has_key(a:palette.accents, 'purple')
let a:palette.accents.purple = [ '#af00df' , '' , 128 , '' ]
endif
FUNCTION <SNR>163_set_search_reg()
Called 1 time
Total time: 0.000016
Self time: 0.000016
count total (s) self (s)
1 0.000014 let @/ = a:command is# '?' ? substitute(a:pattern, '\\?', '?', 'g') : a:pattern
FUNCTION <SNR>156_GetMessage()
Called 363 times
Total time: 0.044597
Self time: 0.044597
count total (s) self (s)
363 0.002544 let l:msg = g:ale_echo_msg_format
363 0.003771 let l:type = a:type is# 'E' ? g:ale_echo_msg_error_str : g:ale_echo_msg_warning_str
" Replace handlers if they exist
1089 0.010439 for [l:k, l:v] in items({'linter': a:linter, 'severity': l:type})
726 0.015446 let l:msg = substitute(l:msg, '\V%' . l:k . '%', l:v, '')
726 0.001900 endfor
363 0.003629 return printf(l:msg, a:text)
FUNCTION 210()
Called 9 times
Total time: 0.000461
Self time: 0.000461
count total (s) self (s)
9 0.000365 execute self.draw_command
" execute "echohl" a:cmdline.highlights.prompt
" call s:echon(a:cmdline.get_prompt())
" echohl NONE
" call s:echon(a:cmdline.backward())
" if empty(a:cmdline.line.pos_char())
" execute "echohl" a:cmdline.highlights.cursor
" call s:echon(' ')
" else
" execute "echohl" a:cmdline.highlights.cursor_on
" call s:echon(a:cmdline.line.pos_char())
" endif
" echohl NONE
" call s:echon(a:cmdline.forward())
" if a:cmdline.get_suffix() != ""
" call s:echon(s:suffix(a:cmdline.get_prompt() . a:cmdline.getline() . repeat(" ", empty(a:cmdline.line.pos_char())), a:cmdline.get_suffix()))
" endif
FUNCTION <SNR>159_OnInsertChar()
Called 52 times
Total time: 0.001106
Self time: 0.001070
count total (s) self (s)
52 0.000445 call timer_stop( s:pollers.completion.id )
52 0.000201 if pumvisible()
2 0.000062 0.000026 call s:SendKeys( "\<C-e>" )
2 0.000005 endif
FUNCTION <SNR>142_RemoveProblemsForDisabledLinters()
Called 2 times
Total time: 0.003495
Self time: 0.003495
count total (s) self (s)
" Figure out which linters are still enabled, and remove
" problems for linters which are no longer enabled.
2 0.000012 let l:name_map = {}
8 0.000034 for l:linter in a:linters
6 0.000043 let l:name_map[l:linter.name] = 1
6 0.000012 endfor
2 0.003357 call filter( get(g:ale_buffer_info[a:buffer], 'loclist', []), 'get(l:name_map, get(v:val, ''linter_name''))',)
FUNCTION 212()
Called 1 time
Total time: 0.000063
Self time: 0.000023
count total (s) self (s)
1 0.000062 0.000022 call s:cmdheight.restore()
FUNCTION <SNR>197_parse_lhs_list()
Called 1 time
Total time: 0.000720
Self time: 0.000065
count total (s) self (s)
1 0.000004 let mode = get(a:, 1, "")
1 0.000715 0.000060 return map(s:capture_list(mode), "s:parse_lhs(v:val, mode)")
FUNCTION <SNR>177_capture()
Called 1 time
Total time: 0.000039
Self time: 0.000020
count total (s) self (s)
1 0.000005 if hlexists(a:name) == 0
return ""
endif
1 0.000031 0.000012 return s:Message.capture("highlight " . a:name)
FUNCTION 216()
Called 9 times
Total time: 0.001108
Self time: 0.000503
count total (s) self (s)
9 0.000754 0.000149 if a:cmdline.is_input("\<C-v>") || a:cmdline.is_input("\<C-q>")
let old_line = a:cmdline.getline()
let old_pos = a:cmdline.getpos()
call a:cmdline.insert('^')
call a:cmdline.setpos(old_pos)
call a:cmdline.draw()
let char = a:cmdline.getchar()
call a:cmdline.setline(old_line)
call a:cmdline.setpos(old_pos)
call a:cmdline.setchar(char)
endif
FUNCTION airline#highlighter#load_theme()
Called 1 time
Total time: 0.025655
Self time: 0.000142
count total (s) self (s)
1 0.000006 if pumvisible()
return
endif
1 0.000026 for winnr in filter(range(1, winnr('$')), 'v:val != winnr()')
call airline#highlighter#highlight_modified_inactive(winbufnr(winnr))
endfor
1 0.000274 0.000035 call airline#highlighter#highlight(['inactive'])
1 0.000016 if getbufvar( bufnr('%'), '&modified' )
call airline#highlighter#highlight(['normal', 'modified'])
else
1 0.025298 0.000024 call airline#highlighter#highlight(['normal'])
1 0.000003 endif
FUNCTION <SNR>116_check_defined_section()
Called 2 times
Total time: 0.000037
Self time: 0.000037
count total (s) self (s)
2 0.000014 if !exists('w:airline_section_{a:name}')
2 0.000015 let w:airline_section_{a:name} = g:airline_section_{a:name}
2 0.000002 endif
FUNCTION <SNR>197_escape_special_key()
Called 30 times
Total time: 0.000445
Self time: 0.000445
count total (s) self (s)
" Workaround : <C-?> https://github.com/osyo-manga/vital-palette/issues/5
30 0.000052 if a:key ==# "<^?>"
10 0.000014 return "\<C-?>"
endif
20 0.000269 execute 'let result = "' . substitute(escape(a:key, '\"'), '\(<.\{-}>\)', '\\\1', 'g') . '"'
20 0.000033 return result
FUNCTION <SNR>164__390()
Called 1 time
Total time: 0.000183
Self time: 0.000043
count total (s) self (s)
1 0.000181 0.000041 return call(<SNR>164_funcmanage()['_390']['func'], a:000, <SNR>164_funcmanage()['_390']['dict'])
FUNCTION ale#engine#IsExecutable()
Called 6 times
Total time: 0.000586
Self time: 0.000402
count total (s) self (s)
6 0.000114 if has_key(s:executable_cache_map, a:executable)
4 0.000017 return 1
endif
2 0.000011 let l:result = 0
2 0.000106 if executable(a:executable)
let s:executable_cache_map[a:executable] = 1
let l:result = 1
endif
2 0.000010 if g:ale_history_enabled
2 0.000225 0.000041 call ale#history#Add(a:buffer, l:result, 'executable', a:executable)
2 0.000006 endif
2 0.000010 return l:result
FUNCTION ale#Escape()
Called 4 times
Total time: 0.000226
Self time: 0.000226
count total (s) self (s)
4 0.000055 if fnamemodify(&shell, ':t') is? 'cmd.exe'
" If the string contains spaces, it will be surrounded by quotes.
" Otherwise, special characters will be escaped with carets (^).
return substitute( a:str =~# ' ' ? '"' . substitute(a:str, '"', '""', 'g') . '"' : substitute(a:str, '\v([&|<>^])', '^\1', 'g'), '%', '%%', 'g',)
endif
4 0.000052 return shellescape (a:str)
FUNCTION <SNR>114_CountMatches()
Called 220 times
Total time: 0.012433
Self time: 0.012433
count total (s) self (s)
220 0.012206 return len(substitute(substitute(a:str, a:pat, "\n", 'g'), "[^\n]", '', 'g'))
FUNCTION <SNR>133_get_accented_line()
Called 12 times
Total time: 0.000991
Self time: 0.000991
count total (s) self (s)
12 0.000031 if a:self._context.active
12 0.000026 let contents = []
12 0.000116 let content_parts = split(a:contents, '__accent')
32 0.000070 for cpart in content_parts
20 0.000225 let accent = matchstr(cpart, '_\zs[^#]*\ze')
20 0.000080 call add(contents, cpart)
20 0.000023 endfor
12 0.000058 let line = join(contents, a:group)
12 0.000127 let line = substitute(line, '__restore__', a:group, 'g')
12 0.000015 else
let line = substitute(a:contents, '%#__accent[^#]*#', '', 'g')
let line = substitute(line, '%#__restore__#', '', 'g')
endif
12 0.000025 return line
FUNCTION 280()
Called 1 time
Total time: 0.002426
Self time: 0.000142
count total (s) self (s)
1 0.000004 if !exists('s:default_backward_word')
1 0.000004 let s:default_backward_word = a:cmdline.backward_word
1 0.000001 endif
4 0.000006 for module in self.modules
3 0.000038 0.000030 if has_key(module, '_condition') && ! module._condition()
1 0.000079 0.000005 call a:cmdline.disconnect(module.name)
1 0.000002 if module.name ==# 'IgnoreRegexpBackwardWord'
function! a:cmdline.backward_word(...) abort
return call(s:default_backward_word, a:000, self)
endfunction
endif
1 0.000002 elseif empty(a:cmdline.get_module(module.name))
2 0.000203 0.000009 call a:cmdline.connect(module)
2 0.000006 if has_key(module, 'on_enter')
2 0.001887 0.000011 call module.on_enter(a:cmdline)
2 0.000002 endif
2 0.000000 endif
3 0.000002 endfor
FUNCTION vital#_incsearch#Over#Commandline#Modules#DrawCommandline#import()
Called 1 time
Total time: 0.000012
Self time: 0.000012
count total (s) self (s)
1 0.000012 return map({'suffix': '', 'make': ''}, 'function("s:" . v:key)')
FUNCTION 281()
Called 49 times
Total time: 0.000343
Self time: 0.000343
count total (s) self (s)
" NOTE: to overwrite backward_word() with default function
49 0.000236 return a:event ==# 'on_enter' ? 5 : 0
FUNCTION 185()
Called 9 times
Total time: 0.000012
Self time: 0.000012
count total (s) self (s)
" redrawstatus
FUNCTION <SNR>53_airline_refresh()
Called 1 time
Total time: 0.059126
Self time: 0.000157
count total (s) self (s)
1 0.000010 if !exists("#airline")
" disabled
return
endif
1 0.000005 let nomodeline=''
1 0.000009 if v:version > 703 || v:version == 703 && has("patch438")
1 0.000006 let nomodeline = '<nomodeline>'
1 0.000002 endif
1 0.000062 0.000033 exe printf("silent doautocmd %s User AirlineBeforeRefresh", nomodeline)
1 0.000190 0.000038 call airline#highlighter#reset_hlcache()
1 0.050218 0.000034 call airline#load_theme()
1 0.008613 0.000009 call airline#update_statusline()
FUNCTION 90()
Called 49 times
Total time: 0.559373
Self time: 0.001328
count total (s) self (s)
49 0.045233 0.000590 call self.variables.modules.sort_by("has_key(v:val.slot.module, 'priority') ? v:val.slot.module.priority('" . a:event . "') : 0")
49 0.514071 0.000669 return self.variables.modules.call(a:event, [self])
" call map(filter(copy(self.variables.modules), "has_key(v:val, a:event)"), "v:val." . a:event . "(self)")
FUNCTION vital#_incsearch#Vim#Message#import()
Called 1 time
Total time: 0.000023
Self time: 0.000023
count total (s) self (s)
1 0.000023 return map({'capture': '', 'echomsg': '', 'echo': '', 'warn': '', 'get_hit_enter_max_length': '', 'error': ''}, 'function("s:" . v:key)')
FUNCTION LatexBox_TexIndent()
Called 55 times
Total time: 0.032490
Self time: 0.020057
count total (s) self (s)
55 0.000266 let lnum_curr = v:lnum
55 0.000443 let lnum_prev = prevnonblank(lnum_curr - 1)
55 0.000154 if lnum_prev == 0
return 0
endif
55 0.000296 let line_curr = getline(lnum_curr)
55 0.000262 let line_prev = getline(lnum_prev)
" remove \\
55 0.000824 let line_curr = substitute(line_curr, '\\\\', '', 'g')
55 0.000489 let line_prev = substitute(line_prev, '\\\\', '', 'g')
" strip comments
55 0.004774 let line_curr = substitute(line_curr, '\\\@<!%.*$', '', 'g')
55 0.000854 let line_prev = substitute(line_prev, '\\\@<!%.*$', '', 'g')
" find unmatched opening patterns on previous line
55 0.008724 0.001152 let n = s:CountMatches(line_prev, s:open_pat)-s:CountMatches(line_prev, s:close_pat)
55 0.006003 0.001142 let n += s:CountMatches(line_prev, s:list_open_pat)-s:CountMatches(line_prev, s:list_close_pat)
" reduce indentation if current line starts with a closing pattern
55 0.001064 if line_curr =~ '^\s*\%(' . s:close_pat . '\)'
let n -= 1
endif
" compensate indentation if previous line starts with a closing pattern
55 0.000963 if line_prev =~ '^\s*\%(' . s:close_pat . '\)'
55 0.000169 let n += 1
55 0.000085 endif
" reduce indentation if current line starts with a closing list
55 0.000841 if line_curr =~ '^\s*\%(' . s:list_close_pat . '\)'
let n -= 1
endif
" compensate indentation if previous line starts with a closing list
55 0.000902 if line_prev =~ '^\s*\%(' . s:list_close_pat . '\)'
let n += 1
endif
" reduce indentation if previous line is \begin{document}
55 0.000509 if line_prev =~ '\\begin\s*{document}'
let n -= 1
endif
" less shift for lines starting with \item
55 0.000508 let item_here = line_curr =~ '^\s*\\item'
55 0.000501 let item_above = line_prev =~ '^\s*\\item'
55 0.000181 if !item_here && item_above
let n += 1
elseif item_here && !item_above
let n -= 1
endif
55 0.000792 return indent(lnum_prev) + n * &sw
FUNCTION <SNR>204_move_cursor()
Called 9 times
Total time: 0.011282
Self time: 0.001664
count total (s) self (s)
9 0.000071 let offset = get(a:, 1, '')
9 0.000035 if a:cli._flag ==# 'n' " skip if stay mode
return
endif
9 0.000486 call winrestview(a:cli._w)
" pseud-move cursor position: this is restored afterward if called by
" <expr> mappings
9 0.000055 if a:cli._is_expr
for _ in range(a:cli._vcount1)
" NOTE: This cannot handle {offset} for cursor position
call search(a:pattern, a:cli._flag)
endfor
else
" More precise cursor position while searching
" Caveat:
" This block contains `normal`, please make sure <expr> mappings
" doesn't reach this block
9 0.000238 0.000127 let is_visual_mode = s:U.is_visual(mode(1))
9 0.003511 0.000329 let cmd = incsearch#with_ignore_foldopen( s:U.dictfunction(a:cli._build_search_cmd, a:cli), a:cli._combine_pattern(a:pattern, offset), 'n')
" NOTE:
" :silent!
" Shut up errors! because this is just for the cursor emulation
" while searching
9 0.006442 0.000117 silent! call incsearch#execute_search(cmd)
9 0.000033 if is_visual_mode
let w = winsaveview()
normal! gv
call winrestview(w)
call incsearch#highlight#emulate_visual_highlight()
endif
9 0.000014 endif
FUNCTION incsearch#cli#get()
Called 1 time
Total time: 0.000036
Self time: 0.000026
count total (s) self (s)
1 0.000002 try
" It returns current cli object
1 0.000019 0.000009 return s:Doautocmd.get_cmdline()
catch /vital-over(_incsearch) Exception/
" If there are no current cli object, return default one
return incsearch#cli#make(incsearch#config#make({}))
endtry
FUNCTION 98()
Called 1 time
Total time: 0.000018
Self time: 0.000018
count total (s) self (s)
1 0.000005 let self.variables.exit = 1
1 0.000010 let self.variables.exit_code = get(a:, 1, 0)
FUNCTION <SNR>196__convert_sid()
Called 10 times
Total time: 0.000072
Self time: 0.000072
count total (s) self (s)
10 0.000070 return substitute(a:rhs, '<SID>', '<SNR>' . a:sid . '_', 'g')
FUNCTION vital#_incsearch#Gift#import()
Called 1 time
Total time: 0.000066
Self time: 0.000066
count total (s) self (s)
1 0.000064 return map({'flatten': '', 'uniq_tabpagenr': '', 'tabpagewinnr_list': '', 'execute': '', 'getwinvar': '', 'winnr': '', 'jump_window': '', '_vital_depends': '', 'uniq_winnr': '', 'setwinvar': '', 'find': '', 'openable_bufnr_list': '', 'to_fullpath': '', 'bufnr': '', 'set_current_window': '', 'tabpagewinnr': '', 'close_window': '', 'close_window_by': '', 'uniq_winnr_list': '', '_vital_loaded': '', 'find_by': ''}, 'function("s:" . v:key)')
FUNCTION <SNR>156_EchoWithDelayImpl()
Called 447 times
Total time: 0.172791
Self time: 0.042485
count total (s) self (s)
447 0.127096 0.006676 if ale#ShouldDoNothing(bufnr(''))
return
endif
447 0.015223 0.005337 call s:StopCursorTimer()
447 0.011169 let l:pos = getcurpos()[0:2]
" Check the current buffer, line, and column number against the last
" recorded position. If the position has actually changed, *then*
" we should echo something. Otherwise we can end up doing processing
" the echo message far too frequently.
447 0.002573 if l:pos != s:last_pos
446 0.002591 let s:last_pos = l:pos
446 0.006004 let s:cursor_timer = timer_start(10, function('ale#cursor#EchoCursorWarning'))
446 0.001037 endif
FUNCTION <SNR>191_doautocmd_user()
Called 40 times
Total time: 0.004256
Self time: 0.002955
count total (s) self (s)
40 0.000237 let group = a:prefix . "-vital-over-commandline-doautocmd-dummy"
40 0.000240 if !has_key(s:cache_command, a:prefix)
1 0.000003 let s:cache_command[a:prefix] = {}
1 0.000000 endif
40 0.000284 if !has_key(s:cache_command[a:prefix], a:command)
8 0.000218 execute "autocmd " . group . " User " . a:command." silent! execute ''"
8 0.000057 if v:version > 703 || v:version == 703 && has("patch438")
8 0.000088 let s:cache_command[a:prefix][a:command] = "doautocmd <nomodeline> User " . a:command
8 0.000017 else
let s:cache_command[a:prefix][a:command] = "doautocmd User " . a:command
endif
8 0.000013 endif
40 0.002047 0.000746 execute s:cache_command[a:prefix][a:command]
FUNCTION incsearch#over#modules#bulk_input_char#make()
Called 1 time
Total time: 0.000005
Self time: 0.000005
count total (s) self (s)
1 0.000004 return deepcopy(s:bulk_input_char)
FUNCTION 119()
Called 9 times
Total time: 0.120163
Self time: 0.001523
count total (s) self (s)
9 0.000091 0.000058 if !self.is_enable_keymapping()
return self.__input(s:Input.getchar())
endif
9 0.001429 0.000124 let input = s:Input.getchar()
9 0.000386 0.000174 let old_line = self.getline()
9 0.000240 0.000102 let old_pos = self.getpos()
9 0.007580 0.000112 let keymapping = self.__get_keymapping()
9 0.000022 try
9 0.000051 let t = reltime()
9 0.001039 0.000182 while s:is_input_waiting(keymapping, input) && str2nr(reltimestr(reltime(t))) * 1000 < &timeoutlen
call self.setline(old_line)
call self.insert(input)
call self.setpos(old_pos)
call self.draw()
let input .= s:Input.getchar(0)
endwhile
9 0.000028 finally
9 0.000802 0.000100 call self.setline(old_line)
9 0.000630 0.000104 call self.setpos(old_pos)
9 0.000023 endtry
9 0.107518 0.000119 call self.__input(input, keymapping)
FUNCTION <SNR>189__vital_loaded()
Called 1 time
Total time: 0.000054
Self time: 0.000009
count total (s) self (s)
1 0.000002 let s:V = a:V
1 0.000051 0.000006 let s:String = s:V.import("Over.String")
FUNCTION airline#highlighter#highlight()
Called 5 times
Total time: 0.122054
Self time: 0.015656
count total (s) self (s)
5 0.000032 let bufnr = a:0 ? a:1 : ''
5 0.000042 let p = g:airline#themes#{g:airline_theme}#palette
" draw the base mode, followed by any overrides
5 0.000142 let mapped = map(a:modes, 'v:val == a:modes[0] ? v:val : a:modes[0]."_".v:val')
5 0.000043 let suffix = a:modes[0] == 'inactive' ? '_inactive' : ''
15 0.000049 for mode in mapped
10 0.000051 if mode == 'inactive' && winnr('$') == 1
" there exist no inactive windows, don't need to create all those
" highlighting groups
1 0.000003 continue
endif
9 0.000093 if exists('g:airline#themes#{g:airline_theme}#palette[mode]')
6 0.000047 let dict = g:airline#themes#{g:airline_theme}#palette[mode]
53 0.000223 for kvp in items(dict)
47 0.000261 let mode_colors = kvp[1]
47 0.000245 let name = kvp[0]
47 0.000293 if name is# 'airline_c' && !empty(bufnr) && suffix is# '_inactive'
let name = 'airline_c'.bufnr
endif
47 0.026045 0.000712 call airline#highlighter#exec(name.suffix, mode_colors)
141 0.000563 for accent in keys(s:accents)
94 0.000549 if !has_key(p.accents, accent)
continue
endif
94 0.000682 let colors = copy(mode_colors)
94 0.000609 if p.accents[accent][0] != ''
47 0.000332 let colors[0] = p.accents[accent][0]
47 0.000088 endif
94 0.000490 if p.accents[accent][2] != ''
47 0.000315 let colors[2] = p.accents[accent][2]
47 0.000084 endif
94 0.000405 if len(colors) >= 5
94 0.000791 let colors[4] = get(p.accents[accent], 4, '')
94 0.000170 else
call add(colors, get(p.accents[accent], 4, ''))
endif
94 0.053969 0.001526 call airline#highlighter#exec(name.suffix.'_'.accent, colors)
94 0.000179 endfor
47 0.000073 endfor
" TODO: optimize this
35 0.000131 for sep in items(s:separators)
29 0.029147 0.000525 call <sid>exec_separator(dict, sep[1][0], sep[1][1], sep[1][2], suffix)
29 0.000043 endfor
6 0.000013 endif
9 0.000010 endfor
FUNCTION incsearch#with_ignore_foldopen()
Called 9 times
Total time: 0.001728
Self time: 0.000494
count total (s) self (s)
9 0.000051 let foldopen_save = &foldopen
9 0.000076 let &foldopen=''
9 0.000017 try
9 0.001418 0.000184 return call(a:F, a:000)
finally
9 0.000089 let &foldopen = foldopen_save
9 0.000022 endtry
FUNCTION vital#_incsearch#Prelude#import()
Called 1 time
Total time: 0.000087
Self time: 0.000087
count total (s) self (s)
1 0.000087 return map({'escape_pattern': '', 'is_funcref': '', 'path2directory': '', 'wcswidth': '', 'is_string': '', 'input_helper': '', 'is_number': '', 'is_cygwin': '', 'path2project_directory': '', 'strwidthpart_reverse': '', 'input_safe': '', 'is_list': '', 'truncate_skipping': '', 'glob': '', 'truncate': '', 'is_dict': '', 'set_default': '', 'is_numeric': '', 'getchar_safe': '', 'substitute_path_separator': '', 'is_mac': '', 'strwidthpart': '', 'getchar': '', 'is_unix': '', 'is_windows': '', 'globpath': '', 'escape_file_searching': '', 'is_float': '', 'smart_execute_command': ''}, 'function("s:" . v:key)')
FUNCTION <SNR>197__maparg()
Called 11 times
Total time: 0.000216
Self time: 0.000216
count total (s) self (s)
" Workaround : <C-?> https://github.com/osyo-manga/vital-palette/issues/5
11 0.000021 if a:name ==# "<^?>"
return maparg("\<C-?>", a:mode, a:abbr, a:dict)
endif
11 0.000147 return maparg(a:name, a:mode, a:abbr, a:dict)
FUNCTION ale_linters#tex#lacheck#GetCommand()
Called 2 times
Total time: 0.000277
Self time: 0.000057
count total (s) self (s)
2 0.000266 0.000046 return ale#Var(a:buffer, 'tex_lacheck_executable') . ' %t'
FUNCTION <SNR>198__verbosefile_push()
Called 1 time
Total time: 0.000020
Self time: 0.000020
count total (s) self (s)
1 0.000004 call add(s:verbosefiles, &verbosefile)
1 0.000014 let &verbosefile = a:file
1 0.000002 return a:file
FUNCTION 118()
Called 10 times
Total time: 0.107403
Self time: 0.001423
count total (s) self (s)
10 0.000045 if a:input == ""
1 0.000001 return
endif
9 0.000051 let self.variables.input_key = a:input
9 0.000026 if a:0 == 0
let keymapping = self.__get_keymapping()
else
9 0.000039 let keymapping = a:1
9 0.000016 endif
9 0.000128 0.000076 if self.is_enable_keymapping()
9 0.003110 0.000151 let key = s:Keymapping.unmapping(keymapping, a:input)
9 0.000022 else
let key = a:input
endif
9 0.000027 if key == ""
return
endif
9 0.000813 0.000177 call self.set_input_key_stack(s:String.split_by_keys(key))
18 0.000450 0.000307 while !(empty(self.input_key_stack()) || self.is_exit())
9 0.102332 0.000142 call self.__input_char(self.input_key_stack_pop())
9 0.000018 endwhile
FUNCTION airline#parts#ffenc()
Called 549 times
Total time: 0.048437
Self time: 0.048437
count total (s) self (s)
549 0.005275 let expected = get(g:, 'airline#parts#ffenc#skip_expected_string', '')
549 0.002904 let bomb = &l:bomb ? '[BOM]' : ''
549 0.017926 let ff = strlen(&ff) ? '['.&ff.']' : ''
549 0.009495 if expected is# &fenc.bomb.ff
return ''
else
549 0.008752 return &fenc.bomb.ff
endif
FUNCTION <SNR>206_make()
Called 1 time
Total time: 0.000385
Self time: 0.000016
count total (s) self (s)
1 0.000009 let result = deepcopy(s:base)
1 0.000375 0.000006 let result.windo = s:Window.as_windo(result)
1 0.000001 return result
FUNCTION <SNR>164_SID()
Called 14 times
Total time: 0.000510
Self time: 0.000510
count total (s) self (s)
14 0.000493 return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze_SID$')
FUNCTION 388()
Called 9 times
Total time: 0.000097
Self time: 0.000097
count total (s) self (s)
9 0.000086 return copy(self._keymap)
FUNCTION ale#linter#GetCommand()
Called 4 times
Total time: 0.002020
Self time: 0.000210
count total (s) self (s)
4 0.002009 0.000199 return has_key(a:linter, 'command_callback') ? ale#util#GetFunction(a:linter.command_callback)(a:buffer) : a:linter.command
FUNCTION <SNR>167__get_module()
Called 39 times
Total time: 0.023207
Self time: 0.001148
count total (s) self (s)
39 0.000995 0.000330 let funcname = s:_import_func_name(self.plugin_name(), a:name)
39 0.020605 0.000229 if s:_exists_autoload_func_with_source(funcname)
39 0.001581 0.000563 return call(funcname, [])
else
return s:_get_builtin_module(a:name)
endif
FUNCTION vital#_incsearch#Over#Exception#import()
Called 1 time
Total time: 0.000017
Self time: 0.000017
count total (s) self (s)
1 0.000016 return map({'throw': '', 'throw_cmd': '', 'set_prefix': '', 'error': ''}, 'function("s:" . v:key)')
FUNCTION vital#_incsearch#Palette#Capture#import()
Called 1 time
Total time: 0.000012
Self time: 0.000012
count total (s) self (s)
1 0.000012 return map({'extend': '', 'command': ''}, 'function("s:" . v:key)')
FUNCTION <SNR>169_default()
Called 1 time
Total time: 0.000131
Self time: 0.000013
count total (s) self (s)
1 0.000131 0.000013 return call(s:Cmdline.make, a:000, s:Cmdline)
FUNCTION <SNR>68_Space()
Called 17 times
Total time: 0.001995
Self time: 0.000476
count total (s) self (s)
17 0.001764 0.000245 if b:AutoCloseOn && s:IsEmptyPair()
call s:PushBuffer("\<Space>")
return "\<Space>\<Space>\<Left>"
else
17 0.000063 return "\<Space>"
endif
FUNCTION <SNR>119_airline_ale_count()
Called 550 times
Total time: 0.004697
Self time: 0.004697
count total (s) self (s)
550 0.004067 return a:cnt ? a:symbol. a:cnt : ''
FUNCTION <SNR>159_OnCompleteDone()
Called 55 times
Total time: 0.012522
Self time: 0.012522
count total (s) self (s)
55 0.012447 exec s:python_command "ycm_state.OnCompleteDone()"
FUNCTION ale_linters#tex#chktex#Handle()
Called 2 times
Total time: 0.014381
Self time: 0.003934
count total (s) self (s)
" Mattes lines like:
"
" stdin:499:2:24:Delete this space to maintain correct pagereferences.
" stdin:507:81:3:You should enclose the previous parenthesis with `{}'.
2 0.000004 let l:pattern = '^stdin:\(\d\+\):\(\d\+\):\(\d\+\):\(.\+\)$'
2 0.000004 let l:output = []
354 0.011155 0.000708 for l:match in ale#util#GetMatches(a:lines, l:pattern)
352 0.002802 call add(l:output, { 'lnum': l:match[1] + 0, 'col': l:match[2] + 0, 'text': l:match[4] . ' (' . (l:match[3]+0) . ')', 'type': 'W',})
352 0.000302 endfor
2 0.000003 return l:output
FUNCTION gitgutter#utility#has_fresh_changes()
Called 1 time
Total time: 0.000082
Self time: 0.000048
count total (s) self (s)
1 0.000079 0.000045 return getbufvar(s:bufnr, 'changedtick') != gitgutter#utility#getbufvar(s:bufnr, 'last_tick')
FUNCTION <SNR>206__init()
Called 1 time
Total time: 0.000413
Self time: 0.000009
count total (s) self (s)
1 0.000413 0.000009 let s:global.windo = s:Window.as_windo(s:global)
FUNCTION 184()
Called 9 times
Total time: 0.003470
Self time: 0.001533
count total (s) self (s)
9 0.000850 0.000172 if a:cmdline.is_input("<Over>(buffer-complete)") || a:cmdline.is_input("<Over>(buffer-complete-prev)")
if self.complete(a:cmdline) == -1
call s:_finish()
call a:cmdline.setchar('')
return
endif
if a:cmdline.is_input("<Over>(buffer-complete-prev)")
let s:count = len(s:complete_list) - 1
endif
call a:cmdline.setchar('')
call a:cmdline.tap_keyinput("Completion")
" elseif a:cmdline.is_input("\<Tab>", "Completion")
elseif a:cmdline.is_input("<Over>(buffer-complete)", "Completion") || a:cmdline.is_input("\<Right>", "Completion")
call a:cmdline.setchar('')
let s:count += 1
if s:count >= len(s:complete_list)
let s:count = 0
endif
elseif a:cmdline.is_input("<Over>(buffer-complete-prev)", "Completion") || a:cmdline.is_input("\<Left>", "Completion")
call a:cmdline.setchar('')
let s:count -= 1
if s:count < 0
let s:count = len(s:complete_list) - 1
endif
else
9 0.000218 0.000094 if a:cmdline.untap_keyinput("Completion")
call a:cmdline.callevent("on_char_pre")
endif
9 0.000244 0.000082 call s:_finish()
9 0.000020 return
endif
call a:cmdline.setline(s:line)
call a:cmdline.insert(s:complete_list[s:count], s:pos)
if len(s:complete_list) > 1
let &statusline = s:_as_statusline(s:complete_list, s:count)
redrawstatus
endif
if len(s:complete_list) == 1
call a:cmdline.untap_keyinput("Completion")
endif
FUNCTION incsearch#over#modules#pattern_saver#make()
Called 1 time
Total time: 0.000005
Self time: 0.000005
count total (s) self (s)
1 0.000004 return deepcopy(s:pattern_saver)
FUNCTION airline#load_theme()
Called 1 time
Total time: 0.050184
Self time: 0.000186
count total (s) self (s)
1 0.000016 if exists('*airline#themes#{g:airline_theme}#refresh')
call airline#themes#{g:airline_theme}#refresh()
endif
1 0.000010 let palette = g:airline#themes#{g:airline_theme}#palette
1 0.000668 0.000029 call airline#themes#patch(palette)
1 0.000009 if exists('g:airline_theme_patch_func')
let Fn = function(g:airline_theme_patch_func)
call Fn(palette)
endif
1 0.025682 0.000027 call airline#highlighter#load_theme()
1 0.010653 0.000040 call airline#extensions#load_theme()
1 0.013117 0.000026 call airline#update_statusline()
FUNCTION airline#extensions#prepend_to_section()
Called 2 times
Total time: 0.000082
Self time: 0.000045
count total (s) self (s)
2 0.000063 0.000026 call <sid>check_defined_section(a:name)
2 0.000016 let w:airline_section_{a:name} = a:value . w:airline_section_{a:name}
FUNCTION airline#parts#paste()
Called 547 times
Total time: 0.004544
Self time: 0.004544
count total (s) self (s)
547 0.003924 return g:airline_detect_paste && &paste ? g:airline_symbols.paste : ''
FUNCTION vital#_incsearch#Palette#Highlight#import()
Called 1 time
Total time: 0.000032
Self time: 0.000032
count total (s) self (s)
1 0.000032 return map({'capture': '', '_vital_depends': '', 'parse': '', 'group_list': '', 'set': '', 'parse_to_name': '', 'links_to': '', 'get': '', '_vital_loaded': ''}, 'function("s:" . v:key)')
FUNCTION airline#update_statusline()
Called 2 times
Total time: 0.021695
Self time: 0.000241
count total (s) self (s)
2 0.000039 0.000025 if airline#util#getwinvar(winnr(), 'airline_disabled', 0)
return
endif
2 0.000023 for nr in filter(range(1, winnr('$')), 'v:val != winnr()')
if airline#util#getwinvar(nr, 'airline_disabled', 0)
continue
endif
call setwinvar(nr, 'airline_active', 0)
let context = { 'winnr': nr, 'active': 0, 'bufnr': winbufnr(nr) }
call s:invoke_funcrefs(context, s:inactive_funcrefs)
endfor
2 0.000008 unlet! w:airline_render_left w:airline_render_right
2 0.000068 exe 'unlet! ' 'w:airline_section_'. join(s:sections, ' w:airline_section_')
2 0.000006 let w:airline_active = 1
2 0.000017 let context = { 'winnr': winnr(), 'active': 1, 'bufnr': winbufnr(winnr()) }
2 0.021477 0.000037 call s:invoke_funcrefs(context, g:airline_statusline_funcrefs)
FUNCTION gitgutter#utility#restore_shell()
Called 1 time
Total time: 0.000046
Self time: 0.000046
count total (s) self (s)
1 0.000007 if has('unix')
1 0.000007 if exists('s:shell')
1 0.000010 let &shell = s:shell
1 0.000007 let &shellcmdflag = s:shellcmdflag
1 0.000008 let &shellredir = s:shellredir
1 0.000003 endif
1 0.000002 endif
FUNCTION <SNR>154_CloseWindowIfNeeded()
Called 4 times
Total time: 0.000278
Self time: 0.000039
count total (s) self (s)
4 0.000272 0.000033 if ale#Var(a:buffer, 'keep_list_window_open') || !s:ShouldOpen(a:buffer)
4 0.000005 return
endif
try
" Only close windows if the quickfix list or loclist is completely empty,
" including errors set through other means.
if g:ale_set_quickfix
if empty(getqflist())
cclose
endif
else
let l:win_id = s:BufWinId(a:buffer)
if g:ale_set_loclist && empty(getloclist(l:win_id))
lclose
endif
endif
" Ignore 'Cannot close last window' errors.
catch /E444/
endtry
FUNCTION <SNR>159_AllowedToCompleteInBuffer()
Called 484 times
Total time: 0.058613
Self time: 0.051831
count total (s) self (s)
484 0.006007 let buffer_filetype = getbufvar( a:buffer, '&filetype' )
484 0.007638 if empty( buffer_filetype ) || getbufvar( a:buffer, '&buftype' ) ==# 'nofile' || buffer_filetype ==# 'qf'
return 0
endif
484 0.012347 0.005565 if s:DisableOnLargeFile( a:buffer )
return 0
endif
484 0.006429 let whitelist_allows = has_key( g:ycm_filetype_whitelist, '*' ) || has_key( g:ycm_filetype_whitelist, buffer_filetype )
484 0.004793 let blacklist_allows = !has_key( g:ycm_filetype_blacklist, buffer_filetype )
484 0.002808 let allowed = whitelist_allows && blacklist_allows
484 0.001427 if allowed
484 0.004870 let s:previous_allowed_buffer_number = bufnr( a:buffer )
484 0.001052 endif
484 0.001579 return allowed
FUNCTION 317()
Called 84 times
Total time: 0.006709
Self time: 0.002086
count total (s) self (s)
84 0.005742 0.001119 let window = get(a:, 1, s:Gift.uniq_winnr())
84 0.000842 return get(get(self.variables.id_list, window, {}), a:name, "")
FUNCTION <SNR>177_parse()
Called 1 time
Total time: 0.000253
Self time: 0.000226
count total (s) self (s)
1 0.000003 let highlight = a:highlight
1 0.000011 if highlight !~# '^\w\+\s\+xxx\s'
return {}
endif
1 0.000021 0.000011 let name = s:parse_to_name(a:highlight)
1 0.000003 let result = { "_name" : name }
1 0.000012 if highlight =~# '^\w\+\s\+xxx cleared'
let result.cleared = 1
return result
endif
1 0.000024 0.000007 let link = s:links_to(highlight)
1 0.000002 if link != ""
let result.link = link
return result
endif
1 0.000004 let attrs = [ "term", "cterm", "ctermfg", "ctermbg", "gui", "font", "guifg", "guibg", "guisp", ]
10 0.000010 for attr in attrs
9 0.000105 let item = matchstr(highlight, '\s' . attr . '=\zs#\?\w\+\ze')
9 0.000012 if item != ""
2 0.000004 let result[attr] = item
2 0.000001 endif
9 0.000006 endfor
1 0.000001 return result
FUNCTION ale#util#BinarySearch()
Called 426 times
Total time: 0.277056
Self time: 0.277056
count total (s) self (s)
426 0.002072 let l:min = 0
426 0.004002 let l:max = len(a:loclist) - 1
2412 0.006133 while 1
2412 0.009483 if l:max < l:min
63 0.000197 return -1
endif
2349 0.015880 let l:mid = (l:min + l:max) / 2
2349 0.019716 let l:item = a:loclist[l:mid]
" Binary search for equal buffers, equal lines, then near columns.
2349 0.011160 if l:item.bufnr < a:buffer
let l:min = l:mid + 1
elseif l:item.bufnr > a:buffer
let l:max = l:mid - 1
elseif l:item.lnum < a:line
985 0.005483 let l:min = l:mid + 1
985 0.003943 elseif l:item.lnum > a:line
1001 0.005370 let l:max = l:mid - 1
1001 0.002111 else
" This part is a small sequential search.
363 0.001703 let l:index = l:mid
" Search backwards to find the first problem on the line.
711 0.010479 while l:index > 0&& a:loclist[l:index - 1].bufnr == a:buffer&& a:loclist[l:index - 1].lnum == a:line
348 0.001794 let l:index -= 1
348 0.000834 endwhile
" Find the last problem on or before this column.
518 0.009769 while l:index < l:max&& a:loclist[l:index + 1].bufnr == a:buffer&& a:loclist[l:index + 1].lnum == a:line&& a:loclist[l:index + 1].col <= a:column
155 0.000731 let l:index += 1
155 0.000339 endwhile
363 0.001383 return l:index
endif
1986 0.004578 endwhile
FUNCTION airline#parts#readonly()
Called 547 times
Total time: 0.009762
Self time: 0.009762
count total (s) self (s)
547 0.003708 if &readonly && !filereadable(bufname('%'))
return '[noperm]'
else
547 0.002497 return &readonly ? g:airline_symbols.readonly : ''
endif
FUNCTION 391()
Called 1 time
Total time: 0.004766
Self time: 0.000244
count total (s) self (s)
1 0.000018 let view = get(a:, 1, winsaveview())
1 0.000003 try
1 0.000068 call winrestview(self._w)
1 0.002296 0.000017 call self.callevent('on_execute_pre')
1 0.000004 finally
1 0.000107 call winrestview(view)
1 0.000003 endtry
1 0.002262 0.000019 call self.callevent('on_execute')
FUNCTION <SNR>207__vital_loaded()
Called 1 time
Total time: 0.003732
Self time: 0.000009
count total (s) self (s)
1 0.000002 let s:V = a:V
1 0.003729 0.000006 let s:Buffer = a:V.import("Vim.Buffer")
FUNCTION <SNR>167_new()
Called 21 times
Total time: 0.000218
Self time: 0.000218
count total (s) self (s)
21 0.000123 let base = deepcopy(s:Vital)
21 0.000055 let base._plugin_name = a:plugin_name
21 0.000025 return base
FUNCTION <SNR>68_FlushBuffer()
Called 1 time
Total time: 0.000082
Self time: 0.000082
count total (s) self (s)
1 0.000018 let l:result = ''
1 0.000012 if exists("b:AutoCloseBuffer")
let l:len = len(b:AutoCloseBuffer)
if l:len > 0
let l:result = join(b:AutoCloseBuffer, '') . repeat("\<Left>", l:len)
let b:AutoCloseBuffer = []
call s:EraseNCharsAtCursor(l:len)
endif
endif
1 0.000006 return l:result
FUNCTION <SNR>171_split_by_keys()
Called 19 times
Total time: 0.001207
Self time: 0.000377
count total (s) self (s)
19 0.001187 0.000357 return s:_split_keystring(a:str, "\\%(\<Plug>\\|<Over>\\)(.\\{-})\\zs\\|")
FUNCTION <SNR>196__auto_cmap()
Called 1 time
Total time: 0.001857
Self time: 0.000299
count total (s) self (s)
1 0.000002 let cmaps = {}
1 0.001050 0.000009 let cmap_info = s:Keymapping.rhs_key_list("c", 0, 1)
" vital-over currently doesn't support <buffer> mappings
11 0.000024 for c in filter(cmap_info, "v:val['buffer'] ==# 0")
10 0.000759 0.000242 let cmaps[s:Keymapping.escape_special_key(c['lhs'])] = { 'noremap' : c['noremap'], 'key' : s:Keymapping.escape_special_key(s:_convert_sid(c['rhs'], c['sid'])), 'expr' : s:Keymapping.escape_special_key(c['expr']), }
10 0.000010 endfor
1 0.000001 return cmaps
FUNCTION ale#cursor#TruncatedEcho()
Called 363 times
Total time: 0.116076
Self time: 0.019731
count total (s) self (s)
363 0.002337 let l:message = a:message
" Change tabs to spaces.
363 0.004987 let l:message = substitute(l:message, "\t", ' ', 'g')
" Remove any newlines in the message.
363 0.004342 let l:message = substitute(l:message, "\n", '', 'g')
363 0.102224 0.005879 call s:EchoWithShortMess('on', l:message)
FUNCTION <SNR>204_on_char()
Called 9 times
Total time: 0.039355
Self time: 0.001744
count total (s) self (s)
9 0.000040 if a:cmdline._does_exit_from_incsearch
return
endif
9 0.001537 0.000105 let [raw_pattern, offset] = a:cmdline._parse_pattern()
9 0.000029 if raw_pattern ==# ''
call s:hi.disable_all()
nohlsearch
return
endif
" For InsertRegister
9 0.000143 0.000098 if a:cmdline.get_tap_key() ==# "\<C-r>"
let p = a:cmdline.getpos()
" Remove `"`
let raw_pattern = raw_pattern[:p-1] . raw_pattern[p+1:]
let w = winsaveview()
call cursor(line('.'), col('.') + len(a:cmdline.backward_word()))
call a:cmdline.get_module('InsertRegister').reset()
call winrestview(w)
endif
9 0.000383 0.000088 let pattern = a:cmdline._convert(raw_pattern)
" Improved Incremental cursor move!
9 0.011402 0.000120 call s:move_cursor(a:cmdline, pattern, offset)
" Improved Incremental highlighing!
" case: because matchadd() doesn't handle 'ignorecase' nor 'smartcase'
9 0.001065 0.000131 let case = incsearch#detect_case(raw_pattern)
9 0.000061 let should_separate = g:incsearch#separate_highlight && a:cmdline._flag !=# 'n'
9 0.000108 let pattern_for_hi = (a:cmdline._flag is# 'b' ? s:unescape_question_for_backward(pattern) : pattern) . case
9 0.023255 0.000200 call incsearch#highlight#incremental_highlight( pattern_for_hi, should_separate, a:cmdline._direction, [a:cmdline._w.lnum, a:cmdline._w.col])
" functional `normal! zz` after scroll for <expr> mappings
9 0.000732 0.000164 if ( a:cmdline.is_input('<Over>(incsearch-scroll-f)') || a:cmdline.is_input('<Over>(incsearch-scroll-b)'))
call winrestview({'topline': max([1, line('.') - winheight(0) / 2])})
endif
FUNCTION ale#engine#RunLinters()
Called 2 times
Total time: 0.073081
Self time: 0.001029
count total (s) self (s)
" Initialise the buffer information if needed.
2 0.000132 0.000054 let l:new_buffer = ale#engine#InitBufferInfo(a:buffer)
2 0.000314 0.000052 call s:StopCurrentJobs(a:buffer, a:should_lint_file)
2 0.003566 0.000071 call s:RemoveProblemsForDisabledLinters(a:buffer, a:linters)
" We can only clear the results if we aren't checking the buffer.
2 0.000101 0.000049 let l:can_clear_results = !ale#engine#IsCheckingBuffer(a:buffer)
8 0.000072 for l:linter in a:linters
" Only run lint_file linters if we should.
6 0.000034 if !l:linter.lint_file || a:should_lint_file
6 0.068466 0.000301 if s:RunLinter(a:buffer, l:linter)
" If a single linter ran, we shouldn't clear everything.
4 0.000025 let l:can_clear_results = 0
4 0.000008 endif
6 0.000013 else
" If we skipped running a lint_file linter still in the list,
" we shouldn't clear everything.
let l:can_clear_results = 0
endif
6 0.000015 endfor
" Clear the results if we can. This needs to be done when linters are
" disabled, or ALE itself is disabled.
2 0.000011 if l:can_clear_results
call ale#engine#SetResults(a:buffer, [])
elseif l:new_buffer
call s:AddProblemsFromOtherBuffers(a:buffer, a:linters)
endif
FUNCTION ale#path#FindNearestFile()
Called 2 times
Total time: 0.000950
Self time: 0.000950
count total (s) self (s)
2 0.000080 let l:buffer_filename = fnamemodify(bufname(a:buffer), ':p')
2 0.000815 let l:relative_path = findfile(a:filename, l:buffer_filename . ';')
2 0.000015 if !empty(l:relative_path)
return fnamemodify(l:relative_path, ':p')
endif
2 0.000007 return ''
FUNCTION <SNR>154_BufWinId()
Called 4 times
Total time: 0.000029
Self time: 0.000029
count total (s) self (s)
4 0.000027 return exists('*bufwinid') ? bufwinid(str2nr(a:buffer)) : 0
FUNCTION airline#highlighter#exec()
Called 195 times
Total time: 0.106345
Self time: 0.031315
count total (s) self (s)
195 0.000901 if pumvisible()
return
endif
195 0.000782 let colors = a:colors
195 0.000622 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
195 0.056066 0.002214 let old_hi = airline#highlighter#get_highlight(a:group)
195 0.000962 if len(colors) == 4
45 0.000191 call add(colors, '')
45 0.000057 endif
195 0.000738 if g:airline_gui_mode ==# 'gui'
let new_hi = [colors[0], colors[1], '', '', colors[4]]
else
195 0.003492 let new_hi = ['', '', printf("%s", colors[2]), printf("%s", colors[3]), colors[4]]
195 0.000385 endif
195 0.013787 0.002118 let colors = s:CheckDefined(colors)
195 0.006504 0.002230 if old_hi != new_hi || !s:hl_group_exists(a:group)
48 0.007943 0.002708 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='))
48 0.000749 exe cmd
48 0.000293 if has_key(s:hl_groups, a:group)
48 0.000266 let s:hl_groups[a:group] = colors
48 0.000077 endif
48 0.000078 endif
FUNCTION vital#_incsearch#Over#Commandline#Modules#LiteralInsert#import()
Called 1 time
Total time: 0.000009
Self time: 0.000009
count total (s) self (s)
1 0.000008 return map({'make': ''}, 'function("s:" . v:key)')
FUNCTION <SNR>146_VimOutputCallback()
Called 528 times
Total time: 0.026754
Self time: 0.013253
count total (s) self (s)
528 0.001606 let l:job = ch_getjob(a:channel)
528 0.007387 0.003322 let l:job_id = ale#job#ParseVim8ProcessID(string(l:job))
" Only call the callbacks for jobs which are valid.
528 0.002062 if l:job_id > 0 && has_key(s:job_map, l:job_id)
528 0.014417 0.004981 call ale#util#GetFunction(s:job_map[l:job_id].out_cb)(l:job_id, a:data)
528 0.000353 endif
FUNCTION <SNR>171__split_keystring()
Called 19 times
Total time: 0.000830
Self time: 0.000830
count total (s) self (s)
19 0.000806 return split(a:str, s:_engine . '\m\%(' . get(a:, 1, '') . s:_regex . '\)')
FUNCTION <SNR>183_make()
Called 1 time
Total time: 0.000005
Self time: 0.000005
count total (s) self (s)
1 0.000003 return deepcopy(s:module)
FUNCTION <SNR>145_TemporaryFilename()
Called 4 times
Total time: 0.000317
Self time: 0.000317
count total (s) self (s)
4 0.000070 let l:filename = fnamemodify(bufname(a:buffer), ':t')
4 0.000026 if empty(l:filename)
" If the buffer's filename is empty, create a dummy filename.
let l:ft = getbufvar(a:buffer, '&filetype')
let l:filename = 'file' . ale#filetypes#GuessExtension(l:ft)
endif
" Create a temporary filename, <temp_dir>/<original_basename>
" The file itself will not be created by this function.
4 0.000117 return tempname() . (has('win32') ? '\' : '/') . l:filename
FUNCTION <SNR>137_ApplyPartialTimer()
Called 4 times
Total time: 0.016078
Self time: 0.000090
count total (s) self (s)
4 0.000050 let [l:Callback, l:args] = remove(s:partial_timers, a:timer_id)
4 0.016025 0.000037 call call(l:Callback, [a:timer_id] + l:args)
FUNCTION <SNR>196_make_vim_cmdline_mapping()
Called 1 time
Total time: 0.000006
Self time: 0.000006
count total (s) self (s)
1 0.000004 return deepcopy(s:vim_cmdline_mapping)
FUNCTION <SNR>168_make_default()
Called 1 time
Total time: 0.000140
Self time: 0.000009
count total (s) self (s)
1 0.000140 0.000009 return call(s:Maker.default, a:000, s:Maker)
FUNCTION <SNR>195_make_special_chars()
Called 1 time
Total time: 0.000024
Self time: 0.000013
count total (s) self (s)
1 0.000018 0.000007 let module = s:make([])
1 0.000002 function! module.is_no_insert(char)
return char2nr(a:char) == 128 || char2nr(a:char) < 27
endfunction
1 0.000001 return module
FUNCTION vital#_incsearch#Over#Commandline#Modules#KeyMapping#import()
Called 1 time
Total time: 0.000019
Self time: 0.000019
count total (s) self (s)
1 0.000018 return map({'_vital_depends': '', 'make_emacs': '', 'make_vim_cmdline_mapping': '', '_vital_loaded': ''}, 'function("s:" . v:key)')
FUNCTION <SNR>133_get_prev_group()
Called 18 times
Total time: 0.000342
Self time: 0.000342
count total (s) self (s)
18 0.000064 let x = a:i - 1
20 0.000044 while x >= 0
18 0.000075 let group = a:sections[x][0]
18 0.000052 if group != '' && group != '|'
16 0.000031 return group
endif
2 0.000006 let x = x - 1
2 0.000003 endwhile
2 0.000004 return ''
FUNCTION <SNR>176__vital_loaded()
Called 1 time
Total time: 0.000003
Self time: 0.000003
count total (s) self (s)
1 0.000002 let s:V = a:V
FUNCTION vital#_incsearch#Over#Commandline#Modules#ExceptionMessage#import()
Called 1 time
Total time: 0.000009
Self time: 0.000009
count total (s) self (s)
1 0.000008 return map({'make': ''}, 'function("s:" . v:key)')
FUNCTION ale#highlight#RemoveHighlights()
Called 4 times
Total time: 0.007104
Self time: 0.007104
count total (s) self (s)
712 0.001712 for l:match in getmatches()
708 0.002306 if l:match.group =~# '^ALE'
704 0.001716 call matchdelete(l:match.id)
704 0.000480 endif
708 0.000476 endfor
FUNCTION ale#util#StartPartialTimer()
Called 4 times
Total time: 0.000065
Self time: 0.000065
count total (s) self (s)
4 0.000027 let l:timer_id = timer_start(a:delay, function('s:ApplyPartialTimer'))
4 0.000023 let s:partial_timers[l:timer_id] = [a:callback, a:args]
4 0.000006 return l:timer_id
FUNCTION 171()
Called 26 times
Total time: 0.000718
Self time: 0.000718
count total (s) self (s)
26 0.000707 return filter(copy(self.variables.slots), a:expr)
FUNCTION incsearch#magic()
Called 20 times
Total time: 0.000253
Self time: 0.000253
count total (s) self (s)
20 0.000092 let m = g:incsearch#magic
20 0.000134 return (len(m) == 2 && m =~# '\\[mMvV]' ? m : '')
FUNCTION <SNR>133_get_seperator()
Called 8 times
Total time: 0.009636
Self time: 0.000167
count total (s) self (s)
8 0.003065 0.000063 if s:should_change_group(a:prev_group, a:group)
8 0.006560 0.000093 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 <SNR>129_hl_group_exists()
Called 147 times
Total time: 0.004274
Self time: 0.004274
count total (s) self (s)
147 0.001031 if !hlexists(a:group)
return 0
elseif empty(synIDattr(hlID(a:group), 'fg'))
return 0
endif
147 0.000332 return 1
FUNCTION <SNR>68_GetCharBehind()
Called 17 times
Total time: 0.000414
Self time: 0.000414
count total (s) self (s)
17 0.000106 if col('.') == 1
return "\0"
endif
17 0.000198 return strpart(getline('.'), col('.') - (1 + a:len), 1)
FUNCTION <SNR>138_GetLinterNames()
Called 2 times
Total time: 0.000205
Self time: 0.000205
count total (s) self (s)
8 0.000063 for l:dict in [ get(b:, 'ale_linters', {}), g:ale_linters, s:default_ale_linters,]
6 0.000046 if has_key(l:dict, a:original_filetype)
return l:dict[a:original_filetype]
endif
6 0.000013 endfor
2 0.000006 return 'all'
FUNCTION ale#util#LocItemCompare()
Called 4972 times
Total time: 0.109048
Self time: 0.109048
count total (s) self (s)
4972 0.009091 if a:left.bufnr < a:right.bufnr
return -1
endif
4972 0.007587 if a:left.bufnr > a:right.bufnr
return 1
endif
4972 0.006165 if a:left.bufnr == -1
if a:left.filename < a:right.filename
return -1
endif
if a:left.filename > a:right.filename
return 1
endif
endif
4972 0.007762 if a:left.lnum < a:right.lnum
3266 0.003476 return -1
endif
1706 0.002573 if a:left.lnum > a:right.lnum
804 0.000824 return 1
endif
902 0.001401 if a:left.col < a:right.col
470 0.000477 return -1
endif
432 0.000647 if a:left.col > a:right.col
100 0.000105 return 1
endif
332 0.000323 return 0
FUNCTION <SNR>159_OnCursorMovedNormalMode()
Called 446 times
Total time: 0.141687
Self time: 0.079023
count total (s) self (s)
446 0.067695 0.005031 if !s:AllowedToCompleteInCurrentBuffer()
return
endif
446 0.070582 exec s:python_command "ycm_state.OnCursorMoved()"
FUNCTION vital#incsearch#import()
Called 3 times
Total time: 0.008732
Self time: 0.000049
count total (s) self (s)
3 0.000006 if !exists('s:V')
1 0.000018 0.000008 let s:V = s:new(s:plugin_name)
1 0.000001 endif
3 0.008697 0.000024 return call(s:V.import, a:000, s:V)
FUNCTION incsearch#autocmd#auto_nohlsearch()
Called 1 time
Total time: 0.000014
Self time: 0.000014
count total (s) self (s)
" NOTE: see this value inside this function in order to toggle auto
" :nohlsearch feature easily with g:incsearch#autocmd#auto_nohlsearch option
1 0.000009 if !g:incsearch#auto_nohlsearch | return '' | endif
return s:auto_nohlsearch(a:nest)
FUNCTION 121()
Called 1 time
Total time: 0.576607
Self time: 0.000407
count total (s) self (s)
1 0.000001 try
1 0.000540 0.000005 call self.__init()
1 0.003617 0.000012 call self.callevent("on_enter")
1 0.000015 0.000011 call self.__input(get(a:, 1, ""))
1 0.010386 0.000004 call self.draw()
9 0.000120 0.000078 while !self.is_exit()
9 0.000014 try
9 0.521904 0.000068 if self.__update()
1 0.000003 break
endif
8 0.000014 catch
call self.callevent("on_exception")
endtry
8 0.000023 endwhile
1 0.000003 catch
echohl ErrorMsg | echom v:throwpoint . " " . v:exception | echohl None
let self.variables.exit_code = -1
finally
1 0.000522 0.000020 call self.__finish()
1 0.039304 0.000017 call self.callevent("on_leave")
1 0.000003 endtry
1 0.000020 0.000013 return self.exit_code()
FUNCTION gitgutter#utility#full_path_to_directory_of_file()
Called 1 time
Total time: 0.000025
Self time: 0.000025
count total (s) self (s)
1 0.000023 return fnamemodify(s:file, ':p:h')
FUNCTION 124()
Called 27 times
Total time: 0.000127
Self time: 0.000127
count total (s) self (s)
27 0.000101 return self.variables.exit
FUNCTION ale#highlight#CreatePositions()
Called 704 times
Total time: 0.004400
Self time: 0.004400
count total (s) self (s)
704 0.001291 if a:line >= a:end_line
" For single lines, just return the one position.
704 0.002462 return [[[a:line, a:col, a:end_col - a:col + 1]]]
endif
" Get positions from the first line at the first column, up to a large
" integer for highlighting up to the end of the line, followed by
" the lines in-between, for highlighting entire lines, and
" a highlight for the last line, up to the end column.
let l:all_positions = [[a:line, a:col, s:MAX_COL_SIZE]] + range(a:line + 1, a:end_line - 1) + [[a:end_line, 1, a:end_col]]
return map( range(0, len(l:all_positions) - 1, s:MAX_POS_VALUES), 'l:all_positions[v:val : v:val + s:MAX_POS_VALUES - 1]',)
FUNCTION <SNR>207_as_windo()
Called 2 times
Total time: 0.000773
Self time: 0.000773
count total (s) self (s)
2 0.000004 let windo = {}
2 0.000004 let windo.obj = a:base
46 0.000125 for [key, Value] in items(a:base)
44 0.000175 if type(function("tr")) == type(Value)
42 0.000294 execute "function! windo.". key. "(...)\n" " return s:windo(self.obj." . key . ", a:000, self.obj)\n" "endfunction"
42 0.000033 endif
44 0.000055 unlet Value
44 0.000027 endfor
2 0.000002 return windo
FUNCTION <SNR>129_CheckDefined()
Called 195 times
Total time: 0.011669
Self time: 0.011669
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
195 0.001540 if !exists("g:airline#highlighter#normal_fg_hi")
let g:airline#highlighter#normal_fg_hi = synIDattr(synIDtrans(hlID('Normal')), 'fg', 'cterm')
endif
195 0.001512 if empty(g:airline#highlighter#normal_fg_hi) || g:airline#highlighter#normal_fg_hi < 0
return a:colors
endif
309 0.001199 for val in a:colors
309 0.001619 if !empty(val) && val !=# 'NONE'
195 0.000628 return a:colors
endif
114 0.000178 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 186()
Called 1 time
Total time: 0.000040
Self time: 0.000017
count total (s) self (s)
1 0.000034 0.000011 call s:_finish()
1 0.000004 unlet! s:complete
FUNCTION <SNR>163_emulate_search_error()
Called 1 time
Total time: 0.002352
Self time: 0.000319
count total (s) self (s)
1 0.000018 let from = get(a:, 1, winsaveview())
1 0.000009 let keyseq = (a:direction == s:DIRECTION.forward ? '/' : '?')
1 0.000006 let old_errmsg = v:errmsg
1 0.000005 let v:errmsg = ''
" NOTE:
" - XXX: Handle `n` and `N` preparation with s:silent_after_search()
" - silent!: Do not show error and warning message, because it also
" echo v:throwpoint for error and save messages in message-history
" - Unlike v:errmsg, v:warningmsg doesn't set if it use :silent!
" Get first error
1 0.001065 0.000019 silent! call incsearch#execute_search(keyseq . "\<CR>")
1 0.000066 call winrestview(from)
1 0.000006 if g:incsearch#do_not_save_error_message_history
if v:errmsg !=# ''
call s:Error(v:errmsg)
else
let v:errmsg = old_errmsg
endif
else
" NOTE: show more than two errors e.g. `/\za`
1 0.000006 let last_error = v:errmsg
1 0.000002 try
" Do not use silent! to show warning
1 0.001006 0.000019 call incsearch#execute_search(keyseq . "\<CR>")
1 0.000005 catch /^Vim\%((\a\+)\)\=:E/
let first_error = matchlist(v:exception, '\v^Vim%(\(\a+\))=:(E.*)$')[1]
call s:Error(first_error, 'echom')
if last_error !=# '' && last_error !=# first_error
call s:Error(last_error, 'echom')
endif
finally
1 0.000065 call winrestview(from)
1 0.000003 endtry
1 0.000006 if v:errmsg ==# ''
1 0.000006 let v:errmsg = old_errmsg
1 0.000002 endif
1 0.000002 endif
FUNCTION <SNR>134_get_section()
Called 22 times
Total time: 0.001355
Self time: 0.001202
count total (s) self (s)
22 0.000118 if has_key(s:section_truncate_width, a:key)
16 0.000086 if winwidth(a:winnr) < s:section_truncate_width[a:key]
return ''
endif
16 0.000020 endif
22 0.000073 let spc = g:airline_symbols.space
22 0.000139 if !exists('g:airline_section_{a:key}')
return ''
endif
22 0.000382 0.000229 let text = airline#util#getwinvar(a:winnr, 'airline_section_'.a:key, g:airline_section_{a:key})
22 0.000212 let [prefix, suffix] = [get(a:000, 0, '%('.spc), get(a:000, 1, spc.'%)')]
22 0.000125 return empty(text) ? '' : prefix.text.suffix
FUNCTION 246()
Called 1 time
Total time: 0.000215
Self time: 0.000029
count total (s) self (s)
1 0.000007 let s:cmdline = a:cmdline
1 0.000204 0.000018 call s:doautocmd_user(self.prefix, self.prefix . 'ExecutePre')
FUNCTION ale#statusline#Update()
Called 4 times
Total time: 0.018353
Self time: 0.018324
count total (s) self (s)
4 0.000021 if !exists('g:ale_buffer_info') || !has_key(g:ale_buffer_info, a:buffer)
return
endif
4 0.000800 let l:loclist = filter(copy(a:loclist), 'v:val.bufnr == a:buffer')
4 0.000058 0.000029 let l:count = s:CreateCountDict()
4 0.000012 let l:count.total = len(l:loclist)
1060 0.001107 for l:entry in l:loclist
1056 0.001469 if l:entry.type is# 'W'
1056 0.002311 if get(l:entry, 'sub_type', '') is# 'style'
let l:count.style_warning += 1
else
1056 0.001483 let l:count.warning += 1
1056 0.000718 endif
1056 0.001155 elseif l:entry.type is# 'I'
let l:count.info += 1
elseif get(l:entry, 'sub_type', '') is# 'style'
let l:count.style_error += 1
else
let l:count.error += 1
endif
1056 0.000710 endfor
" Set keys for backwards compatibility.
4 0.000016 let l:count[0] = l:count.error + l:count.style_error
4 0.000016 let l:count[1] = l:count.total - l:count[0]
4 0.000017 let g:ale_buffer_info[a:buffer].count = l:count
FUNCTION <SNR>174_getchar()
Called 9 times
Total time: 0.001305
Self time: 0.001305
count total (s) self (s)
9 0.000051 let mode = get(a:, 1, 0)
9 0.000020 while 1
" Workaround for https://github.com/osyo-manga/vital-over/issues/53
9 0.000011 try
9 0.000619 let char = call("getchar", a:000)
9 0.000088 catch /^Vim:Interrupt$/
let char = 3 " <C-c>
endtry
" Workaround for the <expr> mappings
9 0.000193 if string(char) !=# "\x80\xfd`"
9 0.000143 return mode == 1 ? !!char : type(char) == type(0) ? nr2char(char) : char
endif
endwhile
FUNCTION <SNR>208__vital_loaded()
Called 1 time
Total time: 0.003042
Self time: 0.000018
count total (s) self (s)
1 0.000002 let s:V = a:V
1 0.001294 0.000009 let s:P = s:V.import('Prelude')
1 0.001746 0.000007 let s:G = s:V.import('Vim.Guard')
FUNCTION incsearch#_go()
Called 1 time
Total time: 0.622356
Self time: 0.000251
count total (s) self (s)
1 0.000012 0.000006 if s:U.is_visual(a:config.mode) && !a:config.is_expr
normal! gv
endif
1 0.035557 0.000060 let cli = incsearch#cli#make(a:config)
1 0.576766 0.000015 let input = s:get_input(cli)
1 0.000004 if cli._does_exit_from_incsearch
" Outer incsearch-plugin handle it so do not something in paticular
return cli._return_cmd
else
" After getting input, generate command, take aftercare, and return
" command.
1 0.000017 let l:F = function(cli._flag is# 'n' ? 's:stay' : 's:search')
1 0.006270 0.000043 let cmd = l:F(cli, input)
1 0.000006 if !a:config.is_expr
1 0.000007 let should_set_jumplist = (cli._flag !=# 'n')
1 0.003675 0.000051 call s:set_search_related_stuff(cli, cmd, should_set_jumplist)
1 0.000006 if a:config.mode is# 'no'
call s:set_vimrepeat(cmd)
endif
1 0.000002 endif
1 0.000004 return cmd
endif
FUNCTION vital#_incsearch#Over#Commandline#Modules#Cancel#import()
Called 1 time
Total time: 0.000009
Self time: 0.000009
count total (s) self (s)
1 0.000009 return map({'make': ''}, 'function("s:" . v:key)')
FUNCTION <SNR>197_parse_lhs()
Called 11 times
Total time: 0.000292
Self time: 0.000292
count total (s) self (s)
11 0.000043 let mode = get(a:, 1, '[!nvoicsxl]')
" NOTE: :map! Surpport : https://github.com/osyo-manga/vital-palette/issues/4
11 0.000061 if get(a:, 1, "") =~# '[!ci]'
11 0.000021 let mode = '[!ci]'
11 0.000010 endif
11 0.000143 return matchstr(a:text, mode . '\{1,3\}\s*\zs\S\{-}\ze\s\+')
FUNCTION airline#parts#spell()
Called 547 times
Total time: 0.025195
Self time: 0.025195
count total (s) self (s)
547 0.014330 let spelllang = g:airline_detect_spelllang ? printf(" [%s]", toupper(substitute(&spelllang, ',', '/', 'g'))) : ''
547 0.003130 if g:airline_detect_spell && &spell
547 0.002600 if winwidth(0) >= 90
547 0.003524 return g:airline_symbols.spell . spelllang
elseif winwidth(0) >= 70
return g:airline_symbols.spell
else
return split(g:airline_symbols.spell, '\zs')[0]
endif
endif
return ''
FUNCTION <SNR>217_Move()
Called 444 times
Total time: 0.359377
Self time: 0.359377
count total (s) self (s)
" Note: There is no inversion of the regular expression character class
" 'keyword character' (\k). We need an inversion "non-keyword" defined as
" "any non-whitespace character that is not a keyword character" (e.g.
" [!@#$%^&*()]). This can be specified via a non-whitespace character in
" whose place no keyword character matches (\k\@!\S).
"echo "count is " . a:count
444 0.002951 let l:i = 0
888 0.004760 while l:i < a:count
444 0.002831 if a:direction == 'e' || a:direction == 'ge'
" "Forward to end" motion.
" number | ACRONYM followed by CamelCase or number | CamelCase | underscore_notation | non-keyword | word
let l:direction = (a:direction == 'e' ? a:direction : 'be')
call search(s:forward_to_end, 'W' . l:direction)
" Note: word must be defined as '\k\>'; '\>' on its own somehow
" dominates over the previous branch. Plus, \k must exclude the
" underscore, or a trailing one will be incorrectly moved over:
" '\%(_\@!\k\)'.
if a:mode == 'o'
" Note: Special additional treatment for operator-pending mode
" "forward to end" motion.
" The difference between normal mode, operator-pending and visual
" mode is that in the latter two, the motion must go _past_ the
" final "word" character, so that all characters of the "word" are
" selected. This is done by appending a 'l' motion after the
" search for the next "word".
"
" In operator-pending mode, the 'l' motion only works properly
" at the end of the line (i.e. when the moved-over "word" is at
" the end of the line) when the 'l' motion is allowed to move
" over to the next line. Thus, the 'l' motion is added
" temporarily to the global 'whichwrap' setting.
" Without this, the motion would leave out the last character in
" the line. I've also experimented with temporarily setting
" "set virtualedit=onemore" , but that didn't work.
let l:save_ww = &whichwrap
set whichwrap+=l
normal! l
let &whichwrap = l:save_ww
endif
else
" Forward (a:direction == '') and backward (a:direction == 'b')
" motion.
444 0.004025 let l:direction = (a:direction == 'w' ? '' : a:direction)
" word | empty line | non-keyword after whitespaces | non-whitespace after word | number | lowercase folowed by capital letter or number | ACRONYM followed by CamelCase or number | CamelCase | ACRONYM | underscore followed by ACRONYM, Camel, lowercase or number
444 0.268602 call search(s:forward_to_next, 'W' . l:direction)
" Note: word must be defined as '\<\D' to avoid that a word like
" 1234Test is moved over as [1][2]34[T]est instead of [1]234[T]est
" because \< matches with zero width, and \d\+ will then start
" matching '234'. To fix that, we make \d\+ be solely responsible
" for numbers by taken this away from \< via \<\D. (An alternative
" would be to replace \d\+ with \D\%#\zs\d\+, but that one is more
" complex.) All other branches are not affected, because they match
" multiple characters and not the same character multiple times.
444 0.001199 endif
444 0.004184 let l:i = l:i + 1
444 0.001727 endwhile
FUNCTION ale#Lint()
Called 2 times
Total time: 0.076711
Self time: 0.000333
count total (s) self (s)
2 0.000020 if a:0 > 1
" Use the buffer number given as the optional second argument.
let l:buffer = a:2
elseif a:0 > 0 && a:1 == s:lint_timer
" Use the buffer number for the buffer linting was queued for.
let l:buffer = s:queued_buffer_number
else
" Use the current buffer number.
2 0.000022 let l:buffer = bufnr('')
2 0.000005 endif
2 0.076592 0.000214 return ale#CallWithCooldown( 'dont_lint_until', function('s:ALELintImpl'), [l:buffer],)
FUNCTION ale#linter#GetAll()
Called 2 times
Total time: 0.000250
Self time: 0.000250
count total (s) self (s)
2 0.000014 let l:combined_linters = []
4 0.000020 for l:filetype in a:filetypes
" Load linter defintions from files if we haven't loaded them yet.
2 0.000020 if !has_key(s:linters, l:filetype)
execute 'silent! runtime! ale_linters/' . l:filetype . '/*.vim'
" Always set an empty List for the loaded linters if we don't find
" any. This will prevent us from executing the runtime command
" many times, redundantly.
if !has_key(s:linters, l:filetype)
let s:linters[l:filetype] = []
endif
endif
2 0.000042 call extend(l:combined_linters, get(s:linters, l:filetype, []))
2 0.000006 endfor
2 0.000011 return l:combined_linters
FUNCTION 190()
Called 9 times
Total time: 0.004585
Self time: 0.001514
count total (s) self (s)
9 0.000415 0.000096 if a:cmdline.is_input("\<Right>")
call a:cmdline.line.next()
call a:cmdline.setchar('')
elseif a:cmdline.is_input("\<Left>")
call a:cmdline.line.prev()
call a:cmdline.setchar('')
elseif a:cmdline.is_input("\<C-b>") || a:cmdline.is_input("\<Home>")
call a:cmdline.setline(0)
call a:cmdline.setchar('')
elseif a:cmdline.is_input("\<C-e>") || a:cmdline.is_input("\<End>")
call a:cmdline.setline(a:cmdline.line.length())
call a:cmdline.setchar('')
elseif a:cmdline.is_input("\<C-Left>") || a:cmdline.is_input("\<S-Left>")
call a:cmdline.setline(strridx(a:cmdline.backward()[:-2], ' ') + 1)
call a:cmdline.setchar('')
elseif a:cmdline.is_input("\<C-Right>") || a:cmdline.is_input("\<S-Right>")
let p = stridx(a:cmdline.forward()[1:], ' ')
call a:cmdline.setline(p != -1 ? a:cmdline.line.pos() + p + 2 : a:cmdline.line.length())
call a:cmdline.setchar('')
endif
FUNCTION vital#_incsearch#Gift#Window#import()
Called 1 time
Total time: 0.000058
Self time: 0.000058
count total (s) self (s)
1 0.000057 return map({'flatten': '', 'tabpagewinnr_list': '', 'execute': '', 'close': '', 'numbering': '', 'set_prefix': '', '_vital_depends': '', 'exists': '', 'jump': '', 'setvar': '', 'bufnr': '', 'uniq_nr': '', 'make_uniq_nr': '', 'tabpagewinnr': '', 'getvar': '', '_vital_loaded': ''}, 'function("s:" . v:key)')
FUNCTION ale#linter#ResolveFiletype()
Called 2 times
Total time: 0.000458
Self time: 0.000186
count total (s) self (s)
2 0.000323 0.000051 let l:filetype = s:GetAliasedFiletype(a:original_filetype)
2 0.000020 if type(l:filetype) != type([])
2 0.000106 return [l:filetype]
endif
return l:filetype
FUNCTION <SNR>160_get_decimal_group()
Called 37 times
Total time: 0.000418
Self time: 0.000418
count total (s) self (s)
37 0.000318 if match(v:lang, '\v\cC|en') > -1
37 0.000054 return ','
elseif match(v:lang, '\v\cde|dk|fr|pt') > -1
return '.'
endif
return ''
FUNCTION <SNR>197_capture_list()
Called 1 time
Total time: 0.000363
Self time: 0.000060
count total (s) self (s)
1 0.000003 let mode = get(a:, 1, "")
1 0.000359 0.000056 return filter(split(s:capture(mode), "\n"), "s:_keymapping(v:val)")
FUNCTION vital#_incsearch#Over#Commandline#Modules#NoInsert#import()
Called 1 time
Total time: 0.000012
Self time: 0.000012
count total (s) self (s)
1 0.000012 return map({'make_special_chars': '', 'make': ''}, 'function("s:" . v:key)')
FUNCTION <SNR>159_PollFileParseResponse()
Called 1 time
Total time: 0.000255
Self time: 0.000111
count total (s) self (s)
1 0.000150 0.000006 if !s:Pyeval( "ycm_state.FileParseRequestReady()" )
let s:pollers.file_parse_response.id = timer_start( s:pollers.file_parse_response.wait_milliseconds, function( 's:PollFileParseResponse' ) )
return
endif
1 0.000098 exec s:python_command "ycm_state.HandleFileParseRequest()"
FUNCTION 274()
Called 9 times
Total time: 0.000052
Self time: 0.000052
count total (s) self (s)
9 0.000040 return self._cmaps
FUNCTION 208()
Called 9 times
Total time: 0.000047
Self time: 0.000047
count total (s) self (s)
9 0.000026 return self.value
FUNCTION <SNR>184__redraw()
Called 9 times
Total time: 0.375059
Self time: 0.374676
count total (s) self (s)
9 0.000429 0.000203 let left = a:cmdline.get_prompt() . a:cmdline.getline() . (empty(a:cmdline.line.pos_char()) ? " " : "")
9 0.000057 let width = len(left) + 1
9 0.000105 0.000067 if a:cmdline.get_suffix() != ""
let width += len(s:suffix(left, a:cmdline.get_suffix())) - 1
endif
9 0.000057 if &columns >= width && &columns <= s:old_width && s:old_width >= width
redraw
normal! :
elseif &columns <= width
normal! :
else
9 0.373681 redraw
9 0.000015 endif
9 0.000036 let s:old_width = width
9 0.000162 0.000090 call s:cmdheight.save()
9 0.000175 0.000128 let height = max([(width - 1) / (&columns) + 1, s:cmdheight.get()])
9 0.000034 if height > &cmdheight || &cmdheight > height
let &cmdheight = height
redraw
endif
FUNCTION <SNR>159_OnInsertLeave()
Called 1 time
Total time: 0.014497
Self time: 0.008157
count total (s) self (s)
1 0.000202 0.000017 if !s:AllowedToCompleteInCurrentBuffer()
return
endif
1 0.000014 call timer_stop( s:pollers.completion.id )
1 0.000009 let s:force_semantic = 0
1 0.000013 let s:completion = s:default_completion
1 0.006185 0.000030 call s:OnFileReadyToParse()
1 0.008009 exec s:python_command "ycm_state.OnInsertLeave()"
1 0.000012 if g:ycm_autoclose_preview_window_after_completion || g:ycm_autoclose_preview_window_after_insertion
call s:ClosePreviewWindowIfNeeded()
endif
FUNCTION vital#_incsearch#Palette#Keymapping#import()
Called 1 time
Total time: 0.000036
Self time: 0.000036
count total (s) self (s)
1 0.000035 return map({'capture': '', '_vital_depends': '', 'escape_special_key': '', 'rhs_key_list': '', 'parse_lhs_list': '', 'lhs_key_list': '', 'capture_list': '', 'parse_lhs': '', '_vital_loaded': ''}, 'function("s:" . v:key)')
FUNCTION 101()
Called 18 times
Total time: 0.000085
Self time: 0.000085
count total (s) self (s)
18 0.000073 return self.variables.enable_keymapping
FUNCTION <SNR>167_plugin_name()
Called 39 times
Total time: 0.000086
Self time: 0.000086
count total (s) self (s)
39 0.000075 return self._plugin_name
FUNCTION ale#util#InSandbox()
Called 885 times
Total time: 0.027584
Self time: 0.027584
count total (s) self (s)
885 0.002983 try
885 0.005796 function! s:SandboxCheck() abort
endfunction
885 0.003858 catch /^Vim\%((\a\+)\)\=:E48/
" E48 is the sandbox error.
return 1
endtry
885 0.002731 return 0
FUNCTION airline#parts#crypt()
Called 547 times
Total time: 0.007393
Self time: 0.007393
count total (s) self (s)
547 0.006667 return g:airline_detect_crypt && exists("+key") && !empty(&key) ? g:airline_symbols.crypt : ''
FUNCTION 211()
Called 1 time
Total time: 0.000034
Self time: 0.000014
count total (s) self (s)
1 0.000032 0.000012 call s:cmdheight.restore()
FUNCTION 209()
Called 9 times
Total time: 0.376942
Self time: 0.001115
count total (s) self (s)
9 0.000149 0.000085 if empty(a:cmdline.line.pos_char())
9 0.000060 let cursor = "echohl " . a:cmdline.highlights.cursor . " | echon ' '"
9 0.000017 else
let cursor = "echohl " . a:cmdline.highlights.cursor_on . " | " . s:_as_echon(a:cmdline.line.pos_char())
endif
9 0.000027 let suffix = ""
9 0.000115 0.000073 if a:cmdline.get_suffix() != ""
let suffix = s:_as_echon(s:suffix(a:cmdline.get_prompt() . a:cmdline.getline() . repeat(" ", empty(a:cmdline.line.pos_char())), a:cmdline.get_suffix()))
endif
9 0.001148 0.000486 let self.draw_command = join([ "echohl " . a:cmdline.highlights.prompt, s:_as_echon(a:cmdline.get_prompt()), "echohl NONE", s:_as_echon(a:cmdline.backward()), cursor, "echohl NONE", s:_as_echon(a:cmdline.forward()), suffix, ], " | ")
9 0.375157 0.000098 call s:_redraw(a:cmdline)
FUNCTION 217()
Called 9 times
Total time: 0.000836
Self time: 0.000272
count total (s) self (s)
9 0.000657 0.000145 if a:cmdline.is_input("\<CR>") || a:cmdline.is_input("\<NL>")
1 0.000046 0.000012 call a:cmdline.setchar('')
1 0.000036 0.000018 call a:cmdline.exit(self.exit_code)
1 0.000002 endif
FUNCTION ale#util#ClockMilliseconds()
Called 875 times
Total time: 0.015605
Self time: 0.015605
count total (s) self (s)
875 0.014024 return float2nr(reltimefloat(reltime()) * 1000)
FUNCTION <SNR>165_keymap()
Called 1 time
Total time: 0.000006
Self time: 0.000006
count total (s) self (s)
1 0.000005 return extend(copy(s:default_keymappings), g:incsearch_cli_key_mappings)
FUNCTION vital#_incsearch#Over#Commandline#Base#import()
Called 1 time
Total time: 0.000020
Self time: 0.000020
count total (s) self (s)
1 0.000020 return map({'_vital_depends': '', 'make_plain': '', 'is_input_waiting': '', 'make': '', '_vital_loaded': ''}, 'function("s:" . v:key)')
FUNCTION <SNR>54_invoke_funcrefs()
Called 2 times
Total time: 0.021440
Self time: 0.000133
count total (s) self (s)
2 0.000121 0.000023 let builder = airline#builder#new(a:context)
2 0.003825 0.000030 let err = airline#util#exec_funcrefs(a:funcrefs + s:core_funcrefs, builder, a:context)
2 0.000003 if err == 1
2 0.017442 0.000028 let a:context.line = builder.build()
2 0.000017 let s:contexts[a:context.winnr] = a:context
2 0.000022 call setwinvar(a:context.winnr, '&statusline', '%!airline#statusline('.a:context.winnr.')')
2 0.000002 endif
FUNCTION airline#extensions#load_theme()
Called 1 time
Total time: 0.010613
Self time: 0.000099
count total (s) self (s)
1 0.010612 0.000098 call airline#util#exec_funcrefs(s:ext._theme_funcrefs, g:airline#themes#{g:airline_theme}#palette)
FUNCTION ale#util#GetLineCount()
Called 4 times
Total time: 0.001136
Self time: 0.001136
count total (s) self (s)
4 0.001130 return len(getbufline(a:buffer, 1, '$'))
FUNCTION <SNR>159_InsideCommentOrString()
Called 37 times
Total time: 0.057341
Self time: 0.057341
count total (s) self (s)
" Has to be col('.') -1 because col('.') doesn't exist at this point. We are
" in insert mode when this func is called.
37 0.056668 let syntax_group = synIDattr( synIDtrans( synID( line( '.' ), col( '.' ) - 1, 1 ) ), 'name')
37 0.000160 if stridx(syntax_group, 'Comment') > -1
return 1
endif
37 0.000114 if stridx(syntax_group, 'String') > -1
return 2
endif
37 0.000050 return 0
FUNCTION ale#engine#FixLocList()
Called 4 times
Total time: 0.039571
Self time: 0.038331
count total (s) self (s)
4 0.000009 let l:bufnr_map = {}
4 0.000006 let l:new_loclist = []
" Some errors have line numbers beyond the end of the file,
" so we need to adjust them so they set the error at the last line
" of the file instead.
4 0.001164 0.000028 let l:last_line_number = ale#util#GetLineCount(a:buffer)
532 0.000633 for l:old_item in a:loclist
" Copy the loclist item with some default values and corrections.
"
" line and column numbers will be converted to numbers.
" The buffer will default to the buffer being checked.
" The vcol setting will default to 0, a byte index.
" The error type will default to 'E' for errors.
" The error number will default to -1.
"
" The line number and text are the only required keys.
"
" The linter_name will be set on the errors so it can be used in
" output, filtering, etc..
528 0.007748 let l:item = { 'bufnr': a:buffer, 'text': l:old_item.text, 'lnum': str2nr(l:old_item.lnum), 'col': str2nr(get(l:old_item, 'col', 0)), 'vcol': get(l:old_item, 'vcol', 0), 'type': get(l:old_item, 'type', 'E'), 'nr': get(l:old_item, 'nr', -1), 'linter_name': a:linter_name,}
528 0.001937 if has_key(l:old_item, 'filename')&& !ale#path#IsTempName(l:old_item.filename)
" Use the filename given.
" Temporary files are assumed to be for this buffer,
" and the filename is not included then, because it looks bad
" in the loclist window.
let l:filename = l:old_item.filename
let l:item.filename = l:filename
if has_key(l:old_item, 'bufnr')
" If a buffer number is also given, include that too.
" If Vim detects that he buffer number is valid, it will
" be used instead of the filename.
let l:item.bufnr = l:old_item.bufnr
elseif has_key(l:bufnr_map, l:filename)
" Get the buffer number from the map, which can be faster.
let l:item.bufnr = l:bufnr_map[l:filename]
else
" Look up the buffer number.
let l:item.bufnr = bufnr(l:filename)
let l:bufnr_map[l:filename] = l:item.bufnr
endif
elseif has_key(l:old_item, 'bufnr')
let l:item.bufnr = l:old_item.bufnr
endif
528 0.001124 if has_key(l:old_item, 'detail')
let l:item.detail = l:old_item.detail
endif
" Pass on a end_col key if set, used for highlights.
528 0.001088 if has_key(l:old_item, 'end_col')
let l:item.end_col = str2nr(l:old_item.end_col)
endif
528 0.001130 if has_key(l:old_item, 'end_lnum')
let l:item.end_lnum = str2nr(l:old_item.end_lnum)
endif
528 0.001088 if has_key(l:old_item, 'sub_type')
let l:item.sub_type = l:old_item.sub_type
endif
528 0.000661 if l:item.lnum < 1
" When errors appear before line 1, put them at line 1.
let l:item.lnum = 1
elseif l:item.bufnr == a:buffer && l:item.lnum > l:last_line_number
" When errors go beyond the end of the file, put them at the end.
" This is only done for the current buffer.
6 0.000015 let l:item.lnum = l:last_line_number
6 0.000003 endif
528 0.001394 call add(l:new_loclist, l:item)
528 0.000431 endfor
4 0.000164 0.000060 let l:type_map = get(ale#Var(a:buffer, 'type_map'), a:linter_name, {})
4 0.000008 if !empty(l:type_map)
call s:RemapItemTypes(l:type_map, l:new_loclist)
endif
4 0.000005 return l:new_loclist
FUNCTION 309()
Called 31 times
Total time: 0.000291
Self time: 0.000291
count total (s) self (s)
31 0.000259 return has_key(self.variables.hl_list, a:name)
FUNCTION vital#_incsearch#Coaster#Window#import()
Called 1 time
Total time: 0.000017
Self time: 0.000017
count total (s) self (s)
1 0.000017 return map({'as_windo': '', '_vital_depends': '', 'windo': '', '_vital_loaded': ''}, 'function("s:" . v:key)')
FUNCTION <SNR>146_VimCloseCallback()
Called 4 times
Total time: 0.405051
Self time: 0.000341
count total (s) self (s)
4 0.000012 let l:job = ch_getjob(a:channel)
4 0.000058 0.000026 let l:job_id = ale#job#ParseVim8ProcessID(string(l:job))
4 0.000020 let l:info = get(s:job_map, l:job_id, {})
4 0.000009 if empty(l:info)
return
endif
" job_status() can trigger the exit handler.
" The channel can close before the job has exited.
4 0.404683 0.000068 if job_status(l:job) is# 'dead'
4 0.000004 try
4 0.000016 if !empty(l:info) && has_key(l:info, 'exit_cb')
4 0.000187 0.000124 call ale#util#GetFunction(l:info.exit_cb)(l:job_id, l:info.exit_code)
4 0.000004 endif
4 0.000004 finally
" Automatically forget about the job after it's done.
4 0.000013 if has_key(s:job_map, l:job_id)
call remove(s:job_map, l:job_id)
endif
4 0.000003 endtry
4 0.000003 endif
FUNCTION 225()
Called 9 times
Total time: 0.000690
Self time: 0.000400
count total (s) self (s)
9 0.000373 0.000083 if a:cmdline.is_input("\<C-r>")
call a:cmdline.tap_keyinput(self.prefix_key)
call a:cmdline.disable_keymapping()
call a:cmdline.setpos(a:cmdline.getpos()-1)
else
9 0.000047 if exists("self.prefix_key")
call a:cmdline.untap_keyinput(self.prefix_key)
call a:cmdline.enable_keymapping()
unlet! self.prefix_key
endif
9 0.000014 endif
FUNCTION 226()
Called 1 time
Total time: 0.000003
Self time: 0.000003
count total (s) self (s)
1 0.000003 let self.search_register = @/
FUNCTION 227()
Called 9 times
Total time: 0.001807
Self time: 0.000472
count total (s) self (s)
9 0.000078 if exists('self.prefix_key') && a:cmdline.get_tap_key() == self.prefix_key
call a:cmdline.setline(self.old_line)
call a:cmdline.setpos(self.old_pos)
let char = a:cmdline.input_key()
if char ==# '/'
let register = tr(self.search_register, "\n", "\r")
call a:cmdline.setchar(register)
return
endif
endif
9 0.001466 0.000131 return call(s:InsertRegister_orig_on_char_pre, [a:cmdline], self)
FUNCTION 229()
Called 9 times
Total time: 0.000511
Self time: 0.000225
count total (s) self (s)
9 0.000364 0.000078 if a:cmdline.is_input("<Over>(paste)")
let register = v:register == "" ? '"' : v:register
call a:cmdline.insert(tr(getreg("*"), "\n", "\r"))
call a:cmdline.setchar('')
endif
FUNCTION 108()
Called 27 times
Total time: 0.000147
Self time: 0.000147
count total (s) self (s)
27 0.000110 return self.variables.input_key_stack
FUNCTION airline#parts#mode()
Called 547 times
Total time: 0.031324
Self time: 0.009771
count total (s) self (s)
547 0.030609 0.009056 return airline#util#shorten(get(w:, 'airline_current_mode', ''), 79, 1)
FUNCTION incsearch#highlight#incremental_highlight()
Called 9 times
Total time: 0.023055
Self time: 0.001635
count total (s) self (s)
9 0.000092 let should_separate_highlight = get(a:, 1, s:FALSE)
9 0.000072 let direction = get(a:, 2, s:DIRECTION.forward)
9 0.000114 let start_pos = get(a:, 3, getpos('.')[1:2])
9 0.000984 0.000087 let hgm = incsearch#highlight#hgm()
9 0.000081 let [m, r, o, c] = [hgm.match, hgm.match_reverse, hgm.on_cursor, hgm.cursor]
9 0.000058 let on_cursor_pattern = '\m\%#\(' . a:pattern . '\m\)'
9 0.000069 if '' =~# a:pattern
" Do not highlight for patterns which match everything
call s:hi.delete_all()
elseif ! should_separate_highlight
9 0.000726 0.000143 call s:hi.add(m.group, m.group, a:pattern, m.priority)
9 0.000033 if ! g:incsearch#no_inc_hlsearch
9 0.000036 let @/ = a:pattern
9 0.000073 let &hlsearch = &hlsearch
9 0.000015 endif
9 0.000012 else
let [p1, p2] = (direction == s:DIRECTION.forward) ? [incsearch#highlight#forward_pattern(a:pattern, start_pos) ,incsearch#highlight#backward_pattern(a:pattern, start_pos)] : [incsearch#highlight#backward_pattern(a:pattern, start_pos) ,incsearch#highlight#forward_pattern(a:pattern, start_pos)]
call s:hi.add(m.group , m.group , p1 , m.priority) " right direction
call s:hi.add(r.group , r.group , p2 , r.priority) " reversed direction
endif
9 0.000658 0.000129 call s:hi.add(o.group , o.group , on_cursor_pattern , o.priority)
9 0.000661 0.000115 call s:hi.add(c.group , c.group , '\v%#' , c.priority)
9 0.018951 0.000086 call incsearch#highlight#update()
FUNCTION <SNR>198__verbosefile_pop()
Called 1 time
Total time: 0.000022
Self time: 0.000022
count total (s) self (s)
1 0.000002 let filename = &verbosefile
1 0.000014 let &verbosefile = get(s:verbosefiles, -1)
1 0.000003 call remove(s:verbosefiles, -1)
1 0.000002 return filename
FUNCTION <SNR>204_on_char_pre()
Called 9 times
Total time: 0.006805
Self time: 0.002690
count total (s) self (s)
" NOTE:
" `:call a:cmdline.setchar('')` as soon as possible!
9 0.001654 0.000110 let [raw_pattern, offset] = a:cmdline._parse_pattern()
9 0.000424 0.000121 let pattern = a:cmdline._convert(raw_pattern)
" Interactive :h last-pattern if pattern is empty
9 0.000732 0.000158 if ( a:cmdline.is_input('<Over>(incsearch-next)') || a:cmdline.is_input('<Over>(incsearch-prev)') ) && empty(pattern)
call a:cmdline.setchar('')
" Use history instead of @/ to work with magic option and converter
call a:cmdline.setline(histget('/', -1) . (empty(offset) ? '' : a:cmdline._base_key) . offset)
" Just insert last-pattern and do not count up, but the incsearch-prev
" should move the cursor to reversed directly, so do not return if the
" command is prev
if a:cmdline.is_input('<Over>(incsearch-next)') | return | endif
endif
9 0.000354 0.000077 if a:cmdline.is_input('<Over>(incsearch-next)')
call a:cmdline.setchar('')
if a:cmdline._flag ==# 'n' " exit stay mode
let a:cmdline._flag = ''
else
let a:cmdline._vcount1 += 1
endif
elseif a:cmdline.is_input('<Over>(incsearch-prev)')
call a:cmdline.setchar('')
if a:cmdline._flag ==# 'n' " exit stay mode
let a:cmdline._flag = ''
endif
let a:cmdline._vcount1 -= 1
elseif (a:cmdline.is_input('<Over>(incsearch-scroll-f)') && (a:cmdline._flag ==# '' || a:cmdline._flag ==# 'n')) || (a:cmdline.is_input('<Over>(incsearch-scroll-b)') && a:cmdline._flag ==# 'b')
call a:cmdline.setchar('')
if a:cmdline._flag ==# 'n' | let a:cmdline._flag = '' | endif
let pos_expr = a:cmdline.is_input('<Over>(incsearch-scroll-f)') ? 'w$' : 'w0'
let to_col = a:cmdline.is_input('<Over>(incsearch-scroll-f)') ? s:U.get_max_col(pos_expr) : 1
let [from, to] = [getpos('.')[1:2], [line(pos_expr), to_col]]
let cnt = s:U.count_pattern(pattern, from, to)
let a:cmdline._vcount1 += cnt
elseif (a:cmdline.is_input('<Over>(incsearch-scroll-b)') && (a:cmdline._flag ==# '' || a:cmdline._flag ==# 'n')) || (a:cmdline.is_input('<Over>(incsearch-scroll-f)') && a:cmdline._flag ==# 'b')
call a:cmdline.setchar('')
if a:cmdline._flag ==# 'n'
let a:cmdline._flag = ''
let a:cmdline._vcount1 -= 1
endif
let pos_expr = a:cmdline.is_input('<Over>(incsearch-scroll-f)') ? 'w$' : 'w0'
let to_col = a:cmdline.is_input('<Over>(incsearch-scroll-f)') ? s:U.get_max_col(pos_expr) : 1
let [from, to] = [getpos('.')[1:2], [line(pos_expr), to_col]]
let cnt = s:U.count_pattern(pattern, from, to)
let a:cmdline._vcount1 -= cnt
endif
" Handle nowrapscan:
" if you `:set nowrapscan`, you can't move to the reversed direction
9 0.000112 if !&wrapscan && ( a:cmdline.is_input('<Over>(incsearch-next)') || a:cmdline.is_input('<Over>(incsearch-prev)') || a:cmdline.is_input('<Over>(incsearch-scroll-f)') || a:cmdline.is_input('<Over>(incsearch-scroll-b)') )
if a:cmdline._vcount1 < 1
let a:cmdline._vcount1 = 1
else
call a:cmdline.setchar('')
let [from, to] = [[a:cmdline._w.lnum, a:cmdline._w.col + 1], a:cmdline._flag !=# 'b' ? [line('$'), s:U.get_max_col('$')] : [1, 1] ]
let max_cnt = s:U.count_pattern(pattern, from, to, s:TRUE)
let a:cmdline._vcount1 = min([max_cnt, a:cmdline._vcount1])
endif
endif
9 0.000048 if &wrapscan && a:cmdline._vcount1 < 1
let a:cmdline._vcount1 += s:U.count_pattern(pattern)
endif
FUNCTION <SNR>159_InvokeCompletion()
Called 37 times
Total time: 0.159142
Self time: 0.121814
count total (s) self (s)
37 0.121185 exec s:python_command "ycm_state.SendCompletionRequest(" . "vimsupport.GetBoolValue( 's:force_semantic' ) )"
37 0.037851 0.000523 call s:PollCompletion()
FUNCTION airline#extensions#quickfix#apply()
Called 2 times
Total time: 0.000035
Self time: 0.000035
count total (s) self (s)
2 0.000010 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 ale#engine#SetResults()
Called 4 times
Total time: 0.218207
Self time: 0.001010
count total (s) self (s)
4 0.000069 0.000026 let l:linting_is_done = !ale#engine#IsCheckingBuffer(a:buffer)
" Set signs first. This could potentially fix some line numbers.
" The List could be sorted again here by SetSigns.
4 0.000008 if g:ale_set_signs
4 0.156341 0.000477 call ale#sign#SetSigns(a:buffer, a:loclist)
4 0.000003 endif
4 0.000009 if g:ale_set_quickfix || g:ale_set_loclist
4 0.000347 0.000174 call ale#list#SetLists(a:buffer, a:loclist)
4 0.000002 endif
4 0.000012 if exists('*ale#statusline#Update')
" Don't load/run if not already loaded.
4 0.018429 0.000076 call ale#statusline#Update(a:buffer, a:loclist)
4 0.000004 endif
4 0.000005 if g:ale_set_highlights
4 0.040200 0.000047 call ale#highlight#SetHighlights(a:buffer, a:loclist)
4 0.000004 endif
4 0.000006 if g:ale_echo_cursor
" Try and echo the warning now.
" This will only do something meaningful if we're in normal mode.
4 0.002305 0.000026 call ale#cursor#EchoCursorWarning()
4 0.000003 endif
4 0.000006 if l:linting_is_done
" Reset the save event marker, used for opening windows, etc.
2 0.000008 call setbufvar(a:buffer, 'ale_save_event_fired', 0)
" Automatically remove all managed temporary files and directories
" now that all jobs have completed.
2 0.000332 0.000021 call ale#engine#RemoveManagedFiles(a:buffer)
" Call user autocommands. This allows users to hook into ALE's lint cycle.
2 0.000059 0.000038 silent doautocmd User ALELint
2 0.000002 endif
FUNCTION ale#sign#ParseSigns()
Called 4 times
Total time: 0.022419
Self time: 0.022419
count total (s) self (s)
" Matches output like :
" line=4 id=1 name=ALEErrorSign
" строка=1 id=1000001 имя=ALEErrorSign
" 行=1 識別子=1000001 名前=ALEWarningSign
" línea=12 id=1000001 nombre=ALEWarningSign
" riga=1 id=1000001, nome=ALEWarningSign
4 0.000011 let l:pattern = '\v^.*\=(\d+).*\=(\d+).*\=(ALE[a-zA-Z]+Sign)'
4 0.000005 let l:result = []
4 0.000008 let l:is_dummy_sign_set = 0
508 0.000657 for l:line in a:line_list
504 0.013529 let l:match = matchlist(l:line, l:pattern)
504 0.001100 if len(l:match) > 0
484 0.001141 if l:match[3] is# 'ALEDummySign'
let l:is_dummy_sign_set = 1
else
484 0.003133 call add(l:result, [ str2nr(l:match[1]), str2nr(l:match[2]), l:match[3],])
484 0.000391 endif
484 0.000309 endif
504 0.000342 endfor
4 0.000010 return [l:is_dummy_sign_set, l:result]
FUNCTION <SNR>142_InvokeChain()
Called 4 times
Total time: 0.066122
Self time: 0.000605
count total (s) self (s)
4 0.003091 0.000116 let l:options = ale#engine#ProcessChain(a:buffer, a:linter, a:chain_index, a:input)
4 0.062989 0.000447 return s:RunJob(l:options)
FUNCTION StopProfile()
Called 1 time
Total time: 0.000000
Self time: 0.000000
count total (s) self (s)
:profile pause
:noautocmd qall!
FUNCTION vital#_incsearch#Over#Commandline#Modules#BufferComplete#import()
Called 1 time
Total time: 0.000009
Self time: 0.000009
count total (s) self (s)
1 0.000009 return map({'make': ''}, 'function("s:" . v:key)')
FUNCTION <SNR>171_length()
Called 10 times
Total time: 0.000848
Self time: 0.000162
count total (s) self (s)
10 0.000838 0.000152 return len(s:split_by_keys(a:str))
FUNCTION airline#extensions#wordcount#apply()
Called 2 times
Total time: 0.000202
Self time: 0.000120
count total (s) self (s)
2 0.000080 if match(&ft, get(g:, 'airline#extensions#wordcount#filetypes')) > -1
2 0.000117 0.000035 call airline#extensions#prepend_to_section('z', '%{get(b:, "airline_wordcount", "")}')
2 0.000003 endif
FUNCTION ale#util#GetMatches()
Called 4 times
Total time: 0.017115
Self time: 0.017115
count total (s) self (s)
4 0.000009 let l:matches = []
4 0.000018 let l:lines = type(a:lines) == type([]) ? a:lines : [a:lines]
4 0.000018 let l:patterns = type(a:patterns) == type([]) ? a:patterns : [a:patterns]
532 0.000635 for l:line in l:lines
528 0.000997 for l:pattern in l:patterns
528 0.010894 let l:match = matchlist(l:line, l:pattern)
528 0.001170 if !empty(l:match)
528 0.001261 call add(l:matches, l:match)
528 0.000448 break
endif
endfor
528 0.000344 endfor
4 0.000006 return l:matches
FUNCTION 240()
Called 1 time
Total time: 0.000074
Self time: 0.000015
count total (s) self (s)
1 0.000003 let s:cmdline = a:cmdline
1 0.000070 0.000011 call s:doautocmd_user(self.prefix, self.prefix . 'Enter')
FUNCTION 241()
Called 1 time
Total time: 0.000280
Self time: 0.000034
count total (s) self (s)
1 0.000009 let s:cmdline = a:cmdline
1 0.000269 0.000023 call s:doautocmd_user(self.prefix, self.prefix . 'Leave')
FUNCTION 244()
Called 9 times
Total time: 0.000853
Self time: 0.000142
count total (s) self (s)
9 0.000034 let s:cmdline = a:cmdline
9 0.000807 0.000096 call s:doautocmd_user(self.prefix, self.prefix . 'Draw')
FUNCTION 245()
Called 9 times
Total time: 0.000966
Self time: 0.000152
count total (s) self (s)
9 0.000045 let s:cmdline = a:cmdline
9 0.000911 0.000097 call s:doautocmd_user(self.prefix, self.prefix . 'DrawPre')
FUNCTION 248()
Called 1 time
Total time: 0.000215
Self time: 0.000028
count total (s) self (s)
1 0.000007 let s:cmdline = a:cmdline
1 0.000206 0.000019 call s:doautocmd_user(self.prefix, self.prefix . 'Execute')
FUNCTION <SNR>175_match_key()
Called 12 times
Total time: 0.001116
Self time: 0.001116
count total (s) self (s)
12 0.000247 let keys = sort(keys(a:keymapping))
12 0.000850 return get(filter(keys, 'stridx(a:key, v:val) == 0'), -1, '')
FUNCTION <SNR>163_emulate_search_warning()
Called 1 time
Total time: 0.000105
Self time: 0.000105
count total (s) self (s)
" NOTE:
" - It should use :h echomsg considering emulation of default
" warning messages remain in the :h message-history, but it'll mess
" up the message-history unnecessary, so it use :h echo
" - See :h shortmess
" if &shortmess !~# 's' && g:incsearch#do_not_save_error_message_history
1 0.000020 if &shortmess !~# 's' && g:incsearch#do_not_save_error_message_history
let from = [a:from.lnum, a:from.col]
let to = [a:to.lnum, a:to.col]
let old_warningmsg = v:warningmsg
let v:warningmsg = ( a:direction == s:DIRECTION.forward && !s:U.is_pos_less_equal(from, to) ? 'search hit BOTTOM, continuing at TOP' : a:direction == s:DIRECTION.backward && s:U.is_pos_less_equal(from, to) ? 'search hit TOP, continuing at BOTTOM' : '' )
if v:warningmsg !=# ''
call s:Warning(v:warningmsg)
else
let v:warningmsg = old_warningmsg
endif
endif
FUNCTION <SNR>170_make()
Called 1 time
Total time: 0.000118
Self time: 0.000055
count total (s) self (s)
1 0.000035 let result = deepcopy(s:base)
1 0.000011 0.000008 call result.set_prompt(get(a:, 1, ":"))
1 0.000071 0.000011 call result.connect(result, "_")
1 0.000001 return result
FUNCTION <SNR>195_make()
Called 1 time
Total time: 0.000011
Self time: 0.000011
count total (s) self (s)
1 0.000004 let module = deepcopy(s:module)
1 0.000005 let module.chars = type(a:chars) == type([]) ? a:chars : [a:chars]
1 0.000002 return module
FUNCTION vital#incsearch#of()
Called 20 times
Total time: 0.000301
Self time: 0.000093
count total (s) self (s)
20 0.000294 0.000086 return s:new(s:plugin_name)
FUNCTION <SNR>68_IsEmptyPair()
Called 17 times
Total time: 0.001519
Self time: 0.000475
count total (s) self (s)
17 0.000772 0.000167 let l:prev = s:GetPrevChar()
17 0.000575 0.000136 let l:next = s:GetNextChar()
17 0.000141 return (l:next != "\0") && (get(b:AutoClosePairs, l:prev, "\0") == l:next)
FUNCTION vital#_incsearch#Over#Commandline#Modules#import()
Called 1 time
Total time: 0.000016
Self time: 0.000016
count total (s) self (s)
1 0.000016 return map({'get': '', 'make': '', '_vital_loaded': ''}, 'function("s:" . v:key)')
FUNCTION incsearch#over#modules#incsearch#make()
Called 1 time
Total time: 0.000005
Self time: 0.000005
count total (s) self (s)
1 0.000005 return deepcopy(s:inc)
FUNCTION <SNR>171__vital_loaded()
Called 1 time
Total time: 0.001378
Self time: 0.000014
count total (s) self (s)
1 0.000002 let s:V = a:V
1 0.001375 0.000011 let s:List = s:V.import("Data.List")
FUNCTION 255()
Called 9 times
Total time: 0.000124
Self time: 0.000124
count total (s) self (s)
9 0.000045 if has_key(self, "exception")
call self.message(a:cmdline)
unlet self.exception
endif
FUNCTION 257()
Called 1 time
Total time: 0.000024
Self time: 0.000024
count total (s) self (s)
1 0.000009 if has_key(self, "exception")
call self.message(a:cmdline)
unlet self.exception
endif
FUNCTION airline#statusline()
Called 547 times
Total time: 0.015830
Self time: 0.015830
count total (s) self (s)
547 0.006301 if has_key(s:contexts, a:winnr)
547 0.008211 return '%{airline#check_mode('.a:winnr.')}'.s:contexts[a:winnr].line
endif
" in rare circumstances this happens...see #276
return ''
FUNCTION <SNR>179__finish()
Called 10 times
Total time: 0.000185
Self time: 0.000185
count total (s) self (s)
10 0.000067 if exists("s:old_statusline")
let &statusline = s:old_statusline
unlet s:old_statusline
redrawstatus
endif
FUNCTION <SNR>142_RunJob()
Called 4 times
Total time: 0.062542
Self time: 0.003857
count total (s) self (s)
4 0.000029 let l:command = a:options.command
4 0.000023 let l:buffer = a:options.buffer
4 0.000023 let l:linter = a:options.linter
4 0.000028 let l:output_stream = a:options.output_stream
4 0.000028 let l:next_chain_index = a:options.next_chain_index
4 0.000024 let l:read_buffer = a:options.read_buffer
4 0.000049 let l:info = g:ale_buffer_info[l:buffer]
4 0.000028 if empty(l:command)
return 0
endif
4 0.001480 0.000119 let [l:temporary_file, l:command] = ale#command#FormatCommand(l:buffer, l:command, l:read_buffer)
4 0.035914 0.001128 if s:CreateTemporaryFileForJob(l:buffer, l:temporary_file)
" If a temporary filename has been formatted in to the command, then
" we do not need to send the Vim buffer to the command.
4 0.000025 let l:read_buffer = 0
4 0.000010 endif
" Add a newline to commands which need it.
" This is only used for Flow for now, and is not documented.
4 0.000019 if l:linter.add_newline
if has('win32')
let l:command = l:command . '; echo.'
else
let l:command = l:command . '; echo'
endif
endif
4 0.000904 0.000359 let l:command = ale#job#PrepareCommand(l:command)
4 0.000079 let l:job_options = { 'mode': 'nl', 'exit_cb': function('s:HandleExit'),}
4 0.000023 if l:output_stream is# 'stderr'
let l:job_options.err_cb = function('s:GatherOutput')
elseif l:output_stream is# 'both'
let l:job_options.out_cb = function('s:GatherOutput')
let l:job_options.err_cb = function('s:GatherOutput')
else
4 0.000052 let l:job_options.out_cb = function('s:GatherOutput')
4 0.000010 endif
4 0.000031 if get(g:, 'ale_run_synchronously') == 1
" Find a unique Job value to use, which will be the same as the ID for
" running commands synchronously. This is only for test code.
let l:job_id = len(s:job_info_map) + 1
while has_key(s:job_info_map, l:job_id)
let l:job_id += 1
endwhile
else
4 0.021821 0.000376 let l:job_id = ale#job#Start(l:command, l:job_options)
4 0.000012 endif
4 0.000024 let l:status = 'failed'
" Only proceed if the job is being run.
4 0.000016 if l:job_id
" Add the job to the list of jobs, so we can track them.
4 0.000084 call add(l:info.job_list, l:job_id)
4 0.000093 if index(l:info.active_linter_list, l:linter.name) < 0
4 0.000040 call add(l:info.active_linter_list, l:linter.name)
4 0.000010 endif
4 0.000020 let l:status = 'started'
" Store the ID for the job in the map to read back again.
4 0.000124 let s:job_info_map[l:job_id] = { 'linter': l:linter, 'buffer': l:buffer, 'output': [], 'next_chain_index': l:next_chain_index,}
4 0.000012 endif
4 0.000020 if g:ale_history_enabled
4 0.000675 0.000127 call ale#history#Add(l:buffer, l:status, l:job_id, l:command)
4 0.000011 endif
4 0.000035 if get(g:, 'ale_run_synchronously') == 1
" Run a command synchronously if this test option is set.
let s:job_info_map[l:job_id].output = systemlist( type(l:command) == type([]) ? join(l:command[0:1]) . ' ' . ale#Escape(l:command[2]) : l:command)
call l:job_options.exit_cb(l:job_id, v:shell_error)
endif
4 0.000053 return l:job_id != 0
FUNCTION gitgutter#utility#exists_file()
Called 1 time
Total time: 0.000020
Self time: 0.000020
count total (s) self (s)
1 0.000019 return filereadable(s:file)
FUNCTION vital#_incsearch#Over#Commandline#Modules#CursorMove#import()
Called 1 time
Total time: 0.000009
Self time: 0.000009
count total (s) self (s)
1 0.000009 return map({'make': ''}, 'function("s:" . v:key)')
FUNCTION 282()
Called 1 time
Total time: 0.000019
Self time: 0.000019
count total (s) self (s)
1 0.000002 if ! g:incsearch#no_inc_hlsearch
1 0.000002 let self.pattern = @/
1 0.000002 let self.hlsearch = &hlsearch
1 0.000002 if exists('v:hlsearch')
1 0.000002 let self.vhlsearch = v:hlsearch
1 0.000001 endif
1 0.000005 set hlsearch | nohlsearch
1 0.000000 endif
FUNCTION <SNR>182_make()
Called 1 time
Total time: 0.000004
Self time: 0.000004
count total (s) self (s)
1 0.000004 return deepcopy(s:module)
FUNCTION ale#history#Get()
Called 8 times
Total time: 0.000065
Self time: 0.000065
count total (s) self (s)
8 0.000062 return copy(getbufvar(a:buffer, 'ale_history', []))
FUNCTION incsearch#highlight#hgm()
Called 10 times
Total time: 0.000940
Self time: 0.000940
count total (s) self (s)
10 0.000091 let hgm = copy(s:default_highlight)
60 0.000179 for key in keys(hgm)
50 0.000409 call extend(hgm[key], get(g:incsearch#highlight, key, {}))
50 0.000094 endfor
10 0.000027 return hgm
FUNCTION <SNR>164_deepextend()
Called 1 time
Total time: 0.000141
Self time: 0.000141
count total (s) self (s)
1 0.000003 let expr2 = copy(a:expr2)
11 0.000019 for [k, V] in items(a:expr1)
10 0.000048 if (type(V) is type({}) || type(V) is type([])) && has_key(expr2, k)
let a:expr1[k] = extend(a:expr1[k], expr2[k])
unlet expr2[k]
endif
10 0.000009 unlet V
10 0.000006 endfor
1 0.000003 return extend(a:expr1, expr2)
FUNCTION <SNR>134_add_section()
Called 16 times
Total time: 0.002090
Self time: 0.000748
count total (s) self (s)
16 0.000108 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
16 0.000380 0.000133 if ((a:key == 'error' || a:key == 'warning') && empty(s:get_section(a:context.winnr, a:key)))
return
endif
16 0.000029 if condition
call a:builder.add_raw('%(')
endif
16 0.001320 0.000225 call a:builder.add_section('airline_'.a:key, s:get_section(a:context.winnr, a:key))
16 0.000029 if condition
call a:builder.add_raw('%)')
endif
FUNCTION <SNR>68_EmptyBuffer()
Called 1 time
Total time: 0.000024
Self time: 0.000024
count total (s) self (s)
1 0.000013 if exists("b:AutoCloseBuffer")
let b:AutoCloseBuffer = []
endif
FUNCTION <SNR>184_make()
Called 1 time
Total time: 0.000005
Self time: 0.000005
count total (s) self (s)
1 0.000004 return deepcopy(s:module)
FUNCTION <SNR>159_Complete()
Called 55 times
Total time: 0.001426
Self time: 0.000843
count total (s) self (s)
" <c-x><c-u> invokes the user's completion function (which we have set to
" youcompleteme#CompleteFunc), and <c-p> tells Vim to select the previous
" completion candidate. This is necessary because by default, Vim selects the
" first candidate when completion is invoked, and selecting a candidate
" automatically replaces the current text with it. Calling <c-p> forces Vim to
" deselect the first candidate and in turn preserve the user's current text
" until he explicitly chooses to replace it with a completion.
55 0.001175 0.000592 call s:SendKeys( "\<C-X>\<C-U>\<C-P>" )
FUNCTION gitgutter#utility#is_active()
Called 1 time
Total time: 0.000221
Self time: 0.000090
count total (s) self (s)
1 0.000220 0.000089 return g:gitgutter_enabled && !pumvisible() && gitgutter#utility#is_file_buffer() && gitgutter#utility#exists_file() && gitgutter#utility#not_git_dir()
FUNCTION 262()
Called 1 time
Total time: 0.000013
Self time: 0.000007
count total (s) self (s)
1 0.000013 0.000007 call s:_reset()
FUNCTION airline#extensions#apply()
Called 2 times
Total time: 0.000326
Self time: 0.000166
count total (s) self (s)
2 0.000010 let s:active_winnr = winnr()
2 0.000181 0.000021 if s:is_excluded_window()
return -1
endif
2 0.000006 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
2 0.000005 if &previewwindow
let w:airline_section_a = 'Preview'
let w:airline_section_b = ''
let w:airline_section_c = bufname(winbufnr(winnr()))
endif
2 0.000028 if has_key(s:filetype_overrides, &ft)
let args = s:filetype_overrides[&ft]
call airline#extensions#apply_left_override(args[0], args[1])
endif
2 0.000010 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 Latexbox_CallIndent()
Called 55 times
Total time: 0.049376
Self time: 0.016886
count total (s) self (s)
" Save the current cursor position.
55 0.000449 let cursor = getpos('.')
" Save the current window position.
55 0.005198 normal! H
55 0.000365 let window = getpos('.')
55 0.000350 call setpos('.', cursor)
" Get first non-whitespace character of current line.
55 0.001018 let line_start_char = matchstr(getline('.'), '\S')
" Get initial tab position.
55 0.000462 let initial_tab = stridx(getline('.'), line_start_char)
" Execute the command.
55 0.034615 0.002125 execute 'normal! =='
" Get tab position difference.
55 0.000554 let difference = stridx(getline('.'), line_start_char) - initial_tab
" Set new cursor Y position based on calculated difference.
55 0.000398 let cursor[2] = cursor[2] + difference
" Restore the previous window position.
55 0.000301 call setpos('.', window)
55 0.004313 normal! zt
" Restore the previous cursor position.
55 0.000317 call setpos('.', cursor)
FUNCTION <SNR>138_GetAliasedFiletype()
Called 2 times
Total time: 0.000272
Self time: 0.000272
count total (s) self (s)
" Check for aliased filetypes first in a buffer variable,
" then the global variable,
" then in the default mapping,
" otherwise use the original filetype.
8 0.000070 for l:dict in [ get(b:, 'ale_linter_aliases', {}), g:ale_linter_aliases, s:default_ale_linter_aliases,]
6 0.000080 if has_key(l:dict, a:original_filetype)
return l:dict[a:original_filetype]
endif
6 0.000012 endfor
2 0.000011 return a:original_filetype
FUNCTION <SNR>167__exists_autoload_func_with_source()
Called 39 times
Total time: 0.020376
Self time: 0.001464
count total (s) self (s)
39 0.000180 if exists('*' . a:funcname)
" Return true if a given func is already defined
return 1
endif
" source a file which may include a given func definition and try again.
39 0.000757 let path = 'autoload/' . substitute(substitute(a:funcname, '#[^#]*$', '.vim', ''), '#', '/', 'g')
39 0.019115 0.000203 call s:_runtime(path)
39 0.000178 return exists('*' . a:funcname)
FUNCTION <SNR>186_make()
Called 1 time
Total time: 0.000004
Self time: 0.000004
count total (s) self (s)
1 0.000003 return deepcopy(s:module)
FUNCTION youcompleteme#CompleteFunc()
Called 110 times
Total time: 0.001743
Self time: 0.001743
count total (s) self (s)
110 0.000359 if a:findstart
103 0.000741 if s:completion.start_column > col( '.' ) || empty( s:completion.candidates )
" For vim, -2 means not found but don't trigger an error message.
" See :h complete-functions.
96 0.000197 return -2
endif
7 0.000023 return s:completion.start_column - 1
endif
7 0.000017 return s:completion.candidates
FUNCTION 206()
Called 9 times
Total time: 0.000072
Self time: 0.000072
count total (s) self (s)
9 0.000042 if has_key(self, "value")
8 0.000015 return
endif
1 0.000003 let self.value = &cmdheight
FUNCTION <SNR>175__vital_loaded()
Called 1 time
Total time: 0.000053
Self time: 0.000010
count total (s) self (s)
1 0.000002 let s:V = a:V
1 0.000050 0.000007 let s:String = s:V.import("Over.String")
FUNCTION <SNR>194_make()
Called 1 time
Total time: 0.000010
Self time: 0.000010
count total (s) self (s)
1 0.000005 let module = deepcopy(s:module)
1 0.000004 let module.mode = get(a:, 1, "cmd")
1 0.000001 return module
FUNCTION <SNR>212__vital_loaded()
Called 1 time
Total time: 0.001439
Self time: 0.000018
count total (s) self (s)
1 0.000002 let s:V = a:V
1 0.001381 0.000008 let s:Window = s:V.import("Gift.Window")
1 0.000055 0.000007 let s:Tabpage = s:V.import("Gift.Tabpage")
FUNCTION <SNR>175_unmapping()
Called 12 times
Total time: 0.003988
Self time: 0.000865
count total (s) self (s)
12 0.000120 let is_locking = get(a:, 1, 0)
12 0.001305 0.000189 let key = s:match_key(a:keymapping, a:key)
12 0.000045 if key == ""
10 0.001114 0.000266 return s:String.length(a:key) <= 1 ? a:key : s:unmapping(a:keymapping, a:key[0], is_locking) . s:unmapping(a:keymapping, a:key[1:], is_locking)
endif
2 0.000113 0.000047 let map_conf = s:as_key_config(a:keymapping[key])
2 0.000038 let next_input = s:unmapping(a:keymapping, a:key[len(key) : ], is_locking)
2 0.000012 if map_conf.lock == 0 && is_locking
1 0.000005 return key . next_input
elseif map_conf.lock
return s:unmapping(a:keymapping, s:_get_key(map_conf), is_locking) . next_input
else
1 0.000055 0.000032 return s:unmapping(a:keymapping, s:_get_key(map_conf), map_conf.noremap) . next_input
endif
FUNCTION <SNR>173_make()
Called 1 time
Total time: 0.000009
Self time: 0.000009
count total (s) self (s)
1 0.000006 let result = deepcopy(s:base)
1 0.000002 return result
FUNCTION ale#history#Add()
Called 6 times
Total time: 0.000732
Self time: 0.000732
count total (s) self (s)
6 0.000060 if g:ale_max_buffer_history_size <= 0
" Don't save anything if the history isn't a positive number.
call setbufvar(a:buffer, 'ale_history', [])
return
endif
6 0.000131 let l:history = getbufvar(a:buffer, 'ale_history', [])
" Remove the first item if we hit the max history size.
6 0.000056 if len(l:history) >= g:ale_max_buffer_history_size
let l:history = l:history[1:]
endif
6 0.000133 call add(l:history, { 'status': a:status, 'job_id': a:job_id, 'command': a:command,})
6 0.000103 call setbufvar(a:buffer, 'ale_history', l:history)
FUNCTION <SNR>159_OnBlankLine()
Called 37 times
Total time: 0.037411
Self time: 0.000266
count total (s) self (s)
37 0.037383 0.000238 return s:Pyeval( 'not vim.current.line or vim.current.line.isspace()' )
FUNCTION 89()
Called 2 times
Total time: 0.000132
Self time: 0.000024
count total (s) self (s)
2 0.000123 0.000015 let slot = self.variables.modules.find_first_by("get(v:val.slot, 'name', '') == " . string(a:name))
2 0.000008 return empty(slot) ? {} : slot.slot.module
FUNCTION vital#_incsearch#Over#Commandline#Modules#InsertRegister#import()
Called 1 time
Total time: 0.000024
Self time: 0.000024
count total (s) self (s)
1 0.000022 return map({'_vital_depends': '', 'to_string': '', 'input': '', 'get_cmdline_cword': '', 'make': '', '_vital_loaded': ''}, 'function("s:" . v:key)')
FUNCTION airline#util#shorten()
Called 547 times
Total time: 0.021553
Self time: 0.021553
count total (s) self (s)
547 0.005780 if winwidth(0) < a:winwidth && len(split(a:text, '\zs')) > a:minwidth
if get(a:000, 0, 0)
" shorten from tail
return '…'.matchstr(a:text, '.\{'.a:minwidth.'}$')
else
" shorten from beginning of string
return matchstr(a:text, '^.\{'.a:minwidth.'}').'…'
endif
else
547 0.001864 return a:text
endif
FUNCTION 273()
Called 1 time
Total time: 0.001872
Self time: 0.000015
count total (s) self (s)
1 0.001871 0.000014 let self._cmaps = s:_auto_cmap()
FUNCTION 276()
Called 1 time
Total time: 0.000004
Self time: 0.000004
count total (s) self (s)
1 0.000002 function! a:cmdline.backward_word(...)
return call("s:backward_word", [self.backward()] + a:000)
endfunction
FUNCTION 277()
Called 1 time
Total time: 0.000003
Self time: 0.000003
count total (s) self (s)
1 0.000002 return g:incsearch#emacs_like_keymap
FUNCTION 278()
Called 1 time
Total time: 0.000003
Self time: 0.000003
count total (s) self (s)
1 0.000002 return g:incsearch#vim_cmdline_keymap
FUNCTION 279()
Called 1 time
Total time: 0.000002
Self time: 0.000002
count total (s) self (s)
1 0.000002 return g:incsearch#smart_backward_word
FUNCTION incsearch#over#modules#module_management#make()
Called 1 time
Total time: 0.000009
Self time: 0.000009
count total (s) self (s)
1 0.000005 let m = deepcopy(s:module_management)
1 0.000002 let m.modules = a:modules
1 0.000001 return m
FUNCTION <SNR>159_SendKeys()
Called 57 times
Total time: 0.000619
Self time: 0.000619
count total (s) self (s)
" By default keys are added to the end of the typeahead buffer. If there are
" already keys in the buffer, they will be processed first and may change the
" state that our keys combination was sent for (e.g. <C-X><C-U><C-P> in normal
" mode instead of insert mode or <C-e> outside of completion mode). We avoid
" that by inserting the keys at the start of the typeahead buffer with the 'i'
" option. Also, we don't want the keys to be remapped to something else so we
" add the 'n' option.
57 0.000361 call feedkeys( a:keys, 'in' )
FUNCTION vital#_incsearch#Over#String#import()
Called 1 time
Total time: 0.000022
Self time: 0.000022
count total (s) self (s)
1 0.000022 return map({'_vital_depends': '', 'length': '', 'index': '', 'split_by_keys': '', 'make': '', '_vital_loaded': ''}, 'function("s:" . v:key)')
FUNCTION 313()
Called 11 times
Total time: 0.001007
Self time: 0.000283
count total (s) self (s)
11 0.000886 0.000162 let window = get(a:, 1, s:Gift.uniq_winnr())
11 0.000107 return keys(get(self.variables.id_list, window, {}))
FUNCTION <SNR>119_ale_refresh()
Called 1 time
Total time: 0.059178
Self time: 0.000052
count total (s) self (s)
1 0.000010 if get(g:, 'airline_skip_empty_sections', 0)
1 0.059165 0.000039 exe ':AirlineRefresh'
1 0.000001 endif
FUNCTION 242()
Called 9 times
Total time: 0.001119
Self time: 0.000168
count total (s) self (s)
9 0.000040 let s:cmdline = a:cmdline
9 0.001067 0.000116 call s:doautocmd_user(self.prefix, self.prefix . 'Char')
FUNCTION airline#highlighter#highlight_modified_inactive()
Called 3 times
Total time: 0.002439
Self time: 0.000229
count total (s) self (s)
3 0.000032 if getbufvar(a:bufnr, '&modified')
2 0.000040 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 : []
2 0.000003 else
1 0.000024 let colors = exists('g:airline#themes#{g:airline_theme}#palette.inactive.airline_c') ? g:airline#themes#{g:airline_theme}#palette.inactive.airline_c : []
1 0.000002 endif
3 0.000014 if !empty(colors)
3 0.002268 0.000058 call airline#highlighter#exec('airline_c'.(a:bufnr).'_inactive', colors)
3 0.000005 endif
FUNCTION vital#_incsearch#Over#Commandline#Modules#Doautocmd#import()
Called 1 time
Total time: 0.000022
Self time: 0.000022
count total (s) self (s)
1 0.000021 return map({'_vital_depends': '', 'doautocmd_user': '', 'get_cmdline': '', 'make': '', '_vital_loaded': ''}, 'function("s:" . v:key)')
FUNCTION 243()
Called 9 times
Total time: 0.001278
Self time: 0.000176
count total (s) self (s)
9 0.000043 let s:cmdline = a:cmdline
9 0.001223 0.000121 call s:doautocmd_user(self.prefix, self.prefix . 'CharPre')
FUNCTION ale#job#PrepareCommand()
Called 4 times
Total time: 0.000545
Self time: 0.000456
count total (s) self (s)
" The command will be executed in a subshell. This fixes a number of
" issues, including reading the PATH variables correctly, %PATHEXT%
" expansion on Windows, etc.
"
" NeoVim handles this issue automatically if the command is a String,
" but we'll do this explicitly, so we use thes same exact command for both
" versions.
4 0.000169 0.000080 if ale#Has('win32')
return 'cmd /c ' . a:command
endif
4 0.000055 if &shell =~? 'fish$'
return ['/bin/sh', '-c', a:command]
endif
4 0.000213 return split(&shell) + split(&shellcmdflag) + [a:command]
FUNCTION 207()
Called 2 times
Total time: 0.000060
Self time: 0.000060
count total (s) self (s)
2 0.000018 if has_key(self, "value")
1 0.000017 let &cmdheight = self.value
1 0.000006 unlet self.value
1 0.000003 endif
FUNCTION ale#util#GetFunction()
Called 546 times
Total time: 0.004938
Self time: 0.004938
count total (s) self (s)
546 0.001937 if type(a:string_or_ref) == type('')
10 0.000064 return function(a:string_or_ref)
endif
536 0.000896 return a:string_or_ref
FUNCTION airline#extensions#keymap#status()
Called 547 times
Total time: 0.014883
Self time: 0.014883
count total (s) self (s)
547 0.007414 if (get(g:, 'airline#extensions#keymap#enabled', 1) && has('keymap'))
547 0.006419 return printf('%s', (!empty(&keymap) ? (g:airline_symbols.keymap . ' '. &keymap) : ''))
else
return ''
endif
FUNCTION 284()
Called 9 times
Total time: 0.000760
Self time: 0.000760
count total (s) self (s)
9 0.000033 let stack = []
9 0.000022 let c = 1
18 0.000043 while c
9 0.000273 let c = getchar(0)
9 0.000026 if c != 0
let stack += [nr2char(c)]
elseif !empty(stack)
call a:cmdline.set_input_key_stack(stack)
endif
9 0.000018 endwhile
FUNCTION 286()
Called 1 time
Total time: 0.000040
Self time: 0.000040
count total (s) self (s)
1 0.000007 if !exists('&t_BE')
return
endif
1 0.000025 let &t_BE = self.t_BE
FUNCTION <SNR>197__vital_loaded()
Called 1 time
Total time: 0.000581
Self time: 0.000008
count total (s) self (s)
1 0.000002 let s:V = a:V
1 0.000578 0.000005 let s:Capture = s:V.import("Palette.Capture")
FUNCTION <SNR>205_init_hl()
Called 1 time
Total time: 0.000041
Self time: 0.000041
count total (s) self (s)
1 0.000015 hi default link IncSearchMatch Search
1 0.000007 hi default link IncSearchMatchReverse IncSearch
1 0.000005 hi default link IncSearchCursor Cursor
1 0.000006 hi default link IncSearchOnCursor IncSearch
1 0.000007 hi default IncSearchUnderline term=underline cterm=underline gui=underline
FUNCTION vital#_incsearch#Over#Commandline#Maker#import()
Called 1 time
Total time: 0.000026
Self time: 0.000026
count total (s) self (s)
1 0.000026 return map({'plain': '', '_vital_depends': '', 'standard_search': '', 'standard': '', 'standard_search_back': '', 'default': '', '_vital_loaded': ''}, 'function("s:" . v:key)')
FUNCTION incsearch#config#make()
Called 1 time
Total time: 0.000192
Self time: 0.000031
count total (s) self (s)
1 0.000033 0.000013 let default = extend(deepcopy(s:config), s:lazy_config())
1 0.000153 0.000012 let c = s:U.deepextend(default, a:additional)
1 0.000002 if c.prompt is# ''
1 0.000002 let c.prompt = c.command
1 0.000001 endif
1 0.000001 return c
FUNCTION <SNR>197__capture()
Called 1 time
Total time: 0.000210
Self time: 0.000023
count total (s) self (s)
1 0.000002 let cmd = "map"
1 0.000001 if a:mode ==# "!"
let cmd = cmd . "!"
elseif a:mode =~# "[nvoicsxl]"
1 0.000002 let cmd = a:mode . cmd
1 0.000001 endif
1 0.000194 0.000007 return s:Capture.command(cmd)
FUNCTION <SNR>177_links_to()
Called 1 time
Total time: 0.000017
Self time: 0.000017
count total (s) self (s)
1 0.000017 return matchstr(a:highlight, '^\S\+\s\+xxx links to \zs.*\ze$')
FUNCTION 176()
Called 1332 times
Total time: 0.005523
Self time: 0.005523
count total (s) self (s)
1332 0.004453 return a:val.slot.module
FUNCTION gitgutter#utility#getbufvar()
Called 1 time
Total time: 0.000034
Self time: 0.000034
count total (s) self (s)
1 0.000017 let dict = get(getbufvar(a:buffer, ''), 'gitgutter', {})
1 0.000009 if has_key(dict, a:varname)
1 0.000006 return dict[a:varname]
else
if a:0
return a:1
endif
endif
FUNCTION 390()
Called 10 times
Total time: 0.000981
Self time: 0.000854
count total (s) self (s)
10 0.000105 let mode = get(a:, 1, self._mode)
10 0.000294 0.000167 let op = (mode ==# 'no') ? v:operator : s:U.is_visual(mode) ? 'gv' : ''
10 0.000142 let zv = (&foldopen =~# '\vsearch|all' && mode !=# 'no' ? 'zv' : '')
" NOTE:
" Should I consider o_v, o_V, and o_CTRL-V cases and do not
" <Esc>? <Esc> exists for flexible v:count with using s:cli._vcount1,
" but, if you do not move the cursor while incremental searching,
" there are no need to use <Esc>.
10 0.000050 let esc = self._has_count ? "\<Esc>" : ''
10 0.000053 let register = esc is# '' ? '' : '"' . v:register
10 0.000058 let cnt = self._vcount1 is# 1 ? '' : self._vcount1
10 0.000080 let prefix = esc . register . (esc is# '' ? '' : op) . cnt
10 0.000120 return printf("%s%s%s\<CR>%s", prefix, self._base_key, a:pattern, zv)
FUNCTION <SNR>194__reset()
Called 10 times
Total time: 0.000123
Self time: 0.000123
count total (s) self (s)
10 0.000040 let s:cmdhist = []
10 0.000029 let s:count = 0
10 0.000032 let s:is_match_mode = 0 " <Up>/<Down>: true, <C-n>/<C-p>: false
FUNCTION airline#extensions#tabline#load_theme()
Called 1 time
Total time: 0.010427
Self time: 0.000622
count total (s) self (s)
1 0.000010 if pumvisible()
return
endif
1 0.000014 let colors = get(a:palette, 'tabline', {})
" Theme for tabs on the left
1 0.000016 let l:tab = get(colors, 'airline_tab', a:palette.normal.airline_b)
1 0.000013 let l:tabsel = get(colors, 'airline_tabsel', a:palette.normal.airline_a)
1 0.000015 let l:tabtype = get(colors, 'airline_tabtype', a:palette.visual.airline_a)
1 0.000014 let l:tabfill = get(colors, 'airline_tabfill', a:palette.normal.airline_c)
1 0.000013 let l:tabmod = get(colors, 'airline_tabmod', a:palette.insert.airline_a)
1 0.000016 let l:tabhid = get(colors, 'airline_tabhid', a:palette.normal.airline_c)
1 0.000017 if has_key(a:palette, 'normal_modified') && has_key(a:palette.normal_modified, 'airline_c')
1 0.000014 let l:tabmodu = get(colors, 'airline_tabmod_unsel', a:palette.normal_modified.airline_c)
1 0.000003 else
"Fall back to normal airline_c if modified airline_c isn't present
let l:tabmodu = get(colors, 'airline_tabmod_unsel', a:palette.normal.airline_c)
endif
1 0.000951 0.000024 call airline#highlighter#exec('airline_tab', l:tab)
1 0.000904 0.000025 call airline#highlighter#exec('airline_tabsel', l:tabsel)
1 0.000884 0.000022 call airline#highlighter#exec('airline_tabtype', l:tabtype)
1 0.000884 0.000023 call airline#highlighter#exec('airline_tabfill', l:tabfill)
1 0.000847 0.000024 call airline#highlighter#exec('airline_tabmod', l:tabmod)
1 0.000848 0.000022 call airline#highlighter#exec('airline_tabmod_unsel', l:tabmodu)
1 0.000824 0.000022 call airline#highlighter#exec('airline_tabhid', l:tabhid)
" Theme for tabs on the right
1 0.000017 let l:tabsel_right = get(colors, 'airline_tabsel_right', a:palette.normal.airline_a)
1 0.000015 let l:tab_right = get(colors, 'airline_tab_right', a:palette.inactive.airline_c)
1 0.000014 let l:tabmod_right = get(colors, 'airline_tabmod_right', a:palette.insert.airline_a)
1 0.000014 let l:tabhid_right = get(colors, 'airline_tabhid_right', a:palette.normal.airline_c)
1 0.000018 if has_key(a:palette, 'normal_modified') && has_key(a:palette.normal_modified, 'airline_c')
1 0.000015 let l:tabmodu_right = get(colors, 'airline_tabmod_unsel_right', a:palette.normal_modified.airline_c)
1 0.000003 else
"Fall back to normal airline_c if modified airline_c isn't present
let l:tabmodu_right = get(colors, 'airline_tabmod_unsel_right', a:palette.normal.airline_c)
endif
1 0.000947 0.000064 call airline#highlighter#exec('airline_tab_right', l:tab_right)
1 0.000818 0.000022 call airline#highlighter#exec('airline_tabsel_right', l:tabsel_right)
1 0.000801 0.000022 call airline#highlighter#exec('airline_tabmod_right', l:tabmod_right)
1 0.000746 0.000022 call airline#highlighter#exec('airline_tabhid_right', l:tabhid_right)
1 0.000661 0.000018 call airline#highlighter#exec('airline_tabmod_unsel_right', l:tabmodu_right)
FUNCTION 283()
Called 1 time
Total time: 0.000074
Self time: 0.000066
count total (s) self (s)
1 0.000005 if ! g:incsearch#no_inc_hlsearch
1 0.000025 0.000017 let is_cancel = a:cmdline.exit_code()
1 0.000004 if is_cancel
let @/ = self.pattern
endif
1 0.000011 let &hlsearch = self.hlsearch
1 0.000008 if exists('v:hlsearch')
1 0.000007 let v:hlsearch = self.vhlsearch
1 0.000002 endif
1 0.000002 endif
FUNCTION airline#highlighter#reset_hlcache()
Called 1 time
Total time: 0.000152
Self time: 0.000152
count total (s) self (s)
1 0.000150 let s:hl_groups = {}
FUNCTION <SNR>163_silent_after_search()
Called 1 time
Total time: 0.000123
Self time: 0.000091
count total (s) self (s)
" :h function-search-undo
1 0.000016 let m = get(a:, 1, mode(1))
1 0.000004 if m !=# 'no' " guard for operator-mapping
1 0.000084 0.000052 let cmd = join([ (s:U.is_visual(m) ? "\<Plug>(_incsearch-esc)" : ''), "\<Plug>(_incsearch-hlsearch)", "\<Plug>(_incsearch-searchforward)", (s:U.is_visual(m) ? "\<Plug>(_incsearch-gv)" : '') ], '')
1 0.000010 call feedkeys(cmd, 'm')
1 0.000002 endif
FUNCTION ale_linters#tex#lacheck#GetExecutable()
Called 2 times
Total time: 0.000302
Self time: 0.000088
count total (s) self (s)
2 0.000293 0.000079 return ale#Var(a:buffer, 'tex_lacheck_executable')
FUNCTION 144()
Called 10 times
Total time: 0.000465
Self time: 0.000241
count total (s) self (s)
10 0.000418 0.000194 let self.col = s:_clamp(a:pos, 0, self.length())
10 0.000031 return self
FUNCTION ale#cursor#EchoCursorWarningWithDelay()
Called 447 times
Total time: 0.227827
Self time: 0.011895
count total (s) self (s)
447 0.227130 0.011198 return ale#CallWithCooldown( 'dont_echo_with_delay_until', function('s:EchoWithDelayImpl'), [],)
FUNCTION 263()
Called 9 times
Total time: 0.001680
Self time: 0.000403
count total (s) self (s)
9 0.001451 0.000291 if !a:cmdline.is_input("\<Up>") && !a:cmdline.is_input("\<Down>") && !a:cmdline.is_input("\<C-p>") && !a:cmdline.is_input("\<C-n>")
9 0.000187 0.000070 call s:_reset()
9 0.000020 return
else
if s:count == 0 && empty(s:cmdhist) || s:is_match_mode != s:_should_match_cmdline(a:cmdline)
let cmdline = '^' . a:cmdline.getline()
let s:is_match_mode = s:_should_match_cmdline(a:cmdline)
let s:cmdhist = [a:cmdline.getline()] + (s:is_match_mode ? filter(self.histories(), 'v:val =~ cmdline') : self.histories())
endif
endif
call a:cmdline.setchar("")
if a:cmdline.is_input("\<Down>") || a:cmdline.is_input("\<C-n>")
let s:count = max([s:count - 1, 0])
endif
if a:cmdline.is_input("\<Up>") || a:cmdline.is_input("\<C-p>")
let s:count = min([s:count + 1, len(s:cmdhist)])
endif
call a:cmdline.setline(get(s:cmdhist, s:count, a:cmdline.getline()))
FUNCTION vital#_incsearch#Over#Signals#import()
Called 1 time
Total time: 0.000017
Self time: 0.000017
count total (s) self (s)
1 0.000017 return map({'_vital_depends': '', 'call': '', 'make': '', '_vital_loaded': ''}, 'function("s:" . v:key)')
FUNCTION 146()
Called 9 times
Total time: 0.000081
Self time: 0.000081
count total (s) self (s)
9 0.000072 return join(self.list[self.col+1 : ], '')
FUNCTION incsearch#over#extend#enrich()
Called 1 time
Total time: 0.000007
Self time: 0.000007
count total (s) self (s)
1 0.000007 return extend(a:cli, s:cli)
FUNCTION vital#_incsearch#Over#Commandline#Modules#Paste#import()
Called 1 time
Total time: 0.000008
Self time: 0.000008
count total (s) self (s)
1 0.000008 return map({'make': ''}, 'function("s:" . v:key)')
FUNCTION <SNR>159_Pyeval()
Called 188 times
Total time: 0.094745
Self time: 0.094745
count total (s) self (s)
188 0.000687 if s:using_python3
188 0.093676 return py3eval( a:eval_string )
endif
return pyeval( a:eval_string )
FUNCTION incsearch#detect_case()
Called 9 times
Total time: 0.000934
Self time: 0.000934
count total (s) self (s)
" Ignore \%C, \%U, \%V for smartcase detection
9 0.000256 let p = substitute(a:pattern, s:non_escaped_backslash . '%[CUV]', '', 'g')
" Explicit \c has highest priority
9 0.000144 if p =~# s:non_escaped_backslash . 'c'
return '\c'
endif
9 0.000143 if p =~# s:non_escaped_backslash . 'C' || &ignorecase == s:FALSE
return '\C' " noignorecase or explicit \C
endif
9 0.000038 if &smartcase == s:FALSE
return '\c' " ignorecase & nosmartcase
endif
" Find uppercase letter which isn't escaped
9 0.000156 if p =~# s:escaped_backslash . '[A-Z]'
9 0.000029 return '\C' " smartcase with [A-Z]
else
return '\c' " smartcase without [A-Z]
endif
FUNCTION vital#_incsearch#Over#Commandline#Modules#History#import()
Called 1 time
Total time: 0.000009
Self time: 0.000009
count total (s) self (s)
1 0.000008 return map({'make': ''}, 'function("s:" . v:key)')
FUNCTION <SNR>173_call()
Called 49 times
Total time: 0.501458
Self time: 0.009908
count total (s) self (s)
49 0.000375 let args = get(a:, 1, [])
49 0.000308 let def = get(a:, 2, 0)
49 0.500689 0.009139 return map(copy(a:list), "has_key(v:val, a:func) ? call(v:val.".a:func.", args, v:val) : def")
FUNCTION <SNR>159_PollCompletion()
Called 94 times
Total time: 0.056880
Self time: 0.004813
count total (s) self (s)
94 0.046685 0.001786 if !s:Pyeval( 'ycm_state.CompletionRequestReady()' )
76 0.001611 let s:pollers.completion.id = timer_start( s:pollers.completion.wait_milliseconds, function( 's:PollCompletion' ) )
76 0.000153 return
endif
18 0.006797 0.000231 let response = s:Pyeval( 'ycm_state.GetCompletionResponse()' )
18 0.000218 let s:completion = { 'start_column': response.completion_start_column, 'candidates': response.completions }
18 0.000782 0.000180 call s:Complete()
FUNCTION ale#job#Start()
Called 4 times
Total time: 0.021445
Self time: 0.020780
count total (s) self (s)
4 0.000140 0.000070 call ale#job#ValidateArguments(a:command, a:options)
4 0.000051 let l:job_info = copy(a:options)
4 0.000024 let l:job_options = {}
4 0.000044 if has('nvim')
if has_key(a:options, 'out_cb')
let l:job_options.on_stdout = function('s:NeoVimCallback')
let l:job_info.out_cb_line = ''
endif
if has_key(a:options, 'err_cb')
let l:job_options.on_stderr = function('s:NeoVimCallback')
let l:job_info.err_cb_line = ''
endif
if has_key(a:options, 'exit_cb')
let l:job_options.on_exit = function('s:NeoVimCallback')
endif
let l:job_info.job = jobstart(a:command, l:job_options)
let l:job_id = l:job_info.job
else
4 0.000060 let l:job_options = { 'in_mode': l:job_info.mode, 'out_mode': l:job_info.mode, 'err_mode': l:job_info.mode,}
4 0.000032 if has_key(a:options, 'out_cb')
4 0.000056 let l:job_options.out_cb = function('s:VimOutputCallback')
4 0.000010 endif
4 0.000028 if has_key(a:options, 'err_cb')
let l:job_options.err_cb = function('s:VimErrorCallback')
endif
4 0.000026 if has_key(a:options, 'exit_cb')
" Set a close callback to which simply calls job_status()
" when the channel is closed, which can trigger the exit callback
" earlier on.
4 0.000050 let l:job_options.close_cb = function('s:VimCloseCallback')
4 0.000052 let l:job_options.exit_cb = function('s:VimExitCallback')
4 0.000009 endif
" Vim 8 will read the stdin from the file's buffer.
4 0.019084 let l:job_info.job = job_start(a:command, l:job_options)
4 0.001126 0.000531 let l:job_id = ale#job#ParseVim8ProcessID(string(l:job_info.job))
4 0.000014 endif
4 0.000021 if l:job_id > 0
" Store the job in the map for later only if we can get the ID.
4 0.000082 let s:job_map[l:job_id] = l:job_info
4 0.000010 endif
4 0.000046 return l:job_id
FUNCTION <SNR>142_GatherOutput()
Called 528 times
Total time: 0.004743
Self time: 0.004743
count total (s) self (s)
528 0.001707 if has_key(s:job_info_map, a:job_id)
528 0.002246 call add(s:job_info_map[a:job_id].output, a:line)
528 0.000456 endif
FUNCTION airline#extensions#ale#get_warning()
Called 548 times
Total time: 0.108576
Self time: 0.007660
count total (s) self (s)
548 0.108003 0.007087 return airline#extensions#ale#get('warning')
FUNCTION <SNR>177_get()
Called 1 time
Total time: 0.000325
Self time: 0.000033
count total (s) self (s)
1 0.000004 if !hlexists(a:name)
return {}
endif
1 0.000308 0.000016 let result = s:parse(substitute(s:capture(a:name), "\n", "", "g"))
1 0.000003 if has_key(result, "link") && get(a:, 1, 0)
return s:get(result.link, get(a:, 1, 0))
else
1 0.000001 return result
endif
FUNCTION <SNR>191_get_cmdline()
Called 1 time
Total time: 0.000010
Self time: 0.000010
count total (s) self (s)
1 0.000003 if !exists("s:cmdline")
execute s:E.throw_cmd("Undefined cmdline object.", "Over.Commandline.Modules.Doautocmd")
endif
1 0.000002 return s:cmdline
FUNCTION airline#builder#new()
Called 2 times
Total time: 0.000098
Self time: 0.000098
count total (s) self (s)
2 0.000019 let builder = copy(s:prototype)
2 0.000010 let builder._context = a:context
2 0.000007 let builder._sections = []
2 0.000033 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')
2 0.000005 return builder
FUNCTIONS SORTED ON TOTAL TIME
count total (s) self (s) function
875 0.990601 0.076902 ale#CallWithCooldown()
426 0.715933 0.017642 ale#cursor#EchoCursorWarning()
426 0.649379 0.051218 <SNR>156_EchoImpl()
1 0.622356 0.000251 incsearch#_go()
1 0.576751 0.000041 <SNR>163_get_input()
1 0.576703 0.000054 107()
1 0.576626 0.000019 105()
1 0.576607 0.000407 121()
49 0.559373 0.001328 90()
9 0.521836 0.000427 120()
49 0.513402 0.001177 170()
49 0.501458 0.009908 <SNR>173_call()
444 0.416248 0.056871 camelcasemotion#Motion()
4 0.405051 0.000341 <SNR>146_VimCloseCallback()
4 0.404615 0.000510 <SNR>146_VimExitCallback()
8 0.404065 0.000756 <SNR>142_HandleExit()
9 0.401534 0.000202 97()
4 0.378159 0.010875 <SNR>142_HandleLoclist()
9 0.376942 0.001115 209()
9 0.375059 0.374676 <SNR>184__redraw()
FUNCTIONS SORTED ON SELF TIME
count total (s) self (s) function
9 0.375059 0.374676 <SNR>184__redraw()
444 0.359377 <SNR>217_Move()
426 0.277056 ale#util#BinarySearch()
547 0.230623 0.131643 airline#check_mode()
1782 0.128555 ale#Var()
37 0.159142 0.121814 <SNR>159_InvokeCompletion()
3829 0.110026 airline#util#append()
4972 0.109048 ale#util#LocItemCompare()
363 0.096345 <SNR>156_EchoWithShortMess()
188 0.094745 <SNR>159_Pyeval()
446 0.141687 0.079023 <SNR>159_OnCursorMovedNormalMode()
875 0.990601 0.076902 ale#CallWithCooldown()
483 0.106838 0.071716 <SNR>121_wordcount_update()
879 0.247311 0.066492 ale#ShouldDoNothing()
550 0.101097 0.058630 airline#extensions#ale#get()
37 0.057341 <SNR>159_InsideCommentOrString()
444 0.416248 0.056871 camelcasemotion#Motion()
484 0.058613 0.051831 <SNR>159_AllowedToCompleteInBuffer()
426 0.649379 0.051218 <SNR>156_EchoImpl()
549 0.048437 airline#parts#ffenc()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment