aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2020-06-02 10:01:50 +1200
committerTom Ryder <tom@sanctum.geek.nz>2020-06-02 10:02:12 +1200
commitdbcf31572ff008157ceacc777f24fff3fe17cad6 (patch)
tree8d5ee2f9299266669cd6248a0a24f5d9de9ea256
parentMerge branch 'hotfix/v0.1.1' (diff)
downloadvim-detect-indent-dbcf31572ff008157ceacc777f24fff3fe17cad6.tar.gz
vim-detect-indent-dbcf31572ff008157ceacc777f24fff3fe17cad6.zip
Check a buffer is worth detecting indent
-rw-r--r--autoload/detect_indent.vim5
1 files changed, 5 insertions, 0 deletions
diff --git a/autoload/detect_indent.vim b/autoload/detect_indent.vim
index 71a43e8..feaa5f9 100644
--- a/autoload/detect_indent.vim
+++ b/autoload/detect_indent.vim
@@ -6,6 +6,11 @@ endfunction
" Entry point for plugin
function! detect_indent#() abort
+ " If this is a special buffer, don't do anything
+ if index(['nofile', 'quickfix', 'help'], &buftype) >= 0
+ return
+ endif
+
" For spaces, we count both the total space-indented lines, and also the
" count of lines indexed by space count, so that if we need to, we can
" figure out a good 'shiftwidth' setting; for tabs, we just count the