rename Make -> Invoke

This commit is contained in:
Stefan Liebl 2025-03-19 09:14:50 +01:00
parent ab7c371331
commit f9946dc806

View File

@ -86,9 +86,9 @@ function! s:ProjectSet(project_type, project_base_dir)
\ statusline=%t\ [%{g:asyncrun_status}]\ %{exists('w:quickfix_title')?\ '\ '.w:quickfix_title\ :\ ''}\ %=%-15(%l,%c%V%)\ %P \ statusline=%t\ [%{g:asyncrun_status}]\ %{exists('w:quickfix_title')?\ '\ '.w:quickfix_title\ :\ ''}\ %=%-15(%l,%c%V%)\ %P
augroup END augroup END
" ==== " ======
" Make " Invoke
" ==== " ======
compiler gcc compiler gcc
let g:BuildType = 'Debug' let g:BuildType = 'Debug'
@ -130,16 +130,16 @@ function! s:ProjectSet(project_type, project_base_dir)
return commandline return commandline
endfunction endfunction
" Tab completion for MakeCmd is done by bash-completion " Tab completion for Invoke is done by bash-completion
function! GetAllMakeCompletions(ArgLead, CmdLine, CursorPos) function! GetAllInvokeCompletions(ArgLead, CmdLine, CursorPos)
let l:words = split(a:CmdLine) let l:words = split(a:CmdLine)
let l:words[0] = 'invoke' let l:words[0] = 'invoke'
let l:command = join(l:words) let l:command = join(l:words)
return bash#complete(l:command) return bash#complete(l:command)
endfunction endfunction
command! -complete=customlist,GetAllMakeCompletions -nargs=* MakeCmd call s:Make('<args>', 'async') command! -complete=customlist,GetAllInvokeCompletions -nargs=* Invoke call s:Invoke('<args>', 'async')
function! s:Make(args, async_mode) function! s:Invoke(args, async_mode)
" Add defaults for options " Add defaults for options
let l:options = s:SetDefaultsForAllOptions(a:args) let l:options = s:SetDefaultsForAllOptions(a:args)
@ -164,17 +164,17 @@ function! s:ProjectSet(project_type, project_base_dir)
" Get some configurations from the project " Get some configurations from the project
" ---------------------------------------- " ----------------------------------------
let l:tasks = s:Make('--list', 'sync') let l:tasks = s:Invoke('--list', 'sync')
let g:DebugRemote = (l:tasks =~ 'gdb-server') let g:DebugRemote = (l:tasks =~ 'gdb-server')
let g:ProjectBuildDir = s:Make('build-dir', 'sync') let g:ProjectBuildDir = s:Invoke('get-build-dir', 'sync')
" Fallback " Fallback
if g:ProjectBuildDir == '' if g:ProjectBuildDir == ''
let g:ProjectBuildDir = s:ProjectBaseDir.'.build/'.g:project_type let g:ProjectBuildDir = s:ProjectBaseDir.'.build/'.g:project_type
endif endif
let g:Elffile = s:Make('elf-file', 'sync') let g:Elffile = s:Invoke('get-elf-file', 'sync')
let l:is_arm = s:Make('is-arm', 'sync') let l:is_arm = s:Invoke('is-arm', 'sync')
let g:termdebug_config = {} let g:termdebug_config = {}
if l:is_arm =~ 'True' if l:is_arm =~ 'True'
if g:project_type == 'topmode' || g:project_type == 'dlcpro' if g:project_type == 'topmode' || g:project_type == 'dlcpro'
@ -221,16 +221,12 @@ function! s:ProjectSet(project_type, project_base_dir)
" let g:DebugRemote = v:true " let g:DebugRemote = v:true
" let g:GdbPort = '6666' " let g:GdbPort = '6666'
" let g:SshOpts = '-o ForwardAgent=yes -o ProxyCommand="ssh -o RemoteCommand=none -q -W shg:22 root@%h" -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=ERROR' " let g:SshOpts = '-o ForwardAgent=yes -o ProxyCommand="ssh -o RemoteCommand=none -q -W shg:22 root@%h" -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=ERROR'
" let g:SshOpts2 = "-L localhost:1998:localhost:1998 -L localhost:1999:localhost:1999" " let g:SshOpts2 = '-L localhost:1998:localhost:1998 -L localhost:1999:localhost:1999'
elseif (g:project_type == 'dlcpro-gui')
command! DlcProGuiStart execute("!~/dlcpro/pc-gui/start-gui&")
elseif (g:project_type == 'topmode') elseif (g:project_type == 'topmode')
let g:DeviceIP = 'topmode_stefan' let g:DeviceIP = 'topmode_stefan'
let g:PowerswitchIP = 'elab-stefan' let g:PowerswitchIP = 'elab-stefan'
let g:Powerplug = '3' let g:Powerplug = '3'
command! TopmodeGuiStart execute("!~/topmode/pc-gui/start-gui&") command! TopmodeGuiStart execute("!~/topmode/pc-gui/start-gui&")
elseif (g:project_type == 'topmode-gui')
command! TopmodeGuiStart execute("!~/topmode/pc-gui/start-gui&")
elseif (g:project_type == 'operation-panel-f1') elseif (g:project_type == 'operation-panel-f1')
let g:stm32_target = 'STM32F10X' let g:stm32_target = 'STM32F10X'
elseif (g:project_type == 'operation-panel-f4') elseif (g:project_type == 'operation-panel-f4')
@ -238,9 +234,9 @@ function! s:ProjectSet(project_type, project_base_dir)
endif endif
function! s:DeviceFirmwareUpdate() function! s:DeviceFirmwareUpdate()
call s:Make('kill', 'bang') call s:Invoke('kill', 'bang')
call s:Make('flash', 'bang') call s:Invoke('flash', 'bang')
call s:Make('run', 'bang') call s:Invoke('run', 'bang')
endfunction endfunction
function! g:JLinkSWOviewer() function! g:JLinkSWOviewer()
@ -266,13 +262,13 @@ function! s:ProjectSet(project_type, project_base_dir)
command! DeviceDebugAttach call s:DeviceDebug(1) command! DeviceDebugAttach call s:DeviceDebug(1)
function! s:DeviceDebug(attach) function! s:DeviceDebug(attach)
if g:DebugRemote if g:DebugRemote
call s:Make('kill', 'bang') call s:Invoke('kill', 'bang')
" Close quickfix window " Close quickfix window
execute 'cclose' execute 'cclose'
autocmd! User TermdebugStartPre autocmd! User TermdebugStartPre
autocmd! User TermdebugStartPost autocmd! User TermdebugStartPost
autocmd! User TermdebugStopPost autocmd! User TermdebugStopPost
call s:Make('gdb-server', 'background') call s:Invoke('gdb-server', 'background')
sleep 2 sleep 2
let s:gdb_connect_script = g:ProjectBuildDir.'/gdbinit' let s:gdb_connect_script = g:ProjectBuildDir.'/gdbinit'
if file_readable(s:gdb_connect_script) if file_readable(s:gdb_connect_script)
@ -285,8 +281,8 @@ function! s:ProjectSet(project_type, project_base_dir)
else else
call s:StartDebugger(g:Elffile, a:attach) call s:StartDebugger(g:Elffile, a:attach)
call s:SendToDebugger('file '.g:Elffile) call s:SendToDebugger('file '.g:Elffile)
call s:SendToDebugger('break main') " call s:SendToDebugger('break main')
call s:SendToDebugger('run') " call s:SendToDebugger('run')
endif endif
endfunction endfunction