Fix using double-quotes in VimspectorEval
The VimspectorEval command used `-bar` but this prevented the use of double quotes. This seems much more useful than a vim comment in this scenario, so remove the `-bar`. This is _techncially_ breaking change, but I don't think it's likely anyone will be relying on doing `VimspectorEval x | something else`. If they are, sorry.
This commit is contained in:
parent
f9c5a33301
commit
11edcddd9c
2 changed files with 44 additions and 1 deletions
|
|
@ -100,7 +100,7 @@ command! -bar -nargs=? -complete=custom,vimspector#CompleteOutput
|
||||||
command! -bar
|
command! -bar
|
||||||
\ VimspectorToggleLog
|
\ VimspectorToggleLog
|
||||||
\ call vimspector#ToggleLog()
|
\ call vimspector#ToggleLog()
|
||||||
command! -bar -nargs=1 -complete=custom,vimspector#CompleteExpr
|
command! -nargs=1 -complete=custom,vimspector#CompleteExpr
|
||||||
\ VimspectorEval
|
\ VimspectorEval
|
||||||
\ call vimspector#Evaluate( <f-args> )
|
\ call vimspector#Evaluate( <f-args> )
|
||||||
command! -bar
|
command! -bar
|
||||||
|
|
|
||||||
|
|
@ -513,6 +513,49 @@ function Test_EvaluateConsole()
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
function Test_EvaluateInput()
|
||||||
|
let fn = 'testdata/cpp/simple/struct.cpp'
|
||||||
|
call s:StartDebugging( #{ fn: fn, line: 24, col: 1, launch: #{
|
||||||
|
\ configuration: 'run-to-breakpoint'
|
||||||
|
\ } } )
|
||||||
|
|
||||||
|
" Make sure the Test t is initialised
|
||||||
|
call vimspector#StepOver()
|
||||||
|
call vimspector#test#signs#AssertCursorIsAtLineInBuffer( fn, 26, 1 )
|
||||||
|
call vimspector#StepOver()
|
||||||
|
call vimspector#test#signs#AssertCursorIsAtLineInBuffer( fn, 27, 1 )
|
||||||
|
|
||||||
|
VimspectorEval -exec print (int) printf("hello")
|
||||||
|
|
||||||
|
call assert_equal( bufnr( 'vimspector.Console' ),
|
||||||
|
\ winbufnr( g:vimspector_session_windows.output ) )
|
||||||
|
call WaitForAssert( {->
|
||||||
|
\ assert_equal(
|
||||||
|
\ [
|
||||||
|
\ ''
|
||||||
|
\ ],
|
||||||
|
\ getbufline( bufnr( 'vimspector.Console' ), '$', '$' )
|
||||||
|
\ )
|
||||||
|
\ } )
|
||||||
|
|
||||||
|
let len = getbufinfo( 'vimspector.Console' )[ 0 ].linecount
|
||||||
|
|
||||||
|
call WaitForAssert( {->
|
||||||
|
\ assert_equal(
|
||||||
|
\ [
|
||||||
|
\ 'Evaluating: -exec print (int) printf("hello")',
|
||||||
|
\ ],
|
||||||
|
\ getbufline( bufnr( 'vimspector.Console' ), len-2, len-2 )
|
||||||
|
\ )
|
||||||
|
\ } )
|
||||||
|
call vimspector#test#signs#AssertCursorIsAtLineInBuffer(
|
||||||
|
\ 'vimspector.Console', len, v:null )
|
||||||
|
|
||||||
|
call vimspector#test#setup#Reset()
|
||||||
|
%bwipe!
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
function Test_EvaluatePromptConsole()
|
function Test_EvaluatePromptConsole()
|
||||||
let fn = 'testdata/cpp/simple/struct.cpp'
|
let fn = 'testdata/cpp/simple/struct.cpp'
|
||||||
call s:StartDebugging( #{ fn: fn, line: 24, col: 1, launch: #{
|
call s:StartDebugging( #{ fn: fn, line: 24, col: 1, launch: #{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue