summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.0047
blob: da8bf42f0b072a512d4c55eecca22b5f07c0ee76 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0047
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 8.1.0047
Problem:    No completion for :unlet $VAR.
Solution:   Add completion. (Jason Franklin)
Files:	    src/ex_docmd.c, src/testdir/test_unlet.vim


*** ../vim-8.1.0046/src/ex_docmd.c	2018-06-12 12:39:37.585152510 +0200
--- src/ex_docmd.c	2018-06-12 16:59:13.387246272 +0200
***************
*** 4056,4063 ****
--- 4056,4071 ----
  	case CMD_unlet:
  	    while ((xp->xp_pattern = vim_strchr(arg, ' ')) != NULL)
  		arg = xp->xp_pattern + 1;
+ 
  	    xp->xp_context = EXPAND_USER_VARS;
  	    xp->xp_pattern = arg;
+ 
+ 	    if (*xp->xp_pattern == '$')
+ 	    {
+ 		xp->xp_context = EXPAND_ENV_VARS;
+ 		++xp->xp_pattern;
+ 	    }
+ 
  	    break;
  
  	case CMD_function:
***************
*** 11277,11283 ****
  	 * 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 winheight=1 winminwidth=1 winwidth=1") == FAIL)
  	    return FAIL;
  	if (nr > 1 && ses_winsizes(fd, restore_size, tab_firstwin) == FAIL)
  	    return FAIL;
--- 11285,11294 ----
  	 * 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=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)
  	    return FAIL;
*** ../vim-8.1.0046/src/testdir/test_unlet.vim	2018-05-13 15:58:22.000000000 +0200
--- src/testdir/test_unlet.vim	2018-06-12 16:59:13.391246246 +0200
***************
*** 45,47 ****
--- 45,57 ----
  
    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
*** ../vim-8.1.0046/src/version.c	2018-06-12 16:49:26.366028607 +0200
--- src/version.c	2018-06-12 17:00:05.590909690 +0200
***************
*** 763,764 ****
--- 763,766 ----
  {   /* Add new patch number below this line */
+ /**/
+     47,
  /**/

-- 
Micro$oft: where do you want to go today?
    Linux: where do you want to go tomorrow?
  FreeBSD: are you guys coming, or what?

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///