]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.1847: No cmdline completion for :echoconsole and :echowindow v9.1.1847
authorzeertzjq <zeertzjq@outlook.com>
Sun, 12 Oct 2025 14:12:41 +0000 (14:12 +0000)
committerChristian Brabandt <cb@256bit.org>
Sun, 12 Oct 2025 14:12:41 +0000 (14:12 +0000)
Problem:  No cmdline completion for :echoconsole, :echowindow and second
          expression after :echoerr.
Solution: Set EXPAND_EXPRESSION for :echoconsole and :echowindow, and
          check for multiple expressions after :echoerr (zeertzjq).

closes: #18552

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/cmdexpand.c
src/eval.c
src/testdir/test_cmdline.vim
src/version.c

index 0e24d29da49aa62b8b4c24018b5c230a1dc96ab9..104fe08ae8a6e1b4d104d1f3d3ec79475b22e874 100644 (file)
@@ -2482,6 +2482,8 @@ set_context_by_cmdname(
        case CMD_execute:
        case CMD_echomsg:
        case CMD_echoerr:
+       case CMD_echoconsole:
+       case CMD_echowindow:
        case CMD_call:
        case CMD_return:
        case CMD_cexpr:
index 38979b08224baaf8c432beaf6f66466b38363b27..b3bf9d5931b702d727f0e48d4ebec27e01eb88f7 100644 (file)
@@ -3113,6 +3113,8 @@ set_context_for_expression(
                || cmdidx == CMD_echo
                || cmdidx == CMD_echon
                || cmdidx == CMD_echomsg
+               || cmdidx == CMD_echoerr
+               || cmdidx == CMD_echoconsole
                || cmdidx == CMD_echowindow)
            && xp->xp_context == EXPAND_EXPRESSION)
     {
index bdba4abff1227e689b1718ea2f27a243433b874d..58629b5fddbeef5f63e315ab50a075e3904568d2 100644 (file)
@@ -1333,11 +1333,12 @@ endfunc
 
 func Test_cmdline_complete_expression()
   let g:SomeVar = 'blah'
-  for cmd in ['exe', 'echo', 'echon', 'echomsg']
+  for cmd in ['exe', 'echo', 'echon', 'echomsg', 'echoerr',
+        \ 'echoconsole', 'echowindow']
     call feedkeys(":" .. cmd .. " SomeV\<Tab>\<C-B>\"\<CR>", 'tx')
-    call assert_match('"' .. cmd .. ' SomeVar', @:)
+    call assert_match('"' .. cmd .. ' SomeVar', @:, cmd)
     call feedkeys(":" .. cmd .. " foo SomeV\<Tab>\<C-B>\"\<CR>", 'tx')
-    call assert_match('"' .. cmd .. ' foo SomeVar', @:)
+    call assert_match('"' .. cmd .. ' foo SomeVar', @:, cmd)
   endfor
   unlet g:SomeVar
 endfunc
index 47d7e9f7585d917e6b33ac8ca2078af0cc76eebd..2dd8c9764a3ad66fa892dad72931a83ed016b44d 100644 (file)
@@ -729,6 +729,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1847,
 /**/
     1846,
 /**/