3ef2ca
To: vim_dev@googlegroups.com
3ef2ca
Subject: Patch 7.4.487
3ef2ca
Fcc: outbox
3ef2ca
From: Bram Moolenaar <Bram@moolenaar.net>
3ef2ca
Mime-Version: 1.0
3ef2ca
Content-Type: text/plain; charset=UTF-8
3ef2ca
Content-Transfer-Encoding: 8bit
3ef2ca
------------
3ef2ca
3ef2ca
Patch 7.4.487
3ef2ca
Problem:    ":sign jump" may use another window even though the file is
3ef2ca
	    already edited in the current window.
3ef2ca
Solution:   First check if the file is in the current window. (James McCoy)
3ef2ca
Files:	    src/window.c, src/testdir/Make_amiga.mak,
3ef2ca
	    src/testdir/Make_dos.mak, src/testdir/Make_ming.mak,
3ef2ca
	    src/testdir/Make_os2.mak, src/testdir/Make_vms.mms,
3ef2ca
	    src/testdir/Makefile, src/testdir/test_signs.in,
3ef2ca
	    src/testdir/test_signs.ok
3ef2ca
3ef2ca
3ef2ca
*** ../vim-7.4.486/src/window.c	2014-10-09 10:44:33.196866267 +0200
3ef2ca
--- src/window.c	2014-10-21 20:50:13.018294092 +0200
3ef2ca
***************
3ef2ca
*** 4407,4426 ****
3ef2ca
  buf_jump_open_win(buf)
3ef2ca
      buf_T	*buf;
3ef2ca
  {
3ef2ca
! # ifdef FEAT_WINDOWS
3ef2ca
!     win_T	*wp;
3ef2ca
  
3ef2ca
!     for (wp = firstwin; wp != NULL; wp = wp->w_next)
3ef2ca
! 	if (wp->w_buffer == buf)
3ef2ca
! 	    break;
3ef2ca
      if (wp != NULL)
3ef2ca
  	win_enter(wp, FALSE);
3ef2ca
-     return wp;
3ef2ca
- # else
3ef2ca
-     if (curwin->w_buffer == buf)
3ef2ca
- 	return curwin;
3ef2ca
-     return NULL;
3ef2ca
  # endif
3ef2ca
  }
3ef2ca
  
3ef2ca
  /*
3ef2ca
--- 4407,4425 ----
3ef2ca
  buf_jump_open_win(buf)
3ef2ca
      buf_T	*buf;
3ef2ca
  {
3ef2ca
!     win_T	*wp = NULL;
3ef2ca
  
3ef2ca
!     if (curwin->w_buffer == buf)
3ef2ca
! 	wp = curwin;
3ef2ca
! # ifdef FEAT_WINDOWS
3ef2ca
!     else
3ef2ca
! 	for (wp = firstwin; wp != NULL; wp = wp->w_next)
3ef2ca
! 	    if (wp->w_buffer == buf)
3ef2ca
! 		break;
3ef2ca
      if (wp != NULL)
3ef2ca
  	win_enter(wp, FALSE);
3ef2ca
  # endif
3ef2ca
+     return wp;
3ef2ca
  }
3ef2ca
  
3ef2ca
  /*
3ef2ca
***************
3ef2ca
*** 4432,4443 ****
3ef2ca
  buf_jump_open_tab(buf)
3ef2ca
      buf_T	*buf;
3ef2ca
  {
3ef2ca
  # ifdef FEAT_WINDOWS
3ef2ca
-     win_T	*wp;
3ef2ca
      tabpage_T	*tp;
3ef2ca
  
3ef2ca
-     /* First try the current tab page. */
3ef2ca
-     wp = buf_jump_open_win(buf);
3ef2ca
      if (wp != NULL)
3ef2ca
  	return wp;
3ef2ca
  
3ef2ca
--- 4431,4440 ----
3ef2ca
  buf_jump_open_tab(buf)
3ef2ca
      buf_T	*buf;
