1
0
forked from aniani/vim

Update runtime files

This commit is contained in:
Bram Moolenaar
2021-12-24 13:18:38 +00:00
parent d3f00f54bf
commit fa3b72348d
29 changed files with 1669 additions and 1206 deletions

View File

@@ -98,6 +98,10 @@ call s:Highlight(1, '', &background)
hi default debugBreakpoint term=reverse ctermbg=red guibg=red
hi default debugBreakpointDisabled term=reverse ctermbg=gray guibg=gray
func s:GetCommand()
return type(g:termdebugger) == v:t_list ? copy(g:termdebugger) : [g:termdebugger]
endfunc
func s:StartDebug(bang, ...)
" First argument is the command to debug, second core file or process ID.
call s:StartDebug_internal({'gdb_args': a:000, 'bang': a:bang})
@@ -113,8 +117,9 @@ func s:StartDebug_internal(dict)
echoerr 'Terminal debugger already running, cannot run two'
return
endif
if !executable(g:termdebugger)
echoerr 'Cannot execute debugger program "' .. g:termdebugger .. '"'
let gdbcmd = s:GetCommand()
if !executable(gdbcmd[0])
echoerr 'Cannot execute debugger program "' .. gdbcmd[0] .. '"'
return
endif
@@ -188,7 +193,7 @@ endfunc
func s:CheckGdbRunning()
let gdbproc = term_getjob(s:gdbbuf)
if gdbproc == v:null || job_status(gdbproc) !=# 'run'
echoerr string(g:termdebugger) . ' exited unexpectedly'
echoerr string(s:GetCommand()[0]) . ' exited unexpectedly'
call s:CloseBuffers()
return ''
endif
@@ -233,7 +238,7 @@ func s:StartDebug_term(dict)
let gdb_args = get(a:dict, 'gdb_args', [])
let proc_args = get(a:dict, 'proc_args', [])
let gdb_cmd = [g:termdebugger]
let gdb_cmd = s:GetCommand()
" Add -quiet to avoid the intro message causing a hit-enter prompt.
let gdb_cmd += ['-quiet']
" Disable pagination, it causes everything to stop at the gdb
@@ -364,7 +369,7 @@ func s:StartDebug_prompt(dict)
let gdb_args = get(a:dict, 'gdb_args', [])
let proc_args = get(a:dict, 'proc_args', [])
let gdb_cmd = [g:termdebugger]
let gdb_cmd = s:GetCommand()
" Add -quiet to avoid the intro message causing a hit-enter prompt.
let gdb_cmd += ['-quiet']
" Disable pagination, it causes everything to stop at the gdb, needs to be run early