aboutsummaryrefslogtreecommitdiff
path: root/autoload
diff options
context:
space:
mode:
authorThomas Buckley-Houston2017-06-25 14:29:47 +0000
committerThomas Buckley-Houston2017-06-25 14:31:46 +0000
commit70939c41f37173873096ec7cd5ad45e32f84b0cb (patch)
tree81526ab3243b9377cc77e863f0e85ce65406eb76 /autoload
parentd29f111ba8ebc1fdeafbe04ab01aab99c8e0e1ca (diff)
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
Diffstat (limited to 'autoload')
-rw-r--r--autoload/novim_mode.vim12
1 files changed, 8 insertions, 4 deletions
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.