From 6b663ec330356e92de9c68a6dac09a80a2d5b07c Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Sat, 17 Oct 2020 13:49:45 +0200 Subject: Change implementation of observing, fixes #584 --- ftdetect/polyglot.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ftdetect') diff --git a/ftdetect/polyglot.vim b/ftdetect/polyglot.vim index ed800dab..0ff59e1b 100644 --- a/ftdetect/polyglot.vim +++ b/ftdetect/polyglot.vim @@ -31,10 +31,10 @@ set cpo&vim set nofileignorecase func! s:Observe(fn) - let b:polyglot_observe = a:fn + let b:PolyglotObserve = function("polyglot#" . a:fn) augroup polyglot-observer au! CursorHold,CursorHoldI,BufWritePost - \ execute('if polyglot#' . b:polyglot_observe . '() | au! polyglot-observer | endif') + \ if b:PolyglotObserve() | au! polyglot-observer | endif augroup END endfunc -- cgit v1.2.3