aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2020-11-13 00:00:20 +1300
committerTom Ryder <tom@sanctum.geek.nz>2020-11-13 00:10:18 +1300
commit2d31374387b09861501b7446525f796b82294d9a (patch)
treea570febd24d538144eb9092f0b1601d1640fe449
parentMerge branch 'hotfix/v0.1.2' (diff)
downloadvim-detect-indent-2d31374387b09861501b7446525f796b82294d9a.tar.gz
vim-detect-indent-2d31374387b09861501b7446525f796b82294d9a.zip
Don't run for empty filetypes
-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 feaa5f9..ab3f485 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 there's no filetype, don't do anything
+ if &filetype ==# ''
+ return
+ endif
+
" If this is a special buffer, don't do anything
if index(['nofile', 'quickfix', 'help'], &buftype) >= 0
return