Improve speed of :vimgrep by using a global lock
This commit is contained in:
parent
c9007b894b
commit
dcae627181
@ -18,6 +18,10 @@ sign define SignifyPlaceholder text=. texthl=SignifySignChange linehl=
|
||||
|
||||
" Function: #start {{{1
|
||||
function! sy#start(path) abort
|
||||
if g:signify_locked
|
||||
return
|
||||
endif
|
||||
|
||||
if &diff
|
||||
\ || !filereadable(a:path)
|
||||
\ || (exists('g:signify_skip_filetype') && has_key(g:signify_skip_filetype, &ft))
|
||||
|
@ -5,7 +5,9 @@ scriptencoding utf-8
|
||||
if exists('g:loaded_signify') || !has('signs') || &cp
|
||||
finish
|
||||
endif
|
||||
|
||||
let g:loaded_signify = 1
|
||||
let g:signify_locked = 0
|
||||
|
||||
" Init: autocmds {{{1
|
||||
augroup signify
|
||||
@ -16,6 +18,9 @@ augroup signify
|
||||
autocmd BufRead,BufWritePost * call sy#start(b:sy_path)
|
||||
autocmd BufDelete * call sy#stop(expand('<abuf>'))
|
||||
|
||||
autocmd QuickFixCmdPre *vimgrep* let g:signify_locked = 1
|
||||
autocmd QuickFixCmdPost *vimgrep* let g:signify_locked = 0
|
||||
|
||||
if get(g:, 'signify_update_on_bufenter')
|
||||
autocmd BufEnter * nested
|
||||
\ if exists('b:sy') && b:sy.active && &modified |
|
||||
|
Loading…
x
Reference in New Issue
Block a user