diff options
author | Thomas Buckley-Houston | 2017-06-25 14:29:47 +0000 |
---|---|---|
committer | Thomas Buckley-Houston | 2017-06-25 14:31:46 +0000 |
commit | 70939c41f37173873096ec7cd5ad45e32f84b0cb (patch) | |
tree | 81526ab3243b9377cc77e863f0e85ce65406eb76 /autoload | |
parent | d29f111ba8ebc1fdeafbe04ab01aab99c8e0e1ca (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.vim | 12 |
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. |