3ef2ca
  {
3ef2ca
+     win_T	*wp = buf_jump_open_win(buf);
3ef2ca
  # ifdef FEAT_WINDOWS
3ef2ca
      tabpage_T	*tp;
3ef2ca
  
3ef2ca
      if (wp != NULL)
3ef2ca
  	return wp;
3ef2ca
  
3ef2ca
***************
3ef2ca
*** 4455,4467 ****
3ef2ca
  		break;
3ef2ca
  	    }
3ef2ca
  	}
3ef2ca
- 
3ef2ca
-     return wp;
3ef2ca
- # else
3ef2ca
-     if (curwin->w_buffer == buf)
3ef2ca
- 	return curwin;
3ef2ca
-     return NULL;
3ef2ca
  # endif
3ef2ca
  }
3ef2ca
  #endif
3ef2ca
  
3ef2ca
--- 4452,4459 ----
3ef2ca
  		break;
3ef2ca
  	    }
3ef2ca
  	}
3ef2ca
  # endif
3ef2ca
+     return wp;
3ef2ca
  }
3ef2ca
  #endif
3ef2ca
  
3ef2ca
*** ../vim-7.4.486/src/testdir/Make_amiga.mak	2014-10-21 16:22:01.403175226 +0200
3ef2ca
--- src/testdir/Make_amiga.mak	2014-10-21 20:46:30.866293607 +0200
3ef2ca
***************
3ef2ca
*** 46,51 ****
3ef2ca
--- 46,52 ----
3ef2ca
  		test_mapping.out \
3ef2ca
  		test_options.out \
3ef2ca
  		test_qf_title.out \
3ef2ca
+ 		test_signs.out \
3ef2ca
  		test_utf8.out
3ef2ca
  
3ef2ca
  .SUFFIXES: .in .out
3ef2ca
***************
3ef2ca
*** 179,182 ****
3ef2ca
--- 180,184 ----
3ef2ca
  test_listlbr_utf8.out: test_listlbr_utf8.in
3ef2ca
  test_options.out: test_options.in
3ef2ca
  test_qf_title.out: test_qf_title.in
3ef2ca
+ test_signs.out: test_signs.in
3ef2ca
  test_utf8.out: test_utf8.in
3ef2ca
*** ../vim-7.4.486/src/testdir/Make_dos.mak	2014-10-21 16:22:01.407175226 +0200
3ef2ca
--- src/testdir/Make_dos.mak	2014-10-21 20:46:30.866293607 +0200
3ef2ca
***************
3ef2ca
*** 45,50 ****
3ef2ca
--- 45,51 ----
3ef2ca
  		test_mapping.out \
3ef2ca
  		test_options.out \
3ef2ca
  		test_qf_title.out \
3ef2ca
+ 		test_signs.out \
3ef2ca
  		test_utf8.out
3ef2ca
  
3ef2ca
  SCRIPTS32 =	test50.out test70.out
3ef2ca
*** ../vim-7.4.486/src/testdir/Make_ming.mak	2014-10-21 16:22:01.407175226 +0200
3ef2ca
--- src/testdir/Make_ming.mak	2014-10-21 20:46:30.866293607 +0200
3ef2ca
***************
3ef2ca
*** 65,70 ****
3ef2ca
--- 65,71 ----
3ef2ca
  		test_mapping.out \
3ef2ca
  		test_options.out \
3ef2ca
  		test_qf_title.out \
3ef2ca
+ 		test_signs.out \
3ef2ca
  		test_utf8.out
3ef2ca
  
3ef2ca
  SCRIPTS32 =	test50.out test70.out
3ef2ca
*** ../vim-7.4.486/src/testdir/Make_os2.mak	2014-10-21 16:22:01.407175226 +0200
3ef2ca
--- src/testdir/Make_os2.mak	2014-10-21 20:46:30.866293607 +0200
3ef2ca
***************
3ef2ca
*** 47,52 ****
3ef2ca
--- 47,53 ----
3ef2ca
  		test_mapping.out \
3ef2ca
  		test_options.out \
3ef2ca
  		test_qf_title.out \
