Patch 8.2.3378
Problem: MS-Windows: completing environment variables with % is wrong.
Solution: Only complete environment variables with $. (Albert Liu,
closes #8791)
Files: src/cmdexpand.c, src/testdir/test_cmdline.vim
*** ../vim-8.2.3377/src/cmdexpand.c 2021-08-26 16:39:55.710406651 +0200
--- src/cmdexpand.c 2021-08-27 20:57:54.866135012 +0200
***************
*** 1277,1288 ****
xp->xp_context = EXPAND_SHELLCMD;
}
! // Check for environment variable
! if (*xp->xp_pattern == '$'
! #if defined(MSWIN)
! || *xp->xp_pattern == '%'
! #endif
! )
{
for (p = xp->xp_pattern + 1; *p != NUL; ++p)
if (!vim_isIDc(*p))
--- 1277,1284 ----
xp->xp_context = EXPAND_SHELLCMD;
}
! // Check for environment variable.
! if (*xp->xp_pattern == '$')
{
for (p = xp->xp_pattern + 1; *p != NUL; ++p)
if (!vim_isIDc(*p))
***************
*** 1296,1302 ****
compl = EXPAND_ENV_VARS;
}
}
! // Check for user names
if (*xp->xp_pattern == '~')
{
for (p = xp->xp_pattern + 1; *p != NUL && *p != '/'; ++p)
--- 1292,1298 ----
compl = EXPAND_ENV_VARS;
}
}
! // Check for user names.
if (*xp->xp_pattern == '~')
{
for (p = xp->xp_pattern + 1; *p != NUL && *p != '/'; ++p)
*** ../vim-8.2.3377/src/testdir/test_cmdline.vim 2021-08-26
16:39:55.710406651 +0200
--- src/testdir/test_cmdline.vim 2021-08-27 20:58:54.909947997 +0200
***************
*** 9,14 ****
--- 9,18 ----
call writefile(['testfile'], 'Xtestfile')
call feedkeys(":e Xtest\t\r", "tx")
call assert_equal('testfile', getline(1))
+
+ " Pressing <Tab> after '%' completes the current file, also on MS-Windows
+ call feedkeys(":e %\t\r", "tx")
+ call assert_equal('e Xtestfile', @:)
call delete('Xtestfile')
endfunc
*** ../vim-8.2.3377/src/version.c 2021-08-26 16:39:55.710406651 +0200
--- src/version.c 2021-08-27 20:57:02.626299923 +0200
***************
*** 757,758 ****
--- 757,760 ----
{ /* Add new patch number below this line */
+ /**/
+ 3378,
/**/
--
Why I like vim:
> I like VIM because, when I ask a question in this newsgroup, I get a
> one-line answer. With xemacs, I get a 1Kb lisp script with bugs in it ;-)
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/202108271900.17RJ0MvX2890308%40masaka.moolenaar.net.