aboutsummaryrefslogtreecommitdiffstats
path: root/plugin/better_autoread.vim
diff options
context:
space:
mode:
authorTeddy Wing2019-05-25 00:01:23 +0200
committerTeddy Wing2019-05-25 00:01:23 +0200
commitcc86bdf4af5212a3b2a7960e65c402eac71091c1 (patch)
tree39c8bff2f7bfb831434c560fdc8c1dc3b8eb1c45 /plugin/better_autoread.vim
parent66ab9229f4bf73410f4bef8fb6b1785a852bd4c7 (diff)
downloaddotvim-cc86bdf4af5212a3b2a7960e65c402eac71091c1.tar.bz2
plugin/better_autoread.vim: Disable automatic `checktime` on Vim 8
I kept getting E211 errors when switching Git branches with added/missing files or E321 errors. Normally, I'd get the error once, dismiss it, and be done with it, but on a new machine with a recent Vim install, the errors kept coming back up every few seconds, insupportable. Unless I can think of something better, take a heavy-handed approach and disable this on new Vims.
Diffstat (limited to 'plugin/better_autoread.vim')
-rw-r--r--plugin/better_autoread.vim29
1 files changed, 16 insertions, 13 deletions
diff --git a/plugin/better_autoread.vim b/plugin/better_autoread.vim
index e8625a1..73eae6c 100644
--- a/plugin/better_autoread.vim
+++ b/plugin/better_autoread.vim
@@ -7,16 +7,19 @@
" http://stackoverflow.com/a/10962191
set autoread
-augroup checktime
- autocmd!
- if !has("gui_running")
- "silent! necessary otherwise throws errors when using command
- "line window.
- autocmd BufEnter * silent! checktime
- autocmd CursorHold * silent! checktime
- autocmd CursorHoldI * silent! checktime
- "these two _may_ slow things down. Remove if they do.
- " autocmd CursorMoved * silent! checktime
- " autocmd CursorMovedI * silent! checktime
- endif
-augroup END
+
+if v:version <# 800
+ augroup checktime
+ autocmd!
+ if !has("gui_running")
+ "silent! necessary otherwise throws errors when using command
+ "line window.
+ autocmd BufEnter * silent! checktime
+ autocmd CursorHold * silent! checktime
+ autocmd CursorHoldI * silent! checktime
+ "these two _may_ slow things down. Remove if they do.
+ " autocmd CursorMoved * silent! checktime
+ " autocmd CursorMovedI * silent! checktime
+ endif
+ augroup END
+endif