Detect filetype only if not set, fixes #656

This commit is contained in:
Adam Stankiewicz
2021-01-01 17:06:27 +01:00
parent 7219196dba
commit 1f4236df3a

View File

@@ -2662,11 +2662,11 @@ func! s:Observe(fn)
let b:PolyglotObserve = function("polyglot#" . a:fn) let b:PolyglotObserve = function("polyglot#" . a:fn)
augroup polyglot-observer augroup polyglot-observer
au! au!
au CursorHold,CursorHoldI,BufWritePost <buffer> call b:PolyglotObserve() au CursorHold,CursorHoldI <buffer> call b:PolyglotObserve()
augroup END augroup END
endfunc 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 \ call polyglot#shebang#Detect() | endif
au BufWinEnter * if &ft == "" && expand("<afile>:e") == "" | au BufWinEnter * if &ft == "" && expand("<afile>:e") == "" |