mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-11 13:03:50 -05:00
Detect filetype only if not set, fixes #656
This commit is contained in:
@@ -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") == "" |
|
||||||
|
|||||||
Reference in New Issue
Block a user