diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-06-09 20:53:04 -0400 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-06-18 18:01:43 -0400 |
commit | 44535d39e9fc13cc069d8dc3a6ca10af22d3c380 (patch) | |
tree | dd2293cb523378c6cb1cffcd376339ebec33bdf0 | |
parent | 33985a3a15fac1486cc11e8df272a0eeaa5fc77d (diff) | |
download | rneovim-44535d39e9fc13cc069d8dc3a6ca10af22d3c380.tar.gz rneovim-44535d39e9fc13cc069d8dc3a6ca10af22d3c380.tar.bz2 rneovim-44535d39e9fc13cc069d8dc3a6ca10af22d3c380.zip |
vim-patch:8.1.1977: terminal debugger plugin may hang
Problem: Terminal debugger plugin may hang.
Solution: Wait longer when still reading symbols.
https://github.com/vim/vim/commit/19c8fe1925f4f7ffa1cc46e64d8bb8b1665ac437
-rw-r--r-- | runtime/pack/dist/opt/termdebug/plugin/termdebug.vim | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim index 28dc3256c7..2898bd991b 100644 --- a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim +++ b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim @@ -247,10 +247,12 @@ func s:StartDebug_term(dict) endif let response = '' - for lnum in range(1,200) - if len(getbufline(s:gdbbuf, lnum)) > 0 && getbufline(s:gdbbuf, lnum)[0] =~ 'new-ui mi ' + for lnum in range(1, 200) + let line1 = get(getbufline(s:gdbbuf, lnum), 0, '') + let line2 = get(getbufline(s:gdbbuf, lnum + 1), 0, '') + if line1 =~ 'new-ui mi ' " response can be in the same line or the next line - let response = getbufline(s:gdbbuf, lnum)[0] . getbufline(s:gdbbuf, lnum + 1)[0] + let response = line1 . line2 if response =~ 'Undefined command' echoerr 'Sorry, your gdb is too old, gdb 7.12 is required' call s:CloseBuffers() @@ -260,10 +262,9 @@ func s:StartDebug_term(dict) " Success! break endif - if response =~ 'Reading symbols from' && response !~ 'new-ui' - " Reading symbols might take a while - let try_count -= 1 - endif + elseif line1 =~ 'Reading symbols from' && line2 !~ 'new-ui mi ' + " Reading symbols might take a while, try more times + let try_count -= 1 endif endfor if response =~ 'New UI allocated' |