From 70939c41f37173873096ec7cd5ad45e32f84b0cb Mon Sep 17 00:00:00 2001 From: Thomas Buckley-Houston Date: Sun, 25 Jun 2017 21:29:47 +0700 Subject: Actually compare `has('timers')` to something :/ This properly deals with versions of VIm that don't support timers. So that older versions of Vim still work but run into the bug where some panes get insertmode inappropriately set. Touches #4 --- autoload/novim_mode.vim | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'autoload') diff --git a/autoload/novim_mode.vim b/autoload/novim_mode.vim index f93e29f..90aecc5 100644 --- a/autoload/novim_mode.vim +++ b/autoload/novim_mode.vim @@ -44,10 +44,14 @@ function! s:InsertAndSelectionBehaviour() " Intelligently set/unset insertmode augroup start_insertmode autocmd! - " The timer here delays the call to check whether the current buffer - " is an editable one. Without the delay, the check is often too early - " to correctly get the value of `&buftype`, etc. - autocmd BufEnter * call timer_start(1, {->execute('call s:InsertMode()')}) + if has('timers') == 1 + " The timer here delays the call to check whether the current buffer + " is an editable one. Without the delay, the check is often too early + " to correctly get the value of `&buftype`, etc. + autocmd BufEnter * call timer_start(1, {->execute('call s:InsertMode()')}) + else + autocmd BufEnter * call s:InsertMode() + endif augroup END " Mostly changes the way selection works. -- cgit v1.2.3-70-g09d2