lkundrak / rpms / vim

Forked from rpms/vim 4 years ago
Clone
e97c6e6
To: vim-dev@vim.org
e97c6e6
Subject: Patch 7.0.146
e97c6e6
Fcc: outbox
e97c6e6
From: Bram Moolenaar <Bram@moolenaar.net>
e97c6e6
Mime-Version: 1.0
e97c6e6
Content-Type: text/plain; charset=ISO-8859-1
e97c6e6
Content-Transfer-Encoding: 8bit
e97c6e6
------------
e97c6e6
e97c6e6
Patch 7.0.146
e97c6e6
Problem:    When 'switchbuf' is set to "usetab" and the current tab has only a
e97c6e6
	    quickfix window, jumping to an error always opens a new window.
e97c6e6
	    Also, when the buffer is open in another tab page it's not found.
e97c6e6
Solution:   Check for the "split" value of 'switchbuf' properly.  Search in
e97c6e6
	    other tab pages for the desired buffer. (Yegappan Lakshmanan)
e97c6e6
Files:	    src/buffer.c, src/quickfix.c
e97c6e6
e97c6e6
e97c6e6
*** ../vim-7.0.145/src/buffer.c	Sat Sep  9 14:51:43 2006
e97c6e6
--- src/buffer.c	Fri Oct 20 20:08:49 2006
e97c6e6
***************
e97c6e6
*** 1208,1218 ****
e97c6e6
      {
e97c6e6
  # ifdef FEAT_WINDOWS
e97c6e6
  	/* jump to first window containing buf if one exists ("useopen") */
e97c6e6
! 	if (vim_strchr(p_swb, 'o') && buf_jump_open_win(buf))
e97c6e6
  	    return OK;
e97c6e6
  	/* jump to first window in any tab page containing buf if one exists
e97c6e6
  	 * ("usetab") */
e97c6e6
! 	if (vim_strchr(p_swb, 'a') && buf_jump_open_tab(buf))
e97c6e6
  	    return OK;
e97c6e6
  	if (win_split(0, 0) == FAIL)
e97c6e6
  # endif
e97c6e6
--- 1208,1218 ----
e97c6e6
      {
e97c6e6
  # ifdef FEAT_WINDOWS
e97c6e6
  	/* jump to first window containing buf if one exists ("useopen") */
e97c6e6
! 	if (vim_strchr(p_swb, 'o') != NULL && buf_jump_open_win(buf))
e97c6e6
  	    return OK;
e97c6e6
  	/* jump to first window in any tab page containing buf if one exists
e97c6e6
  	 * ("usetab") */
e97c6e6
! 	if (vim_strchr(p_swb, 'a') != NULL && buf_jump_open_tab(buf))
e97c6e6
  	    return OK;
e97c6e6
  	if (win_split(0, 0) == FAIL)
e97c6e6
  # endif
e97c6e6
***************
e97c6e6
*** 1842,1854 ****
e97c6e6
      if (options & GETF_SWITCH)
e97c6e6
      {
e97c6e6
  	/* use existing open window for buffer if wanted */
e97c6e6
! 	if (vim_strchr(p_swb, 'o'))     /* useopen */
e97c6e6
  	    wp = buf_jump_open_win(buf);
e97c6e6
  	/* use existing open window in any tab page for buffer if wanted */
e97c6e6
! 	if (vim_strchr(p_swb, 'a'))     /* usetab */
e97c6e6
  	    wp = buf_jump_open_tab(buf);
e97c6e6
  	/* split window if wanted ("split") */
e97c6e6
! 	if (wp == NULL && vim_strchr(p_swb, 't') && !bufempty())
e97c6e6
  	{
e97c6e6
  	    if (win_split(0, 0) == FAIL)
e97c6e6
  		return FAIL;
e97c6e6
--- 1842,1854 ----
e97c6e6
      if (options & GETF_SWITCH)
e97c6e6
      {
e97c6e6
  	/* use existing open window for buffer if wanted */
e97c6e6
! 	if (vim_strchr(p_swb, 'o') != NULL)	/* useopen */
e97c6e6
  	    wp = buf_jump_open_win(buf);
e97c6e6
  	/* use existing open window in any tab page for buffer if wanted */
e97c6e6
! 	if (vim_strchr(p_swb, 'a') != NULL)	/* usetab */
e97c6e6
  	    wp = buf_jump_open_tab(buf);
e97c6e6
  	/* split window if wanted ("split") */
e97c6e6
! 	if (wp == NULL && vim_strchr(p_swb, 'l') != NULL && !bufempty())
e97c6e6
  	{
e97c6e6
  	    if (win_split(0, 0) == FAIL)
e97c6e6
  		return FAIL;
e97c6e6
*** ../vim-7.0.145/src/quickfix.c	Tue Sep  5 15:36:30 2006
e97c6e6
--- src/quickfix.c	Fri Oct 20 20:05:00 2006
e97c6e6
***************
e97c6e6
*** 1586,1595 ****
e97c6e6
  	    }
e97c6e6
  
e97c6e6
  	/*
e97c6e6
! 	 * If there is only one window, create a new one above the quickfix
e97c6e6
! 	 * window.
e97c6e6
  	 */
e97c6e6
! 	if (firstwin == lastwin || !usable_win)
e97c6e6
  	{
e97c6e6
  	    ll_ref = curwin->w_llist_ref;
e97c6e6
  
e97c6e6
--- 1586,1615 ----
e97c6e6
  	    }
e97c6e6
  
e97c6e6
  	/*
e97c6e6
! 	 * If no usable window is found and 'switchbuf' is set to 'usetab'
e97c6e6
! 	 * then search in other tabs.
e97c6e6
  	 */
e97c6e6
! 	if (!usable_win && vim_strchr(p_swb, 'a') != NULL)
e97c6e6
! 	{
e97c6e6
! 	    tabpage_T	*tp;
e97c6e6
! 	    win_T	*wp;
e97c6e6
! 
e97c6e6
! 	    FOR_ALL_TAB_WINDOWS(tp, wp)
e97c6e6
! 	    {
e97c6e6
! 		if (wp->w_buffer->b_fnum == qf_ptr->qf_fnum)
e97c6e6
! 		{
e97c6e6
! 		    goto_tabpage_win(tp, wp);
e97c6e6
! 		    usable_win = 1;
e97c6e6
! 		    break;
e97c6e6
! 		}
e97c6e6
! 	    }
e97c6e6
! 	}
e97c6e6
! 
e97c6e6
! 	/*
e97c6e6
! 	 * If there is only one window and is the quickfix window, create a new
e97c6e6
! 	 * one above the quickfix window.
e97c6e6
! 	 */
e97c6e6
! 	if (((firstwin == lastwin) && bt_quickfix(curbuf)) || !usable_win)
e97c6e6
  	{
e97c6e6
  	    ll_ref = curwin->w_llist_ref;
e97c6e6
  
e97c6e6
*** ../vim-7.0.145/src/version.c	Tue Oct 17 22:40:14 2006
e97c6e6
--- src/version.c	Fri Oct 20 20:11:58 2006
e97c6e6
***************
e97c6e6
*** 668,669 ****
e97c6e6
--- 668,671 ----
e97c6e6
  {   /* Add new patch number below this line */
e97c6e6
+ /**/
e97c6e6
+     146,
e97c6e6
  /**/
e97c6e6
e97c6e6
-- 
e97c6e6
hundred-and-one symptoms of being an internet addict:
e97c6e6
80. At parties, you introduce your spouse as your "service provider."
e97c6e6
e97c6e6
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
e97c6e6
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
e97c6e6
\\\        download, build and distribute -- http://www.A-A-P.org        ///
e97c6e6
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///