073263
To: vim_dev@googlegroups.com
073263
Subject: Patch 7.4.378
073263
Fcc: outbox
073263
From: Bram Moolenaar <Bram@moolenaar.net>
073263
Mime-Version: 1.0
073263
Content-Type: text/plain; charset=UTF-8
073263
Content-Transfer-Encoding: 8bit
073263
------------
073263
073263
Patch 7.4.378
073263
Problem:    Title of quickfist list is not kept for setqflist(list, 'r').
073263
Solution:   Keep the title.  Add a test. (Lcd)
073263
Files:	    src/quickfix.c, src/testdir/Make_amiga.mak,
073263
	    src/testdir/Make_dos.mak, src/testdir/Make_ming.mak,
073263
	    src/testdir/Make_os2.mak, src/testdir/Make_vms.mms,
073263
	    src/testdir/Makefile, src/testdir/test_qf_title.in,
073263
	    src/testdir/test_qf_title.ok
073263
073263
073263
*** ../vim-7.4.377/src/quickfix.c	2014-03-27 17:02:22.080660944 +0100
073263
--- src/quickfix.c	2014-07-23 15:37:30.551910459 +0200
073263
***************
073263
*** 107,112 ****
073263
--- 107,113 ----
073263
  };
073263
  
073263
  static int	qf_init_ext __ARGS((qf_info_T *qi, char_u *efile, buf_T *buf, typval_T *tv, char_u *errorformat, int newlist, linenr_T lnumfirst, linenr_T lnumlast, char_u *qf_title));
073263
+ static void	qf_store_title __ARGS((qf_info_T *qi, char_u *title));
073263
  static void	qf_new_list __ARGS((qf_info_T *qi, char_u *qf_title));
073263
  static void	ll_free_all __ARGS((qf_info_T **pqi));
073263
  static int	qf_add_entry __ARGS((qf_info_T *qi, qfline_T **prevp, char_u *dir, char_u *fname, int bufnum, char_u *mesg, long lnum, int col, int vis_col, char_u *pattern, int nr, int type, int valid));
073263
***************
073263
*** 126,132 ****
073263
  static win_T	*qf_find_win __ARGS((qf_info_T *qi));
073263
  static buf_T	*qf_find_buf __ARGS((qf_info_T *qi));
073263
  static void	qf_update_buffer __ARGS((qf_info_T *qi));
073263
! static void	qf_set_title __ARGS((qf_info_T *qi));
073263
  static void	qf_fill_buffer __ARGS((qf_info_T *qi));
073263
  #endif
073263
  static char_u	*get_mef_name __ARGS((void));
073263
--- 127,133 ----
073263
  static win_T	*qf_find_win __ARGS((qf_info_T *qi));
073263
  static buf_T	*qf_find_buf __ARGS((qf_info_T *qi));
073263
  static void	qf_update_buffer __ARGS((qf_info_T *qi));
073263
! static void	qf_set_title_var __ARGS((qf_info_T *qi));
073263
  static void	qf_fill_buffer __ARGS((qf_info_T *qi));
073263
  #endif
073263
  static char_u	*get_mef_name __ARGS((void));
073263
***************
073263
*** 884,889 ****
073263
--- 885,905 ----
073263
      return retval;
073263
  }
073263
  
073263
+     static void
073263
+ qf_store_title(qi, title)
073263
+     qf_info_T	*qi;
073263
+     char_u	*title;
073263
+ {
073263
+     if (title != NULL)
073263
+     {
073263
+ 	char_u *p = alloc((int)STRLEN(title) + 2);
073263
+ 
073263
+ 	qi->qf_lists[qi->qf_curlist].qf_title = p;
073263
+ 	if (p != NULL)
073263
+ 	    sprintf((char *)p, ":%s", (char *)title);
073263
+     }
073263
+ }
073263
+ 
073263
  /*
073263
   * Prepare for adding a new quickfix list.
073263
   */
073263
***************
073263
*** 895,901 ****
073263
      int		i;
073263
  
073263
      /*
073263
!      * If the current entry is not the last entry, delete entries below
073263
       * the current entry.  This makes it possible to browse in a tree-like
073263
       * way with ":grep'.
073263
       */
073263
--- 911,917 ----
073263
      int		i;
073263
  
073263
      /*
073263
!      * If the current entry is not the last entry, delete entries beyond
073263
       * the current entry.  This makes it possible to browse in a tree-like
073263
       * way with ":grep'.
073263
       */
073263
***************
073263
*** 916,929 ****
073263
      else
073263
  	qi->qf_curlist = qi->qf_listcount++;
073263
      vim_memset(&qi->qf_lists[qi->qf_curlist], 0, (size_t)(sizeof(qf_list_T)));
073263
!     if (qf_title != NULL)
073263
!     {
073263
! 	char_u *p = alloc((int)STRLEN(qf_title) + 2);
073263
! 
073263
! 	qi->qf_lists[qi->qf_curlist].qf_title = p;
073263
! 	if (p != NULL)
073263
! 	    sprintf((char *)p, ":%s", (char *)qf_title);
073263
!     }
073263
  }
