patch 9.1.0599: Termdebug: still get E1023 when specifying arguments

Commit: 
https://github.com/vim/vim/commit/aef6179bcf04918002103528651996c754c03840
Author: zeertzjq <zeert...@outlook.com>
Date:   Thu Jul 18 20:35:42 2024 +0200

    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 <zeert...@outlook.com>
    Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim 
b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
index 83bcda17d..d1895f4eb 100644
--- a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
+++ b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
@@ -705,7 +705,7 @@ def StartDebug_prompt(dict: dict<any>)
   SendCommand('set breakpoint pending on')
 
   # Set arguments to be run
-  if len(proc_args)
+  if !empty(proc_args)
     SendCommand($'set args {join(proc_args)}')
   endif
 
diff --git a/src/testdir/test_termdebug.vim b/src/testdir/test_termdebug.vim
index 1095e11a3..ef291512a 100644
--- a/src/testdir/test_termdebug.vim
+++ b/src/testdir/test_termdebug.vim
@@ -123,13 +123,13 @@ func Test_termdebug_basic()
   " 60 is approx spaceBuffer * 3
   if winwidth(0) <= 78 + 60
     Var
-    call assert_equal(winnr(), winnr('$'))
-    call assert_equal(winlayout(), ['col', [['leaf', 1002], ['leaf', 1001], 
['leaf', 1000], ['leaf', 1003 + cn]]])
+    call assert_equal(winnr('$'), winnr())
+    call assert_equal(['col', [['leaf', 1002], ['leaf', 1001], ['leaf', 1000], 
['leaf', 1003 + cn]]], winlayout())
     let cn += 1
     bw!
     Asm
-    call assert_equal(winnr(), winnr('$'))
-    call assert_equal(winlayout(), ['col', [['leaf', 1002], ['leaf', 1001], 
['leaf', 1000], ['leaf', 1003 + cn]]])
+    call assert_equal(winnr('$'), winnr())
+    call assert_equal(['col', [['leaf', 1002], ['leaf', 1001], ['leaf', 1000], 
['leaf', 1003 + cn]]], winlayout())
     let cn += 1
     bw!
   endif
@@ -138,16 +138,16 @@ func Test_termdebug_basic()
   let winw = winwidth(0)
   Var
   if winwidth(0) < winw
-    call assert_equal(winnr(), winnr('$') - 1)
-    call assert_equal(winlayout(), ['col', [['leaf', 1002], ['leaf', 1001], 
['row', [['leaf', 1003 + cn], ['leaf', 1000]]]]])
+    call assert_equal(winnr('$') - 1, winnr())
+    call assert_equal(['col', [['leaf', 1002], ['leaf', 1001], ['row', 
[['leaf', 1003 + cn], ['leaf', 1000]]]]], winlayout())
     let cn += 1
     bw!
   endif
   let winw = winwidth(0)
   Asm
   if winwidth(0) < winw
-    call assert_equal(winnr(), winnr('$') - 1)
-    call assert_equal(winlayout(), ['col', [['leaf', 1002], ['leaf', 1001], 
['row', [['leaf', 1003 + cn], ['leaf', 1000]]]]])
+    call assert_equal(winnr('$') - 1, winnr())
+    call assert_equal(['col', [['leaf', 1002], ['leaf', 1001], ['row', 
[['leaf', 1003 + cn], ['leaf', 1000]]]]], winlayout())
     let cn += 1
     bw!
   endif
@@ -160,6 +160,18 @@ func Test_termdebug_basic()
   call WaitForAssert({-> assert_equal(1, winnr('$'))})
   call assert_equal([], sign_getplaced('', #{group: 'TermDebug'})[0].signs)
 
+  for use_prompt in [0, 1]
+    let g:termdebug_config = {}
+    let g:termdebug_config['use_prompt'] = use_prompt
+    TermdebugCommand ./XTD_basic arg args
+    call WaitForAssert({-> assert_equal(3, winnr('$'))})
+    wincmd t
+    quit!
+    redraw!
+    call WaitForAssert({-> assert_equal(1, winnr('$'))})
+    unlet g:termdebug_config
+  endfor
+
   call s:cleanup_files(bin_name)
   %bw!
 endfunc
diff --git a/src/version.c b/src/version.c
index acb4badae..48c7f7428 100644
--- a/src/version.c
+++ b/src/version.c
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    599,
 /**/
     598,
 /**/

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/E1sUW7n-00CQ7q-J8%40256bit.org.

Raspunde prin e-mail lui