FUNCTION 40_Highlight_Matching_Pair() Called 1140 times Total time: 0.163684 Self time: 0.163684 count total (s) self (s) " Remove any previous match. 1140 0.009645 if exists('w:paren_hl_on') && w:paren_hl_on silent! call matchdelete(3) let w:paren_hl_on = 0 endif " Avoid that we remove the popup menu. " Return when there are no colors (looks like the cursor jumps). 1140 0.011797 if pumvisible() || (&t_Co < 8 && !has("gui_running")) return endif " Get the character under the cursor and check if it's in 'matchpairs'. 1140 0.006695 let c_lnum = line('.') 1140 0.005694 let c_col = col('.') 1140 0.003825 let before = 0 1140 0.008180 let text = getline(c_lnum) 1140 0.008847 let c = text[c_col - 1] 1140 0.039107 let plist = split(&matchpairs, '.\zs[:,]') 1140 0.009985 let i = index(plist, c) 1140 0.003809 if i < 0 " not found, in Insert mode try character before the cursor 1140 0.006454 if c_col > 1 && (mode() == 'i' || mode() == 'R') let before = 1 let c = text[c_col - 2] let i = index(plist, c) endif 1140 0.002687 if i < 0 " not found, nothing to do 1140 0.002602 return endif endif " Figure out the arguments for searchpairpos(). if i % 2 == 0 let s_flags = 'nW' let c2 = plist[i + 1] else let s_flags = 'nbW' let c2 = c let c = plist[i - 1] endif if c == '[' let c = '\[' let c2 = '\]' endif " Find the match. When it was just before the cursor move it there for a " moment. if before > 0 let has_getcurpos = exists("*getcurpos") if has_getcurpos " getcurpos() is more efficient but doesn't exist before 7.4.313. let save_cursor = getcurpos() else let save_cursor = winsaveview() endif call cursor(c_lnum, c_col - before) endif " Build an expression that detects whether the current cursor position is in " certain syntax types (string, comment, etc.), for use as searchpairpos()'s " skip argument. " We match "escape" for special items, such as lispEscapeSpecial. let s_skip = '!empty(filter(map(synstack(line("."), col(".")), ''synIDattr(v:val, "name")''), ' . '''v:val =~? "string\\|character\\|singlequote\\|escape\\|comment"''))' " If executing the expression determines that the cursor is currently in " one of the syntax types, then we want searchpairpos() to find the pair " within those syntax types (i.e., not skip). Otherwise, the cursor is " outside of the syntax types and s_skip should keep its value so we skip any " matching pair inside the syntax types. execute 'if' s_skip '| let s_skip = 0 | endif' " Limit the search to lines visible in the window. let stoplinebottom = line('w$') let stoplinetop = line('w0') if i % 2 == 0 let stopline = stoplinebottom else let stopline = stoplinetop endif " Limit the search time to 300 msec to avoid a hang on very long lines. " This fails when a timeout is not supported. if mode() == 'i' || mode() == 'R' let timeout = exists("b:matchparen_insert_timeout") ? b:matchparen_insert_timeout : g:matchparen_insert_timeout else let timeout = exists("b:matchparen_timeout") ? b:matchparen_timeout : g:matchparen_timeout endif try let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip, stopline, timeout) catch /E118/ " Can't use the timeout, restrict the stopline a bit more to avoid taking " a long time on closed folds and long lines. " The "viewable" variables give a range in which we can scroll while " keeping the cursor at the same position. " adjustedScrolloff accounts for very large numbers of scrolloff. let adjustedScrolloff = min([&scrolloff, (line('w$') - line('w0')) / 2]) let bottom_viewable = min([line('$'), c_lnum + &lines - adjustedScrolloff - 2]) let top_viewable = max([1, c_lnum-&lines+adjustedScrolloff + 2]) " one of these stoplines will be adjusted below, but the current values are " minimal boundaries within the current window if i % 2 == 0 if has("byte_offset") && has("syntax_items") && &smc > 0 let stopbyte = min([line2byte("$"), line2byte(".") + col(".") + &smc * 2]) let stopline = min([bottom_viewable, byte2line(stopbyte)]) else let stopline = min([bottom_viewable, c_lnum + 100]) endif let stoplinebottom = stopline else if has("byte_offset") && has("syntax_items") && &smc > 0 let stopbyte = max([1, line2byte(".") + col(".") - &smc * 2]) let stopline = max([top_viewable, byte2line(stopbyte)]) else let stopline = max([top_viewable, c_lnum - 100]) endif let stoplinetop = stopline endif let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip, stopline) endtry if before > 0 if has_getcurpos call setpos('.', save_cursor) else call winrestview(save_cursor) endif endif " If a match is found setup match highlighting. if m_lnum > 0 && m_lnum >= stoplinetop && m_lnum <= stoplinebottom if exists('*matchaddpos') call matchaddpos('MatchParen', [[c_lnum, c_col - before], [m_lnum, m_col]], 10, 3) else exe '3match MatchParen /\(\%' . c_lnum . 'l\%' . (c_col - before) . 'c\)\|\(\%' . m_lnum . 'l\%' . m_col . 'c\)/' endif let w:paren_hl_on = 1 endif FUNCTION neomake#CursorMoved() Called 1140 times Total time: 0.339115 Self time: 0.035153 count total (s) self (s) 1140 0.177819 0.019648 call neomake#signs#PlaceVisibleSigns() 1140 0.157780 0.011988 call neomake#EchoCurrentError() FUNCTION neomake#EchoCurrentError() Called 1140 times Total time: 0.145791 Self time: 0.145791 count total (s) self (s) 1140 0.009983 if !get(g:, 'neomake_echo_current_error', 1) return endif 1140 0.009646 if !empty(get(s:, 'neomake_last_echoed_error', {})) unlet s:neomake_last_echoed_error echon '' endif 1140 0.006903 let buf = bufnr('%') 1140 0.006919 let ln = line('.') 1140 0.004495 let ln_errors = [] 3420 0.012907 for maker_type in ['file', 'project'] 2280 0.024354 let buf_errors = get(s:current_errors[maker_type], buf, {}) 2280 0.019394 let ln_errors += get(buf_errors, ln, []) 2280 0.005605 endfor 1140 0.004798 if empty(ln_errors) 1140 0.002988 return endif let s:neomake_last_echoed_error = ln_errors[0] for error in ln_errors if error.type ==# 'E' let s:neomake_last_echoed_error = error break endif endfor let message = s:neomake_last_echoed_error.maker_name.': '.s:neomake_last_echoed_error.text call neomake#utils#WideMessage(message) FUNCTION neomake#signs#PlaceVisibleSigns() Called 1140 times Total time: 0.158171 Self time: 0.158171 count total (s) self (s) 3420 0.027875 for type in ['file', 'project'] 2280 0.021050 let buf = bufnr('%') 2280 0.025937 if !has_key(s:sign_queue[type], buf) 2280 0.011367 continue endif let topline = line('w0') let botline = line('w$') for ln in range(topline, botline) if has_key(s:sign_queue[type][buf], ln) call neomake#signs#PlaceSign(s:sign_queue[type][buf][ln], type) unlet s:sign_queue[type][buf][ln] endif endfor if empty(s:sign_queue[type][buf]) unlet s:sign_queue[type][buf] endif endfor FUNCTIONS SORTED ON TOTAL TIME count total (s) self (s) function 1140 0.339115 0.035153 neomake#CursorMoved() 1140 0.163684 40_Highlight_Matching_Pair() 1140 0.158171 neomake#signs#PlaceVisibleSigns() 1140 0.145791 neomake#EchoCurrentError() FUNCTIONS SORTED ON SELF TIME count total (s) self (s) function 1140 0.163684 40_Highlight_Matching_Pair() 1140 0.158171 neomake#signs#PlaceVisibleSigns() 1140 0.145791 neomake#EchoCurrentError() 1140 0.339115 0.035153 neomake#CursorMoved()