summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2020-10-24 16:54:55 +0200
committerAdam Stankiewicz <sheerun@sher.pl>2020-10-24 16:54:55 +0200
commitb6654c85b28b1fbaec56ccfda085afb7c1a06875 (patch)
treef1ca2c98fe5429f54818a069967d1bfa82be28bd
parente3609fed6b1c771f06c9c7e94df9096318dd65f6 (diff)
downloadvim-polyglot-b6654c85b28b1fbaec56ccfda085afb7c1a06875.tar.gz
vim-polyglot-b6654c85b28b1fbaec56ccfda085afb7c1a06875.zip
Fix shortcuts in plugins, fixes #566
-rw-r--r--ftdetect/polyglot.vim24
1 files changed, 14 insertions, 10 deletions
diff --git a/ftdetect/polyglot.vim b/ftdetect/polyglot.vim
index 15bd5a0f..e345dc6d 100644
--- a/ftdetect/polyglot.vim
+++ b/ftdetect/polyglot.vim
@@ -25,14 +25,6 @@ let did_load_filetypes = 1
" Be consistent across different systems
set nofileignorecase
-func! s:Observe(fn)
- let b:PolyglotObserve = function("polyglot#" . a:fn)
- augroup polyglot-observer
- au! CursorHold,CursorHoldI,BufWritePost <buffer>
- \ if b:PolyglotObserve() | au! polyglot-observer | endif
- augroup END
-endfunc
-
let s:disabled_packages = {}
let s:new_polyglot_disabled = []
@@ -112,6 +104,8 @@ func! s:StarSetf(ft)
endif
endfunc
+augroup polyglot-observer | augroup END
+
augroup filetypedetect
" Load user-defined filetype.vim and oter plugins ftdetect first
@@ -2621,12 +2615,22 @@ endif
" DO NOT EDIT CODE ABOVE, IT IS GENERATED WITH MAKEFILE
-au! BufNewFile,BufRead,StdinReadPost * if expand("<afile>:e") == "" |
+func! s:Observe(fn)
+ let b:PolyglotObserve = function("polyglot#" . a:fn)
+ augroup polyglot-observer
+ au!
+ au CursorHold,CursorHoldI,BufWritePost <buffer> call b:PolyglotObserve()
+ augroup END
+endfunc
+
+au BufNewFile,BufRead,StdinReadPost * if expand("<afile>:e") == "" |
\ call polyglot#shebang#Detect() | endif
-au BufEnter * if &ft == "" && expand("<afile>:e") == "" |
+au BufWinEnter * if &ft == "" && expand("<afile>:e") == "" |
\ call s:Observe('shebang#Detect') | endif
+au FileType * au! polyglot-observer
+
augroup END