Blame SOURCES/7.4.487

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