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