From 1f4236df3aaaec797e81572fd120a9d49d4035b9 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Fri, 1 Jan 2021 17:06:27 +0100 Subject: [PATCH] Detect filetype only if not set, fixes #656 --- ftdetect/polyglot.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ftdetect/polyglot.vim b/ftdetect/polyglot.vim index 113453aff..198e334ce 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 call b:PolyglotObserve() + au CursorHold,CursorHoldI call b:PolyglotObserve() augroup END endfunc -au BufNewFile,BufRead,StdinReadPost,BufWritePost * if expand(":e") == "" | +au BufNewFile,BufRead,StdinReadPost,BufWritePost * if (&ft == "" || &ft == "conf") && expand(":e") == "" | \ call polyglot#shebang#Detect() | endif au BufWinEnter * if &ft == "" && expand(":e") == "" |