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: #start {{{1
|
||||||
function! sy#start(path) abort
|
function! sy#start(path) abort
|
||||||
|
if g:signify_locked
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
if &diff
|
if &diff
|
||||||
\ || !filereadable(a:path)
|
\ || !filereadable(a:path)
|
||||||
\ || (exists('g:signify_skip_filetype') && has_key(g:signify_skip_filetype, &ft))
|
\ || (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
|
if exists('g:loaded_signify') || !has('signs') || &cp
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let g:loaded_signify = 1
|
let g:loaded_signify = 1
|
||||||
|
let g:signify_locked = 0
|
||||||
|
|
||||||
" Init: autocmds {{{1
|
" Init: autocmds {{{1
|
||||||
augroup signify
|
augroup signify
|
||||||
@ -16,6 +18,9 @@ augroup signify
|
|||||||
autocmd BufRead,BufWritePost * call sy#start(b:sy_path)
|
autocmd BufRead,BufWritePost * call sy#start(b:sy_path)
|
||||||
autocmd BufDelete * call sy#stop(expand('<abuf>'))
|
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')
|
if get(g:, 'signify_update_on_bufenter')
|
||||||
autocmd BufEnter * nested
|
autocmd BufEnter * nested
|
||||||
\ if exists('b:sy') && b:sy.active && &modified |
|
\ if exists('b:sy') && b:sy.active && &modified |
|
||||||
|
Loading…
x
Reference in New Issue
Block a user