summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2021-01-01 17:06:27 +0100
committerAdam Stankiewicz <sheerun@sher.pl>2021-01-01 17:06:27 +0100
commit1f4236df3aaaec797e81572fd120a9d49d4035b9 (patch)
treea8c2a7d51845b2961fff8dcefc4bb94cb0c56bf9
parent7219196dbae4242f8c9c3bb139cce72fe330ef03 (diff)
downloadvim-polyglot-1f4236df3aaaec797e81572fd120a9d49d4035b9.tar.gz
vim-polyglot-1f4236df3aaaec797e81572fd120a9d49d4035b9.zip
Detect filetype only if not set, fixes #656
-rw-r--r--ftdetect/polyglot.vim4
1 files changed, 2 insertions, 2 deletions
diff --git a/ftdetect/polyglot.vim b/ftdetect/polyglot.vim
index 113453af..198e334c 100644
--- a/ftdetect/polyglot.vim
+++ b/ftdetect/polyglot.vim
@@ -2662,11 +2662,11 @@ func! s:Observe(fn)
let b:PolyglotObserve = function("polyglot#" . a:fn)
augroup polyglot-observer
au!
- au CursorHold,CursorHoldI,BufWritePost <buffer> call b:PolyglotObserve()
+ au CursorHold,CursorHoldI <buffer> call b:PolyglotObserve()
augroup END
endfunc
-au BufNewFile,BufRead,StdinReadPost,BufWritePost * if expand("<afile>:e") == "" |
+au BufNewFile,BufRead,StdinReadPost,BufWritePost * if (&ft == "" || &ft == "conf") && expand("<afile>:e") == "" |
\ call polyglot#shebang#Detect() | endif
au BufWinEnter * if &ft == "" && expand("<afile>:e") == "" |