summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-11-27 11:42:50 +0000
committerBram Moolenaar <Bram@vim.org>2021-11-27 11:42:50 +0000
commit279d733dfb838cbabe88c8b8d3549d1493a49bbe (patch)
treef542d7c6ae5d08085afa72cc3de07b2ec227f3d5
parent6304be625ce44dcfedc6735164d0b853578581c8 (diff)
downloadvim-git-279d733dfb838cbabe88c8b8d3549d1493a49bbe.tar.gz
patch 8.2.3683: Vim9: cannot use in :...do commandsv8.2.3683
Problem: Vim9: cannot use in :...do commands. Solution: Add EX_EXPAND to the commands. (closes #9232)
-rw-r--r--src/ex_cmds.h16
-rw-r--r--src/testdir/test_vim9_cmd.vim17
-rw-r--r--src/version.c2
3 files changed, 27 insertions, 8 deletions
diff --git a/src/ex_cmds.h b/src/ex_cmds.h
index 35080dbc6..fcf15ba60 100644
--- a/src/ex_cmds.h
+++ b/src/ex_cmds.h
@@ -145,7 +145,7 @@ EXCMD(CMD_argdelete, "argdelete", ex_argdelete,
EX_BANG|EX_RANGE|EX_FILES|EX_TRLBAR,
ADDR_ARGUMENTS),
EXCMD(CMD_argdo, "argdo", ex_listdo,
- EX_BANG|EX_NEEDARG|EX_EXTRA|EX_NOTRLCOM|EX_RANGE|EX_DFLALL,
+ EX_BANG|EX_NEEDARG|EX_EXTRA|EX_NOTRLCOM|EX_RANGE|EX_DFLALL|EX_EXPAND,
ADDR_ARGUMENTS),
EXCMD(CMD_argedit, "argedit", ex_argedit,
EX_BANG|EX_NEEDARG|EX_RANGE|EX_ZEROR|EX_FILES|EX_CMDARG|EX_ARGOPT|EX_TRLBAR,
@@ -235,7 +235,7 @@ EXCMD(CMD_buffers, "buffers", buflist_list,
EX_BANG|EX_EXTRA|EX_TRLBAR|EX_CMDWIN|EX_LOCK_OK,
ADDR_NONE),
EXCMD(CMD_bufdo, "bufdo", ex_listdo,
- EX_BANG|EX_NEEDARG|EX_EXTRA|EX_NOTRLCOM|EX_RANGE|EX_DFLALL,
+ EX_BANG|EX_NEEDARG|EX_EXTRA|EX_NOTRLCOM|EX_RANGE|EX_DFLALL|EX_EXPAND,
ADDR_BUFFERS),
EXCMD(CMD_bunload, "bunload", ex_bunload,
EX_BANG|EX_RANGE|EX_BUFNAME|EX_COUNT|EX_EXTRA|EX_TRLBAR,
@@ -301,7 +301,7 @@ EXCMD(CMD_cd, "cd", ex_cd,
EX_BANG|EX_FILE1|EX_TRLBAR|EX_CMDWIN|EX_LOCK_OK,
ADDR_NONE),
EXCMD(CMD_cdo, "cdo", ex_listdo,
- EX_BANG|EX_NEEDARG|EX_EXTRA|EX_NOTRLCOM|EX_RANGE|EX_DFLALL,
+ EX_BANG|EX_NEEDARG|EX_EXTRA|EX_NOTRLCOM|EX_RANGE|EX_DFLALL|EX_EXPAND,
ADDR_QUICKFIX_VALID),
EXCMD(CMD_center, "center", ex_align,
EX_TRLBAR|EX_RANGE|EX_WHOLEFOLD|EX_EXTRA|EX_CMDWIN|EX_LOCK_OK|EX_MODIFY,
@@ -313,7 +313,7 @@ EXCMD(CMD_cfile, "cfile", ex_cfile,
EX_TRLBAR|EX_FILE1|EX_BANG,
ADDR_NONE),
EXCMD(CMD_cfdo, "cfdo", ex_listdo,
- EX_BANG|EX_NEEDARG|EX_EXTRA|EX_NOTRLCOM|EX_RANGE|EX_DFLALL,
+ EX_BANG|EX_NEEDARG|EX_EXTRA|EX_NOTRLCOM|EX_RANGE|EX_DFLALL|EX_EXPAND,
ADDR_QUICKFIX_VALID),
EXCMD(CMD_cfirst, "cfirst", ex_cc,
EX_RANGE|EX_COUNT|EX_TRLBAR|EX_BANG,
@@ -838,7 +838,7 @@ EXCMD(CMD_lcscope, "lcscope", ex_cscope,
EX_EXTRA|EX_NOTRLCOM|EX_XFILE,
ADDR_NONE),
EXCMD(CMD_ldo, "ldo", ex_listdo,
- EX_BANG|EX_NEEDARG|EX_EXTRA|EX_NOTRLCOM|EX_RANGE|EX_DFLALL,
+ EX_BANG|EX_NEEDARG|EX_EXTRA|EX_NOTRLCOM|EX_RANGE|EX_DFLALL|EX_EXPAND,
ADDR_QUICKFIX_VALID),
EXCMD(CMD_left, "left", ex_align,
EX_TRLBAR|EX_RANGE|EX_WHOLEFOLD|EX_EXTRA|EX_CMDWIN|EX_LOCK_OK|EX_MODIFY,
@@ -859,7 +859,7 @@ EXCMD(CMD_lfile, "lfile", ex_cfile,
EX_TRLBAR|EX_FILE1|EX_BANG,
ADDR_NONE),
EXCMD(CMD_lfdo, "lfdo", ex_listdo,
- EX_BANG|EX_NEEDARG|EX_EXTRA|EX_NOTRLCOM|EX_RANGE|EX_DFLALL,
+ EX_BANG|EX_NEEDARG|EX_EXTRA|EX_NOTRLCOM|EX_RANGE|EX_DFLALL|EX_EXPAND,
ADDR_QUICKFIX_VALID),
EXCMD(CMD_lfirst, "lfirst", ex_cc,
EX_RANGE|EX_COUNT|EX_TRLBAR|EX_BANG,
@@ -1534,7 +1534,7 @@ EXCMD(CMD_tabclose, "tabclose", ex_tabclose,
EX_BANG|EX_RANGE|EX_ZEROR|EX_EXTRA|EX_NOSPC|EX_TRLBAR|EX_CMDWIN|EX_LOCK_OK,
ADDR_TABS),
EXCMD(CMD_tabdo, "tabdo", ex_listdo,
- EX_NEEDARG|EX_EXTRA|EX_NOTRLCOM|EX_RANGE|EX_DFLALL,
+ EX_NEEDARG|EX_EXTRA|EX_NOTRLCOM|EX_RANGE|EX_DFLALL|EX_EXPAND,
ADDR_TABS),
EXCMD(CMD_tabedit, "tabedit", ex_splitview,
EX_BANG|EX_FILE1|EX_RANGE|EX_ZEROR|EX_CMDARG|EX_ARGOPT|EX_TRLBAR,
@@ -1768,7 +1768,7 @@ EXCMD(CMD_wincmd, "wincmd", ex_wincmd,
EX_NEEDARG|EX_WORD1|EX_RANGE|EX_CMDWIN|EX_LOCK_OK,
ADDR_OTHER),
EXCMD(CMD_windo, "windo", ex_listdo,
- EX_NEEDARG|EX_EXTRA|EX_NOTRLCOM|EX_RANGE|EX_DFLALL,
+ EX_NEEDARG|EX_EXTRA|EX_NOTRLCOM|EX_RANGE|EX_DFLALL|EX_EXPAND,
ADDR_WINDOWS),
EXCMD(CMD_winpos, "winpos", ex_winpos,
EX_EXTRA|EX_TRLBAR|EX_CMDWIN|EX_LOCK_OK,
diff --git a/src/testdir/test_vim9_cmd.vim b/src/testdir/test_vim9_cmd.vim
index 81899d6f0..7a05189db 100644
--- a/src/testdir/test_vim9_cmd.vim
+++ b/src/testdir/test_vim9_cmd.vim
@@ -105,6 +105,23 @@ def Test_edit_wildcards()
var files = ['file 1', 'file%2', 'file# 3']
args `=files`
assert_equal(files, argv())
+
+ filename = 'Xwindo'
+ windo edit `=filename`
+ assert_equal('Xwindo', bufname())
+
+ filename = 'Xtabdo'
+ tabdo edit `=filename`
+ assert_equal('Xtabdo', bufname())
+
+ filename = 'Xargdo'
+ argdo edit `=filename`
+ assert_equal('Xargdo', bufname())
+
+ :%bwipe!
+ filename = 'Xbufdo'
+ bufdo file `=filename`
+ assert_equal('Xbufdo', bufname())
enddef
def Test_expand_alternate_file()
diff --git a/src/version.c b/src/version.c
index f328f833c..7361d90f2 100644
--- a/src/version.c
+++ b/src/version.c
@@ -758,6 +758,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 3683,
+/**/
3682,
/**/
3681,