summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.1447
blob: a36fa99ec73f600f6b97b2f0e4e217951301185a (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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
To: vim_dev@googlegroups.com
Subject: Patch 8.1.1447
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.1447
Problem:    Not allowed to create an empty popup.
Solution:   Remove restriction that there is some text. (closes #4470)
Files:	    src/popupwin.c, src/testdir/test_popupwin.vim


*** ../vim-8.1.1446/src/popupwin.c	2019-06-01 22:49:23.697685695 +0200
--- src/popupwin.c	2019-06-02 13:09:37.696928315 +0200
***************
*** 488,499 ****
      int	    nr;
  
      // Check arguments look OK.
!     if (!(argvars[0].v_type == VAR_STRING
! 		&& argvars[0].vval.v_string != NULL
! 		&& STRLEN(argvars[0].vval.v_string) > 0)
! 	&& !(argvars[0].v_type == VAR_LIST
! 	    && argvars[0].vval.v_list != NULL
! 	    && argvars[0].vval.v_list->lv_len > 0))
      {
  	emsg(_(e_listreq));
  	return;
--- 488,495 ----
      int	    nr;
  
      // Check arguments look OK.
!     if (!(argvars[0].v_type == VAR_STRING && argvars[0].vval.v_string != NULL)
! 	&& !(argvars[0].v_type == VAR_LIST && argvars[0].vval.v_list != NULL))
      {
  	emsg(_(e_listreq));
  	return;
***************
*** 560,571 ****
      {
  	list_T *l = argvars[0].vval.v_list;
  
! 	if (l->lv_first->li_tv.v_type == VAR_STRING)
! 	    // list of strings
! 	    add_popup_strings(buf, l);
! 	else
! 	    // list of dictionaries
! 	    add_popup_dicts(buf, l);
      }
  
      // Delete the line of the empty buffer.
--- 556,570 ----
      {
  	list_T *l = argvars[0].vval.v_list;
  
! 	if (l->lv_len > 0)
! 	{
! 	    if (l->lv_first->li_tv.v_type == VAR_STRING)
! 		// list of strings
! 		add_popup_strings(buf, l);
! 	    else
! 		// list of dictionaries
! 		add_popup_dicts(buf, l);
! 	}
      }
  
      // Delete the line of the empty buffer.
*** ../vim-8.1.1446/src/testdir/test_popupwin.vim	2019-06-01 22:49:23.701685671 +0200
--- src/testdir/test_popupwin.vim	2019-06-02 13:19:58.857248458 +0200
***************
*** 596,598 ****
--- 596,612 ----
    call popup_close(winid, 'done')
    call assert_equal('done', g:result)
  endfunc
+ 
+ func Test_popup_empty()
+   let winid = popup_create('', {'padding': [2,2,2,2]})
+   redraw
+   let pos = popup_getpos(winid)
+   call assert_equal(4, pos.width)
+   call assert_equal(5, pos.height)
+ 
+   let winid = popup_create([], {'border': []})
+   redraw
+   let pos = popup_getpos(winid)
+   call assert_equal(2, pos.width)
+   call assert_equal(3, pos.height)
+ endfunc
*** ../vim-8.1.1446/src/version.c	2019-06-01 22:49:23.701685671 +0200
--- src/version.c	2019-06-02 13:21:01.044891751 +0200
***************
*** 769,770 ****
--- 769,772 ----
  {   /* Add new patch number below this line */
+ /**/
+     1447,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
86. E-mail Deficiency Depression (EDD) forces you to e-mail yourself.

 /// 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    ///