Do not set checktime if already set

This commit is contained in:
Adam Stankiewicz
2020-10-24 17:46:15 +02:00
parent 739102e06d
commit 3c148e9ef5
2 changed files with 11 additions and 6 deletions

View File

@@ -3500,12 +3500,6 @@ if !has_key(s:disabled_packages, 'sensible')
" Disable swap, it doesn't play well with autoread " Disable swap, it doesn't play well with autoread
set noswapfile set noswapfile
" Auto reload if file was changed somewhere else (for autoread)
augroup polyglot-sensible
au!
au CursorHold * checktime
augroup END
" Enable highlighted case-insensitive incremential search. " Enable highlighted case-insensitive incremential search.
set incsearch set incsearch

View File

@@ -67,6 +67,17 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'sensible') == -
set updatetime=300 set updatetime=300
endif endif
" Automatically reload file if changed somewhere else
redir => capture
silent autocmd CursorHold
redir END
if match(capture, 'checktime') == -1
augroup polyglot-sensible
au!
au CursorHold * checktime
augroup END
endif
" Always save upper case variables to viminfo file. " Always save upper case variables to viminfo file.
if !empty(&viminfo) if !empty(&viminfo)
set viminfo^=! set viminfo^=!