Skip to content

Commit

Permalink
Detect filetype only if not set, fixes #656
Browse files Browse the repository at this point in the history
  • Loading branch information
sheerun committed Jan 1, 2021
1 parent 7219196 commit 1f4236d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ftdetect/polyglot.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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") == "" |
Expand Down

0 comments on commit 1f4236d

Please sign in to comment.