073263
  
073263
  /*
073263
--- 932,938 ----
073263
      else
073263
  	qi->qf_curlist = qi->qf_listcount++;
073263
      vim_memset(&qi->qf_lists[qi->qf_curlist], 0, (size_t)(sizeof(qf_list_T)));
073263
!     qf_store_title(qi, qf_title);
073263
  }
073263
  
073263
  /*
073263
***************
073263
*** 2444,2450 ****
073263
      qf_fill_buffer(qi);
073263
  
073263
      if (qi->qf_lists[qi->qf_curlist].qf_title != NULL)
073263
! 	qf_set_title(qi);
073263
  
073263
      curwin->w_cursor.lnum = qi->qf_lists[qi->qf_curlist].qf_index;
073263
      curwin->w_cursor.col = 0;
073263
--- 2453,2459 ----
073263
      qf_fill_buffer(qi);
073263
  
073263
      if (qi->qf_lists[qi->qf_curlist].qf_title != NULL)
073263
! 	qf_set_title_var(qi);
073263
  
073263
      curwin->w_cursor.lnum = qi->qf_lists[qi->qf_curlist].qf_index;
073263
      curwin->w_cursor.col = 0;
073263
***************
073263
*** 2599,2605 ****
073263
  	{
073263
  	    curwin_save = curwin;
073263
  	    curwin = win;
073263
! 	    qf_set_title(qi);
073263
  	    curwin = curwin_save;
073263
  
073263
  	}
073263
--- 2608,2614 ----
073263
  	{
073263
  	    curwin_save = curwin;
073263
  	    curwin = win;
073263
! 	    qf_set_title_var(qi);
073263
  	    curwin = curwin_save;
073263
  
073263
  	}
073263
***************
073263
*** 2612,2618 ****
073263
  }
073263
  
073263
      static void
073263
! qf_set_title(qi)
073263
      qf_info_T	*qi;
073263
  {
073263
      set_internal_string_var((char_u *)"w:quickfix_title",
073263
--- 2621,2627 ----
073263
  }
073263
  
073263
      static void
073263
! qf_set_title_var(qi)
073263
      qf_info_T	*qi;
073263
  {
073263
      set_internal_string_var((char_u *)"w:quickfix_title",
073263
***************
073263
*** 3845,3851 ****
073263
--- 3854,3863 ----
073263
  	     prevp->qf_next != prevp; prevp = prevp->qf_next)
073263
  	    ;
073263
      else if (action == 'r')
073263
+     {
073263
  	qf_free(qi, qi->qf_curlist);
073263
+ 	qf_store_title(qi, title);
073263
+     }
073263
  
073263
      for (li = list->lv_first; li != NULL; li = li->li_next)
073263
      {
073263
*** ../vim-7.4.377/src/testdir/Make_amiga.mak	2014-07-16 17:01:38.275570568 +0200
073263
--- src/testdir/Make_amiga.mak	2014-07-23 15:26:51.455915053 +0200
073263
***************
073263
*** 40,45 ****
073263
--- 40,46 ----
073263
  		test_breakindent.out \
073263
  		test_listlbr.out \
073263
  		test_listlbr_utf8.out \
073263
+ 		test_qf_title.out \
073263
  		test_eval.out \
073263
  		test_options.out
073263
  
073263
***************
073263
*** 169,173 ****
073263
--- 170,175 ----
073263
  test_breakindent.out: test_breakindent.in
073263
  test_listlbr.out: test_listlbr.in
073263
  test_listlbr_utf8.out: test_listlbr_utf8.in
073263
+ test_qf_title.out: test_qf_title.in
073263
  test_eval.out: test_eval.in
073263
  test_options.out: test_options.in
073263
*** ../vim-7.4.377/src/testdir/Make_dos.mak	2014-07-16 17:01:38.279570568 +0200
073263
--- src/testdir/Make_dos.mak	2014-07-23 15:27:01.231914983 +0200
073263
***************
073263
*** 39,44 ****
073263
--- 39,45 ----
073263
  		test_breakindent.out \
073263
  		test_listlbr.out \
073263
  		test_listlbr_utf8.out \
073263
+ 		test_qf_title.out \
073263
  		test_eval.out \
073263
  		test_options.out
073263
  
073263
*** ../vim-7.4.377/src/testdir/Make_ming.mak	2014-07-16 17:01:38.279570568 +0200
073263
--- src/testdir/Make_ming.mak	2014-07-23 15:27:13.163914897 +0200
073263
***************
073263
*** 59,64 ****
073263
--- 59,65 ----
073263
  		test_breakindent.out \
073263
  		test_listlbr.out \
073263
  		test_listlbr_utf8.out \
073263
+ 		test_qf_title.out \
073263
  		test_eval.out \
073263
  		test_options.out
073263
  
073263
*** ../vim-7.4.377/src/testdir/Make_os2.mak	2014-07-16 17:01:38.279570568 +0200
073263
--- src/testdir/Make_os2.mak	2014-07-23 15:27:25.999914805 +0200
073263
***************
073263
*** 40,47 ****
073263
  		test_autoformat_join.out \
073263
  		test_eval.out \
073263
  		test_breakindent.out \
073263
- 		test_listlbr_utf8.out \
073263
  		test_listlbr.out \
073263
  		test_options.out
073263
  
073263
  .SUFFIXES: .in .out
073263
--- 40,48 ----
073263
  		test_autoformat_join.out \
073263
  		test_eval.out \
073263
  		test_breakindent.out \
073263
  		test_listlbr.out \
073263
+ 		test_listlbr_utf8.out \
073263
+ 		test_qf_title.out \
073263
  		test_options.out
073263
  
073263
  .SUFFIXES: .in .out
073263
*** ../vim-7.4.377/src/testdir/Make_vms.mms	2014-07-16 17:01:38.279570568 +0200
073263
--- src/testdir/Make_vms.mms	2014-07-23 15:27:34.787914741 +0200
073263
***************
073263
*** 4,10 ****
073263
  # Authors:	Zoltan Arpadffy, <arpadffy@polarhome.com>
073263
  #		Sandor Kopanyi,  <sandor.kopanyi@mailbox.hu>
073263
  #
073263
! # Last change:  2014 May 28
073263
  #
073263
  # This has been tested on VMS 6.2 to 8.3 on DEC Alpha, VAX and IA64.
073263
  # Edit the lines in the Configuration section below to select.
073263
--- 4,10 ----
073263
  # Authors:	Zoltan Arpadffy, <arpadffy@polarhome.com>
073263
  #		Sandor Kopanyi,  <sandor.kopanyi@mailbox.hu>
073263
  #
073263
! # Last change:  2014 Jul 23
073263
  #
073263
  # This has been tested on VMS 6.2 to 8.3 on DEC Alpha, VAX and IA64.
073263
  # Edit the lines in the Configuration section below to select.
073263
***************
073263
*** 100,105 ****
073263
--- 100,106 ----
073263
  	 test_breakindent.out \
073263
  	 test_listlbr.out \
073263
  	 test_listlbr_utf8.out \
073263
+ 	 test_qf_title.out \
073263
  	 test_eval.out \
073263
  	 test_options.out
073263
  
073263
*** ../vim-7.4.377/src/testdir/Makefile	2014-07-16 17:01:38.279570568 +0200
073263
--- src/testdir/Makefile	2014-07-23 15:27:46.947914654 +0200
073263
***************
073263
*** 37,42 ****
073263
--- 37,43 ----
073263
  		test_breakindent.out \
073263
  		test_listlbr.out \
073263
  		test_listlbr_utf8.out \
073263
+ 		test_qf_title.out \
073263
  		test_eval.out \
073263
  		test_options.out
073263
  
073263
*** ../vim-7.4.377/src/testdir/test_qf_title.in	2014-07-23 15:53:26.279903590 +0200
073263
--- src/testdir/test_qf_title.in	2014-07-23 15:26:02.495915405 +0200
073263
***************
073263
*** 0 ****
073263
--- 1,18 ----
073263
+ Tests for quickfix window's title     vim: set ft=vim :
073263
+ 
073263
+ STARTTEST
073263
+ :so small.vim
073263
+ :if !has('quickfix') | e! test.ok | wq! test.out | endif
073263
+ :set efm=%E%f:%l:%c:%m
073263
+ :cgetexpr ['file:1:1:message']
073263
+ :let qflist=getqflist()
073263
+ :call setqflist(qflist, 'r')
073263
+ :copen
073263
+ :let g:quickfix_title=w:quickfix_title
073263
+ :wincmd p
073263
+ :$put =g:quickfix_title
073263
+ :/^Results/,$w test.out
073263
+ :qa!
073263
+ ENDTEST
073263
+ 
073263
+ Results of test_qf_title:
073263
*** ../vim-7.4.377/src/testdir/test_qf_title.ok	2014-07-23 15:53:26.283903590 +0200
073263
--- src/testdir/test_qf_title.ok	2014-07-23 15:25:55.303915456 +0200
073263
***************
073263
*** 0 ****
073263
--- 1,2 ----
073263
+ Results of test_qf_title:
073263
+ :setqflist()
073263
*** ../vim-7.4.377/src/version.c	2014-07-23 15:21:16.247917462 +0200
073263
--- src/version.c	2014-07-23 15:28:57.251914149 +0200
073263
***************
073263
*** 736,737 ****
073263
--- 736,739 ----
073263
  {   /* Add new patch number below this line */
073263
+ /**/
073263
+     378,
073263
  /**/
073263
073263
-- 
073263
ARTHUR: Old woman!
073263
DENNIS: Man!
073263
ARTHUR: Man.  I'm sorry.  Old man, What knight live in that castle over there?
073263
DENNIS: I'm thirty-seven.
073263
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
073263
073263
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
073263
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
073263
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
073263
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///