summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.0259
blob: 32e09e50d5fe34f2024a857cb06f2439e543edee (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
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0259
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.0259
Problem:    No test for fixed quickfix issue.
Solution:   Add a test.  Clean up the code a bit. (Yegappan Lakshmanan)
Files:	    src/quickfix.c, src/testdir/test_quickfix.vim


*** ../vim-8.1.0258/src/quickfix.c	2018-08-07 21:54:27.725813349 +0200
--- src/quickfix.c	2018-08-09 21:14:43.248703692 +0200
***************
*** 1506,1512 ****
      return qi->qf_lists[qf_idx].qf_count <= 0;
  }
  
- 
  /*
   * Allocate the fields used for parsing lines and populating a quickfix list.
   */
--- 1506,1511 ----
***************
*** 3717,3723 ****
      if (IS_LL_WINDOW(curwin))
  	qi = GET_LOC_LIST(curwin);
  
!     if (qi == NULL || qi->qf_lists[qi->qf_curlist].qf_count == 0)
      {
  	EMSG(_(e_quickfix));
  	return;
--- 3716,3722 ----
      if (IS_LL_WINDOW(curwin))
  	qi = GET_LOC_LIST(curwin);
  
!     if (qf_list_empty(qi, qi->qf_curlist))
      {
  	EMSG(_(e_quickfix));
  	return;
***************
*** 4349,4355 ****
      if (qi->qf_lists[qi->qf_curlist].qf_id != save_qfid)
  	qi->qf_curlist = qf_id2nr(qi, save_qfid);
  
!     if (qi->qf_lists[qi->qf_curlist].qf_count > 0)
  	qf_jump(qi, 0, 0, forceit);
  }
  
--- 4348,4355 ----
      if (qi->qf_lists[qi->qf_curlist].qf_id != save_qfid)
  	qi->qf_curlist = qf_id2nr(qi, save_qfid);
  
!     // Autocommands might have cleared the list, check for it
!     if (!qf_list_empty(qi, qi->qf_curlist))
  	qf_jump(qi, 0, 0, forceit);
  }
  
***************
*** 4873,4882 ****
      // free the list.
      if (res > 0 && (eap->cmdidx == CMD_cfile || eap->cmdidx == CMD_lfile)
  	    && qflist_valid(wp, save_qfid))
-     {
  	// display the first error
  	qf_jump_first(qi, save_qfid, eap->forceit);
-     }
  }
  
  /*
--- 4873,4880 ----
***************
*** 6581,6590 ****
  	    if (res > 0 && (eap->cmdidx == CMD_cbuffer ||
  						eap->cmdidx == CMD_lbuffer)
  		    && qflist_valid(wp, save_qfid))
- 	    {
  		// display the first error
  		qf_jump_first(qi, save_qfid, eap->forceit);
- 	    }
  	}
      }
  }
--- 6579,6586 ----
***************
*** 6661,6670 ****
  	    if (res > 0 && (eap->cmdidx == CMD_cexpr
  						   || eap->cmdidx == CMD_lexpr)
  		    && qflist_valid(wp, save_qfid))
- 	    {
  		// display the first error
  		qf_jump_first(qi, save_qfid, eap->forceit);
- 	    }
  	}
  	else
  	    EMSG(_("E777: String or List expected"));
--- 6657,6664 ----
*** ../vim-8.1.0258/src/testdir/test_quickfix.vim	2018-07-25 22:36:48.991518559 +0200
--- src/testdir/test_quickfix.vim	2018-08-09 21:14:43.248703692 +0200
***************
*** 3478,3483 ****
--- 3478,3507 ----
    call assert_equal(5, line('.'))
    autocmd! QuickFixCmdPost
  
+   " Test for autocommands clearing the quickfix list before jumping to the
+   " first error. This should not result in an error
+   autocmd QuickFixCmdPost * call g:Xsetlist([], 'r')
+   let v:errmsg = ''
+   " Test for cfile/lfile
+   Xfile Xerr
+   call assert_true(v:errmsg !~# 'E42:')
+   " Test for cbuffer/lbuffer
+   edit Xerr
+   Xbuffer
+   call assert_true(v:errmsg !~# 'E42:')
+   " Test for cexpr/lexpr
+   Xexpr 'Xtestfile2:4:Line4'
+   call assert_true(v:errmsg !~# 'E42:')
+   " Test for grep/lgrep
+   " The grepprg may not be set on non-Unix systems
+   if has('unix')
+     silent Xgrep Line5 Xtestfile2
+     call assert_true(v:errmsg !~# 'E42:')
+   endif
+   " Test for vimgrep/lvimgrep
+   call assert_fails('silent Xvimgrep Line5 Xtestfile2', 'E480:')
+   autocmd! QuickFixCmdPost
+ 
    call delete('Xerr')
    call delete('Xtestfile1')
    call delete('Xtestfile2')
*** ../vim-8.1.0258/src/version.c	2018-08-08 22:55:38.034420872 +0200
--- src/version.c	2018-08-09 21:17:42.991183590 +0200
***************
*** 796,797 ****
--- 796,799 ----
  {   /* Add new patch number below this line */
+ /**/
+     259,
  /**/

-- 
BROTHER MAYNARD: Armaments Chapter Two Verses Nine to Twenty One.
ANOTHER MONK:    And St.  Attila raised his hand grenade up on high saying "O
                 Lord bless this thy hand grenade that with it thou mayest
                 blow thine enemies to tiny bits, in thy mercy. "and the Lord
                 did grin and people did feast upon the lambs and sloths and
                 carp and anchovies and orang-utans and breakfast cereals and
                 fruit bats and...
BROTHER MAYNARD: Skip a bit brother ...
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

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