summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.0293
blob: f3a45c01e8c2050eeaf41bc5748eb9ac7b24c8e6 (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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0293
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.0293
Problem:    Checks for type of stack is cryptic.
Solution:   Define IS_QF_STACK() and IS_LL_STACK(). (Yegappan Lakshmanan)
Files:	    src/quickfix.c


*** ../vim-8.1.0292/src/quickfix.c	2018-08-15 22:29:46.977604162 +0200
--- src/quickfix.c	2018-08-18 19:51:21.810177230 +0200
***************
*** 159,164 ****
--- 159,169 ----
  #define IS_QF_WINDOW(wp) (bt_quickfix(wp->w_buffer) && wp->w_llist_ref == NULL)
  /* Location list window check helper macro */
  #define IS_LL_WINDOW(wp) (bt_quickfix(wp->w_buffer) && wp->w_llist_ref != NULL)
+ 
+ // Quickfix and location list stack check helper macros
+ #define IS_QF_STACK(qi)		(qi == &ql_info)
+ #define IS_LL_STACK(qi)		(qi != &ql_info)
+ 
  /*
   * Return location list for window 'wp'
   * For location list window, return the referenced location list
***************
*** 1940,1946 ****
  	qfp->qf_fnum = bufnum;
  	if (buf != NULL)
  	    buf->b_has_qf_entry |=
! 		(qi == &ql_info) ? BUF_HAS_QF_ENTRY : BUF_HAS_LL_ENTRY;
      }
      else
  	qfp->qf_fnum = qf_get_fnum(qi, qf_idx, dir, fname);
--- 1945,1951 ----
  	qfp->qf_fnum = bufnum;
  	if (buf != NULL)
  	    buf->b_has_qf_entry |=
! 		IS_QF_STACK(qi) ? BUF_HAS_QF_ENTRY : BUF_HAS_LL_ENTRY;
      }
      else
  	qfp->qf_fnum = qf_get_fnum(qi, qf_idx, dir, fname);
***************
*** 2224,2230 ****
  	return 0;
  
      buf->b_has_qf_entry =
! 			(qi == &ql_info) ? BUF_HAS_QF_ENTRY : BUF_HAS_LL_ENTRY;
      return buf->b_fnum;
  }
  
--- 2229,2235 ----
  	return 0;
  
      buf->b_has_qf_entry =
! 			IS_QF_STACK(qi) ? BUF_HAS_QF_ENTRY : BUF_HAS_LL_ENTRY;
      return buf->b_fnum;
  }
  
***************
*** 2631,2637 ****
  	if (cmdmod.split == 0 && curwin->w_width != Columns
  		&& curwin->w_width < 80)
  	    flags |= WSP_TOP;
! 	if (qi != &ql_info)
  	    flags |= WSP_NEWLOC;  /* don't copy the location list */
  
  	if (win_split(0, flags) == FAIL)
--- 2636,2642 ----
  	if (cmdmod.split == 0 && curwin->w_width != Columns
  		&& curwin->w_width < 80)
  	    flags |= WSP_TOP;
! 	if (IS_LL_STACK(qi))
  	    flags |= WSP_NEWLOC;  /* don't copy the location list */
  
  	if (win_split(0, flags) == FAIL)
***************
*** 2642,2648 ****
  	if (curwin->w_height < p_hh)
  	    win_setheight((int)p_hh);
  
! 	if (qi != &ql_info)	    /* not a quickfix list */
  	{
  	    /* The new window should use the supplied location list */
  	    curwin->w_llist = qi;
--- 2647,2653 ----
  	if (curwin->w_height < p_hh)
  	    win_setheight((int)p_hh);
  
! 	if (IS_LL_STACK(qi))		// not a quickfix list
  	{
  	    /* The new window should use the supplied location list */
  	    curwin->w_llist = qi;
***************
*** 2918,2924 ****
  	retval = buflist_getfile(qf_ptr->qf_fnum,
  		(linenr_T)1, GETF_SETMARK | GETF_SWITCH, forceit);
  
! 	if (qi != &ql_info)
  	{
  	    /*
  	     * Location list. Check whether the associated window is still
--- 2923,2929 ----
  	retval = buflist_getfile(qf_ptr->qf_fnum,
  		(linenr_T)1, GETF_SETMARK | GETF_SWITCH, forceit);
  
! 	if (IS_LL_STACK(qi))
  	{
  	    /*
  	     * Location list. Check whether the associated window is still
***************
*** 2939,2945 ****
  	else if (old_qf_curlist != qi->qf_curlist
  		|| !is_qf_entry_present(qi, qf_ptr))
  	{
! 	    if (qi == &ql_info)
  		EMSG(_("E925: Current quickfix was changed"));
  	    else
  		EMSG(_(e_loc_list_changed));
--- 2944,2950 ----
  	else if (old_qf_curlist != qi->qf_curlist
  		|| !is_qf_entry_present(qi, qf_ptr))
  	{
! 	    if (IS_QF_STACK(qi))
  		EMSG(_("E925: Current quickfix was changed"));
  	    else
  		EMSG(_(e_loc_list_changed));
***************
*** 4040,4047 ****
       * pointing to the location list.
       */
      if (bt_quickfix(win->w_buffer))
! 	if ((qi == &ql_info && win->w_llist_ref == NULL)
! 		|| (qi != &ql_info && win->w_llist_ref == qi))
  	    return TRUE;
  
      return FALSE;
--- 4045,4052 ----
       * pointing to the location list.
       */
      if (bt_quickfix(win->w_buffer))
! 	if ((IS_QF_STACK(qi) && win->w_llist_ref == NULL)
! 		|| (IS_LL_STACK(qi) && win->w_llist_ref == qi))
  	    return TRUE;
  
      return FALSE;
***************
*** 6955,6961 ****
      {
  	apply_autocmds(EVENT_QUICKFIXCMDPOST, au_name,
  					       curbuf->b_fname, TRUE, curbuf);
! 	if (!new_qi && qi != &ql_info && qf_find_buf(qi) == NULL)
  	    /* autocommands made "qi" invalid */
  	    return;
      }
--- 6960,6966 ----
      {
  	apply_autocmds(EVENT_QUICKFIXCMDPOST, au_name,
  					       curbuf->b_fname, TRUE, curbuf);
! 	if (!new_qi && IS_LL_STACK(qi) && qf_find_buf(qi) == NULL)
  	    /* autocommands made "qi" invalid */
  	    return;
      }
*** ../vim-8.1.0292/src/version.c	2018-08-18 19:04:32.462231841 +0200
--- src/version.c	2018-08-18 19:58:34.263431696 +0200
***************
*** 796,797 ****
--- 796,799 ----
  {   /* Add new patch number below this line */
+ /**/
+     293,
  /**/

-- 
FATAL ERROR! SYSTEM HALTED! - Press any key to continue doing nothing.

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