diff options
author | Sean Dewar <seandewar@users.noreply.github.com> | 2023-08-22 22:39:29 +0100 |
---|---|---|
committer | Sean Dewar <seandewar@users.noreply.github.com> | 2023-08-25 11:04:41 +0100 |
commit | 8aad4b84250a6e4d667bd7d15622164cd95fa1af (patch) | |
tree | 7141977d330e0711ad5e239aa26188db56f6c101 | |
parent | 21477bdb27571b6d7c51038192b74a3ec53e8110 (diff) | |
download | rneovim-8aad4b84250a6e4d667bd7d15622164cd95fa1af.tar.gz rneovim-8aad4b84250a6e4d667bd7d15622164cd95fa1af.tar.bz2 rneovim-8aad4b84250a6e4d667bd7d15622164cd95fa1af.zip |
fix(termdebug): send SIGINT when interrupting prompt mode
Unlike Vim's job_stop(), Nvim's jobstop() does not take a signal argument, and
always sends SIGTERM/KILL.
:Stop and Ctrl-C in prompt mode is supposed to interrupt the program like in
terminal mode, not kill GDB.
Also, maybe libuv's kill() works on Windows? If so, the logic above could be
removed, but I don't have a Windows machine available to test that.
Also "set nomodified" when ending prompt mode, like Vim (avoids E37).
-rw-r--r-- | runtime/pack/dist/opt/termdebug/plugin/termdebug.vim | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim index a2c5ba0867..ab569772f5 100644 --- a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim +++ b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim @@ -624,7 +624,7 @@ func s:PromptInterrupt() call debugbreak(s:pid) endif else - call jobstop(s:gdbjob) + call v:lua.vim.uv.kill(jobpid(s:gdbjob), 'sigint') endif endfunc @@ -821,6 +821,7 @@ func s:EndPromptDebug(job_id, exit_code, event) let curwinid = win_getid() call win_gotoid(s:gdbwin) + set nomodified close if curwinid != s:gdbwin call win_gotoid(curwinid) |