Skip to content

Commit aef6179

Browse files
zeertzjqchrisbra
authored andcommitted
patch 9.1.0599: Termdebug: still get E1023 when specifying arguments
Problem: Termdebug: still get E1023 when specifying arguments and using a prompt buffer. Solution: Use empty() instead of len(). Add a test. Fix wrong order of arguments to assert_equal() in Test_termdebug_basic(). (zeertzjq) closes: #15288 Signed-off-by: zeertzjq <[email protected]> Signed-off-by: Christian Brabandt <[email protected]>
1 parent 4266daa commit aef6179

3 files changed

Lines changed: 23 additions & 9 deletions

File tree

runtime/pack/dist/opt/termdebug/plugin/termdebug.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,7 @@ def StartDebug_prompt(dict: dict<any>)
705705
SendCommand('set breakpoint pending on')
706706

707707
# Set arguments to be run
708-
if len(proc_args)
708+
if !empty(proc_args)
709709
SendCommand($'set args {join(proc_args)}')
710710
endif
711711

src/testdir/test_termdebug.vim

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,13 @@ func Test_termdebug_basic()
123123
" 60 is approx spaceBuffer * 3
124124
if winwidth(0) <= 78 + 60
125125
Var
126-
call assert_equal(winnr(), winnr('$'))
127-
call assert_equal(winlayout(), ['col', [['leaf', 1002], ['leaf', 1001], ['leaf', 1000], ['leaf', 1003 + cn]]])
126+
call assert_equal(winnr('$'), winnr())
127+
call assert_equal(['col', [['leaf', 1002], ['leaf', 1001], ['leaf', 1000], ['leaf', 1003 + cn]]], winlayout())
128128
let cn += 1
129129
bw!
130130
Asm
131-
call assert_equal(winnr(), winnr('$'))
132-
call assert_equal(winlayout(), ['col', [['leaf', 1002], ['leaf', 1001], ['leaf', 1000], ['leaf', 1003 + cn]]])
131+
call assert_equal(winnr('$'), winnr())
132+
call assert_equal(['col', [['leaf', 1002], ['leaf', 1001], ['leaf', 1000], ['leaf', 1003 + cn]]], winlayout())
133133
let cn += 1
134134
bw!
135135
endif
@@ -138,16 +138,16 @@ func Test_termdebug_basic()
138138
let winw = winwidth(0)
139139
Var
140140
if winwidth(0) < winw
141-
call assert_equal(winnr(), winnr('$') - 1)
142-
call assert_equal(winlayout(), ['col', [['leaf', 1002], ['leaf', 1001], ['row', [['leaf', 1003 + cn], ['leaf', 1000]]]]])
141+
call assert_equal(winnr('$') - 1, winnr())
142+
call assert_equal(['col', [['leaf', 1002], ['leaf', 1001], ['row', [['leaf', 1003 + cn], ['leaf', 1000]]]]], winlayout())
143143
let cn += 1
144144
bw!
145145
endif
146146
let winw = winwidth(0)
147147
Asm
148148
if winwidth(0) < winw
149-
call assert_equal(winnr(), winnr('$') - 1)
150-
call assert_equal(winlayout(), ['col', [['leaf', 1002], ['leaf', 1001], ['row', [['leaf', 1003 + cn], ['leaf', 1000]]]]])
149+
call assert_equal(winnr('$') - 1, winnr())
150+
call assert_equal(['col', [['leaf', 1002], ['leaf', 1001], ['row', [['leaf', 1003 + cn], ['leaf', 1000]]]]], winlayout())
151151
let cn += 1
152152
bw!
153153
endif
@@ -160,6 +160,18 @@ func Test_termdebug_basic()
160160
call WaitForAssert({-> assert_equal(1, winnr('$'))})
161161
call assert_equal([], sign_getplaced('', #{group: 'TermDebug'})[0].signs)
162162

163+
for use_prompt in [0, 1]
164+
let g:termdebug_config = {}
165+
let g:termdebug_config['use_prompt'] = use_prompt
166+
TermdebugCommand ./XTD_basic arg args
167+
call WaitForAssert({-> assert_equal(3, winnr('$'))})
168+
wincmd t
169+
quit!
170+
redraw!
171+
call WaitForAssert({-> assert_equal(1, winnr('$'))})
172+
unlet g:termdebug_config
173+
endfor
174+
163175
call s:cleanup_files(bin_name)
164176
%bw!
165177
endfunc

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,8 @@ static char *(features[]) =
704704

705705
static int included_patches[] =
706706
{ /* Add new patch number below this line */
707+
/**/
708+
599,
707709
/**/
708710
598,
709711
/**/

0 commit comments

Comments
 (0)