mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:8.1.0047: no completion for :unlet $VAR
Problem: No completion for :unlet $VAR.
Solution: Add completion. (Jason Franklin)
1983401088
This commit is contained in:
parent
07fbdf4acc
commit
c0d835764f
@ -3260,8 +3260,15 @@ const char * set_one_cmd_context(
|
||||
while ((xp->xp_pattern = (char_u *)strchr(arg, ' ')) != NULL) {
|
||||
arg = (const char *)xp->xp_pattern + 1;
|
||||
}
|
||||
|
||||
xp->xp_context = EXPAND_USER_VARS;
|
||||
xp->xp_pattern = (char_u *)arg;
|
||||
|
||||
if (*xp->xp_pattern == '$') {
|
||||
xp->xp_context = EXPAND_ENV_VARS;
|
||||
xp->xp_pattern++;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case CMD_function:
|
||||
@ -9049,8 +9056,10 @@ makeopens(
|
||||
// cursor can be set. This is done again below.
|
||||
// winminheight and winminwidth need to be set to avoid an error if the
|
||||
// user has set winheight or winwidth.
|
||||
if (put_line(fd, "set winminheight=1 winminwidth=1 winheight=1 winwidth=1")
|
||||
== FAIL) {
|
||||
if (put_line(fd, "set winminheight=0") == FAIL
|
||||
|| put_line(fd, "set winheight=1") == FAIL
|
||||
|| put_line(fd, "set winminwidth=0") == FAIL
|
||||
|| put_line(fd, "set winwidth=1") == FAIL) {
|
||||
return FAIL;
|
||||
}
|
||||
if (nr > 1 && ses_winsizes(fd, restore_size, tab_firstwin) == FAIL) {
|
||||
|
@ -52,3 +52,13 @@ func Test_unlet_env()
|
||||
|
||||
unlet $MUST_NOT_BE_AN_ERROR
|
||||
endfunc
|
||||
|
||||
func Test_unlet_complete()
|
||||
let g:FOOBAR = 1
|
||||
call feedkeys(":unlet g:FOO\t\n", 'tx')
|
||||
call assert_true(!exists('g:FOOBAR'))
|
||||
|
||||
let $FOOBAR = 1
|
||||
call feedkeys(":unlet $FOO\t\n", 'tx')
|
||||
call assert_true(!exists('$FOOBAR') || empty($FOOBAR))
|
||||
endfunc
|
||||
|
Loading…
Reference in New Issue
Block a user