3ef2ca
+ 		test_signs.out \
3ef2ca
  		test_utf8.out
3ef2ca
  
3ef2ca
  .SUFFIXES: .in .out
3ef2ca
*** ../vim-7.4.486/src/testdir/Make_vms.mms	2014-10-21 16:22:01.407175226 +0200
3ef2ca
--- src/testdir/Make_vms.mms	2014-10-21 20:46:30.866293607 +0200
3ef2ca
***************
3ef2ca
*** 106,111 ****
3ef2ca
--- 106,112 ----
3ef2ca
  	 test_mapping.out \
3ef2ca
  	 test_options.out \
3ef2ca
  	 test_qf_title.out \
3ef2ca
+ 	 test_signs.out \
3ef2ca
  	 test_utf8.out
3ef2ca
  
3ef2ca
  # Known problems:
3ef2ca
*** ../vim-7.4.486/src/testdir/Makefile	2014-10-21 16:22:01.407175226 +0200
3ef2ca
--- src/testdir/Makefile	2014-10-21 20:46:30.866293607 +0200
3ef2ca
***************
3ef2ca
*** 43,48 ****
3ef2ca
--- 43,49 ----
3ef2ca
  		test_mapping.out \
3ef2ca
  		test_options.out \
3ef2ca
  		test_qf_title.out \
3ef2ca
+ 		test_signs.out \
3ef2ca
  		test_utf8.out
3ef2ca
  
3ef2ca
  SCRIPTS_GUI = test16.out
3ef2ca
*** ../vim-7.4.486/src/testdir/test_signs.in	2014-10-21 20:56:35.838294928 +0200
3ef2ca
--- src/testdir/test_signs.in	2014-10-21 20:46:30.866293607 +0200
3ef2ca
***************
3ef2ca
*** 0 ****
3ef2ca
--- 1,22 ----
3ef2ca
+ Tests for signs
3ef2ca
+ STARTTEST
3ef2ca
+ :so small.vim
3ef2ca
+ :if !has("signs")
3ef2ca
+ :  e! test.ok
3ef2ca
+ :  wq! test.out
3ef2ca
+ :endif
3ef2ca
+ :"
3ef2ca
+ :sign define JumpSign text=x
3ef2ca
+ :exe 'sign place 42 line=2 name=JumpSign buffer=' . bufnr('')
3ef2ca
+ :" Split the window to the bottom to verify :sign-jump will stay in the current
3ef2ca
+ :" window if the buffer is displayed there
3ef2ca
+ :bot split
3ef2ca
+ :exe 'sign jump 42 buffer=' . bufnr('')
3ef2ca
+ :call append(line('$'), winnr())
3ef2ca
+ :$-1,$w! test.out
3ef2ca
+ ENDTEST
3ef2ca
+ 
3ef2ca
+ STARTTEST
3ef2ca
+ :qa!
3ef2ca
+ ENDTEST
3ef2ca
+ 
3ef2ca
*** ../vim-7.4.486/src/testdir/test_signs.ok	2014-10-21 20:56:35.842294928 +0200
3ef2ca
--- src/testdir/test_signs.ok	2014-10-21 20:46:30.866293607 +0200
3ef2ca
***************
3ef2ca
*** 0 ****
3ef2ca
--- 1,2 ----
3ef2ca
+ 
3ef2ca
+ 2
3ef2ca
*** ../vim-7.4.486/src/version.c	2014-10-21 20:01:54.986287762 +0200
3ef2ca
--- src/version.c	2014-10-21 20:50:02.642294069 +0200
3ef2ca
***************
3ef2ca
*** 743,744 ****
3ef2ca
--- 743,746 ----
3ef2ca
  {   /* Add new patch number below this line */
3ef2ca
+ /**/
3ef2ca
+     487,
3ef2ca
  /**/
3ef2ca
3ef2ca
-- 
3ef2ca
I'd like to meet the man who invented sex and see what he's working on now.
3ef2ca
3ef2ca
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
3ef2ca
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
3ef2ca
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
3ef2ca
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///