Skip to content

Commit

Permalink
Fix shortcuts in plugins, fixes #566
Browse files Browse the repository at this point in the history
  • Loading branch information
sheerun committed Oct 24, 2020
1 parent e3609fe commit b6654c8
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions ftdetect/polyglot.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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


Expand Down

0 comments on commit b6654c8

Please sign in to comment.