0
0
mirror of https://github.com/vim/vim.git synced 2025-10-21 08:24:06 -04:00

patch 9.1.1847: No cmdline completion for :echoconsole and :echowindow

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>
This commit is contained in:
zeertzjq
2025-10-12 14:12:41 +00:00
committed by Christian Brabandt
parent 37c8ce7fac
commit 7aaca97fc5
4 changed files with 10 additions and 3 deletions

View 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:

View 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)
{

View 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

View File

@@ -729,6 +729,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1847,
/**/
1846,
/**/