mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-08 19:43:52 -05:00
Change implementation of observing, fixes #584
This commit is contained in:
@@ -31,10 +31,10 @@ set cpo&vim
|
|||||||
set nofileignorecase
|
set nofileignorecase
|
||||||
|
|
||||||
func! s:Observe(fn)
|
func! s:Observe(fn)
|
||||||
let b:polyglot_observe = a:fn
|
let b:PolyglotObserve = function("polyglot#" . a:fn)
|
||||||
augroup polyglot-observer
|
augroup polyglot-observer
|
||||||
au! CursorHold,CursorHoldI,BufWritePost <buffer>
|
au! CursorHold,CursorHoldI,BufWritePost <buffer>
|
||||||
\ execute('if polyglot#' . b:polyglot_observe . '() | au! polyglot-observer | endif')
|
\ if b:PolyglotObserve() | au! polyglot-observer | endif
|
||||||
augroup END
|
augroup END
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user