aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-12-15 06:27:49 +0800
committerGitHub <noreply@github.com>2023-12-15 06:27:49 +0800
commit046efa106e93303bc848edf63887b3bc0889b535 (patch)
tree7a6f439a724ad180f9176562a0c4d18db3df7d89 /runtime
parentef38fdfdc6c84abd8ce7be02eaf8edc91ebc7917 (diff)
downloadrneovim-046efa106e93303bc848edf63887b3bc0889b535.tar.gz
rneovim-046efa106e93303bc848edf63887b3bc0889b535.tar.bz2
rneovim-046efa106e93303bc848edf63887b3bc0889b535.zip
vim-patch:323dda1484d9 (#26583)
runtime(termdebug): add Tbreak command closes: vim/vim#13656 https://github.com/vim/vim/commit/323dda1484d95ee5c8a1b2205f8c495446df75ee Co-authored-by: iam28th <artyom28th@gmail.com>
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/nvim_terminal_emulator.txt9
-rw-r--r--runtime/pack/dist/opt/termdebug/plugin/termdebug.vim11
2 files changed, 16 insertions, 4 deletions
diff --git a/runtime/doc/nvim_terminal_emulator.txt b/runtime/doc/nvim_terminal_emulator.txt
index dbc14f5a44..67e5e53c95 100644
--- a/runtime/doc/nvim_terminal_emulator.txt
+++ b/runtime/doc/nvim_terminal_emulator.txt
@@ -283,8 +283,13 @@ gdb:
`:Run` [args] run the program with [args] or the previous arguments
`:Arguments` {args} set arguments for the next `:Run`
- *:Break* set a breakpoint at the current line; a sign will be displayed
- *:Clear* delete the breakpoint at the current line
+ *:Break* set a breakpoint at the cursor position
+ :Break {position}
+ set a breakpoint at the specified position
+ *:Tbreak* set a temporary breakpoint at the cursor position
+ :Tbreak {position}
+ set a temporary breakpoint at the specified position
+ *:Clear* delete the breakpoint at the cursor position
*:Step* execute the gdb "step" command
*:Over* execute the gdb "next" command (`:Next` is a Vim command)
diff --git a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
index 1b5baa9a8b..ee2dc4478e 100644
--- a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
+++ b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
@@ -985,6 +985,7 @@ func s:InstallCommands()
set cpo&vim
command -nargs=? Break call s:SetBreakpoint(<q-args>)
+ command -nargs=? Tbreak call s:SetBreakpoint(<q-args>, v:true)
command Clear call s:ClearBreakpoint()
command Step call s:SendResumingCommand('-exec-step')
command Over call s:SendResumingCommand('-exec-next')
@@ -1093,6 +1094,7 @@ endfunc
" Delete installed debugger commands in the current window.
func s:DeleteCommands()
delcommand Break
+ delcommand Tbreak
delcommand Clear
delcommand Step
delcommand Over
@@ -1193,7 +1195,7 @@ func s:Until(at)
endfunc
" :Break - Set a breakpoint at the cursor position.
-func s:SetBreakpoint(at)
+func s:SetBreakpoint(at, tbreak=v:false)
" Setting a breakpoint may not work while the program is running.
" Interrupt to make it work.
let do_continue = 0
@@ -1206,7 +1208,12 @@ func s:SetBreakpoint(at)
" Use the fname:lnum format, older gdb can't handle --source.
let at = empty(a:at) ?
\ fnameescape(expand('%:p')) . ':' . line('.') : a:at
- call s:SendCommand('-break-insert ' . at)
+ if a:tbreak
+ let cmd = '-break-insert -t ' . at
+ else
+ let cmd = '-break-insert ' . at
+ endif
+ call s:SendCommand(cmd)
if do_continue
Continue
endif