Skip to content

Commit

Permalink
Merge pull request #3620 from bhcleek/lsp/state
Browse files Browse the repository at this point in the history
lsp: handle versions where state() does not exist
  • Loading branch information
bhcleek authored Dec 24, 2023
2 parents 0a9c517 + 9eaaf3b commit 89272ad
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion autoload/go/lsp.vim
Original file line number Diff line number Diff line change
Expand Up @@ -1339,7 +1339,14 @@ function! s:debugasync(timer) abort

" set the timer to try again if Vim is in a state where we don't want to
" change the window.
let l:state = state('a')
if exists('*state')
let l:state = state('a')
else
let l:state = mode(1)
if !(l:state == 'ic' || l:state == 'Rc' || l:state == 'Rvc')
let l:state = ''
endif
endif
let l:mode = mode(1)
if len(l:state) > 0 || l:mode[0] == 'v' || l:mode[0] == 'V' || l:mode[0] == 's' || l:mode =~ 'CTRL-V'
let s:logtimer = timer_start(go#config#DebugLogDelay(), function('s:debugasync', []))
Expand Down

0 comments on commit 89272ad

Please sign in to comment.