File tree Expand file tree Collapse file tree 3 files changed +14
-1
lines changed
Expand file tree Collapse file tree 3 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -1027,6 +1027,8 @@ qf_add_entry(
10271027 /* first element in the list */
10281028 {
10291029 qi -> qf_lists [qi -> qf_curlist ].qf_start = qfp ;
1030+ qi -> qf_lists [qi -> qf_curlist ].qf_ptr = qfp ;
1031+ qi -> qf_lists [qi -> qf_curlist ].qf_index = 0 ;
10301032 qfp -> qf_prev = qfp ; /* first element points to itself */
10311033 }
10321034 else
@@ -4113,7 +4115,8 @@ set_errorlist(
41134115 else
41144116 qi -> qf_lists [qi -> qf_curlist ].qf_nonevalid = FALSE;
41154117 qi -> qf_lists [qi -> qf_curlist ].qf_ptr = qi -> qf_lists [qi -> qf_curlist ].qf_start ;
4116- qi -> qf_lists [qi -> qf_curlist ].qf_index = 1 ;
4118+ if (qi -> qf_lists [qi -> qf_curlist ].qf_count > 0 )
4119+ qi -> qf_lists [qi -> qf_curlist ].qf_index = 1 ;
41174120
41184121#ifdef FEAT_WINDOWS
41194122 qf_update_buffer (qi );
Original file line number Diff line number Diff line change @@ -679,3 +679,11 @@ function Test_quickfix_was_changed_by_autocmd()
679679 call XquickfixChangedByAutocmd (' c' )
680680 call XquickfixChangedByAutocmd (' l' )
681681endfunction
682+
683+ func Test_caddbuffer_to_empty ()
684+ helpgr quickfix
685+ call setqflist ([], ' r' )
686+ cad
687+ call assert_fails (' cn' , ' E553:' )
688+ quit !
689+ endfunc
Original file line number Diff line number Diff line change @@ -748,6 +748,8 @@ static char *(features[]) =
748748
749749static int included_patches [] =
750750{ /* Add new patch number below this line */
751+ /**/
752+ 1647 ,
751753/**/
752754 1646 ,
753755/**/
You can’t perform that action at this time.
0 commit comments