310c903
To: vim_dev@googlegroups.com
310c903
Subject: Patch 7.3.129
310c903
Fcc: outbox
310c903
From: Bram Moolenaar <Bram@moolenaar.net>
310c903
Mime-Version: 1.0
310c903
Content-Type: text/plain; charset=UTF-8
310c903
Content-Transfer-Encoding: 8bit
310c903
------------
310c903
310c903
Patch 7.3.129
310c903
Problem:    Using integer like a boolean.
310c903
Solution:   Nicer check for integer being non-zero.
310c903
Files:	    src/tag.c
310c903
310c903
310c903
*** ../vim-7.3.128/src/tag.c	2010-12-17 18:06:00.000000000 +0100
310c903
--- src/tag.c	2010-12-17 17:49:35.000000000 +0100
310c903
***************
310c903
*** 204,210 ****
310c903
      else
310c903
      {
310c903
  #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
310c903
! 	if (g_do_tagpreview)
310c903
  	    use_tagstack = FALSE;
310c903
  	else
310c903
  #endif
310c903
--- 204,210 ----
310c903
      else
310c903
      {
310c903
  #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
310c903
! 	if (g_do_tagpreview != 0)
310c903
  	    use_tagstack = FALSE;
310c903
  	else
310c903
  #endif
310c903
***************
310c903
*** 222,228 ****
310c903
  		    ))
310c903
  	{
310c903
  #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
310c903
! 	    if (g_do_tagpreview)
310c903
  	    {
310c903
  		if (ptag_entry.tagname != NULL
310c903
  			&& STRCMP(ptag_entry.tagname, tag) == 0)
310c903
--- 222,228 ----
310c903
  		    ))
310c903
  	{
310c903
  #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
310c903
! 	    if (g_do_tagpreview != 0)
310c903
  	    {
310c903
  		if (ptag_entry.tagname != NULL
310c903
  			&& STRCMP(ptag_entry.tagname, tag) == 0)
310c903
***************
310c903
*** 278,284 ****
310c903
  	{
310c903
  	    if (
310c903
  #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
310c903
! 		    g_do_tagpreview ? ptag_entry.tagname == NULL :
310c903
  #endif
310c903
  		    tagstacklen == 0)
310c903
  	    {
310c903
--- 278,284 ----
310c903
  	{
310c903
  	    if (
310c903
  #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
310c903
! 		    g_do_tagpreview != 0 ? ptag_entry.tagname == NULL :
310c903
  #endif
310c903
  		    tagstacklen == 0)
310c903
  	    {
310c903
***************
310c903
*** 361,367 ****
310c903
  	       )
310c903
  	    {
310c903
  #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
310c903
! 		if (g_do_tagpreview)
310c903
  		{
310c903
  		    cur_match = ptag_entry.cur_match;
310c903
  		    cur_fnum = ptag_entry.cur_fnum;
310c903
--- 361,367 ----
310c903
  	       )
310c903
  	    {
310c903
  #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
310c903
! 		if (g_do_tagpreview != 0)
310c903
  		{
310c903
  		    cur_match = ptag_entry.cur_match;
310c903
  		    cur_fnum = ptag_entry.cur_fnum;
310c903
***************
310c903
*** 399,405 ****
310c903
  		prevtagstackidx = tagstackidx;
310c903
  
310c903
  #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
310c903
! 		if (g_do_tagpreview)
310c903
  		{
310c903
  		    cur_match = ptag_entry.cur_match;
310c903
  		    cur_fnum = ptag_entry.cur_fnum;
310c903
--- 399,405 ----
310c903
  		prevtagstackidx = tagstackidx;
310c903
  
310c903
  #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
310c903
! 		if (g_do_tagpreview != 0)
310c903
  		{
310c903
  		    cur_match = ptag_entry.cur_match;
310c903
  		    cur_fnum = ptag_entry.cur_fnum;
310c903
***************
310c903
*** 437,443 ****
310c903
  	}
310c903
  
310c903
  #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
310c903
! 	if (g_do_tagpreview)
310c903
  	{
310c903
  	    if (type != DT_SELECT && type != DT_JUMP)
310c903
  	    {
310c903
--- 437,443 ----
310c903
  	}
310c903
  
310c903
  #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
310c903
! 	if (g_do_tagpreview != 0)
310c903
  	{
310c903
  	    if (type != DT_SELECT && type != DT_JUMP)
310c903
  	    {
310c903
***************
310c903
*** 492,498 ****
310c903
  	if (use_tagstack)
310c903
  	    name = tagstack[tagstackidx].tagname;
310c903
  #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
310c903
! 	else if (g_do_tagpreview)
310c903
  	    name = ptag_entry.tagname;
310c903
  #endif
310c903
  	else
310c903
--- 492,498 ----
310c903
  	if (use_tagstack)
310c903
  	    name = tagstack[tagstackidx].tagname;
310c903
  #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
310c903
! 	else if (g_do_tagpreview != 0)
310c903
  	    name = ptag_entry.tagname;
310c903
  #endif
310c903
  	else
310c903
***************
310c903
*** 620,626 ****
310c903
  		    parse_match(matches[i], &tagp);
310c903
  		    if (!new_tag && (
310c903
  #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
310c903
! 				(g_do_tagpreview
310c903
  				 && i == ptag_entry.cur_match) ||
310c903
  #endif
310c903
  				(use_tagstack
310c903
--- 620,626 ----
310c903
  		    parse_match(matches[i], &tagp);
310c903
  		    if (!new_tag && (
310c903
  #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
310c903
! 				(g_do_tagpreview != 0
310c903
  				 && i == ptag_entry.cur_match) ||
310c903
  #endif
310c903
  				(use_tagstack
310c903
***************
310c903
*** 962,968 ****
310c903
  		++tagstackidx;
310c903
  	    }
310c903
  #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
310c903
! 	    else if (g_do_tagpreview)
310c903
  	    {
310c903
  		ptag_entry.cur_match = cur_match;
310c903
  		ptag_entry.cur_fnum = cur_fnum;
310c903
--- 962,968 ----
310c903
  		++tagstackidx;
310c903
  	    }
310c903
  #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
310c903
! 	    else if (g_do_tagpreview != 0)
310c903
  	    {
310c903
  		ptag_entry.cur_match = cur_match;
310c903
  		ptag_entry.cur_fnum = cur_fnum;
310c903
***************
310c903
*** 3110,3116 ****
310c903
  #endif
310c903
  
310c903
  #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
310c903
!     if (g_do_tagpreview)
310c903
      {
310c903
  	postponed_split = 0;	/* don't split again below */
310c903
  	curwin_save = curwin;	/* Save current window */
310c903
--- 3110,3116 ----
310c903
  #endif
310c903
  
310c903
  #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
310c903
!     if (g_do_tagpreview != 0)
310c903
      {
310c903
  	postponed_split = 0;	/* don't split again below */
310c903
  	curwin_save = curwin;	/* Save current window */
310c903
***************
310c903
*** 3148,3154 ****
310c903
  	/* A :ta from a help file will keep the b_help flag set.  For ":ptag"
310c903
  	 * we need to use the flag from the window where we came from. */
310c903
  #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
310c903
! 	if (g_do_tagpreview)
310c903
  	    keep_help_flag = curwin_save->w_buffer->b_help;
310c903
  	else
310c903
  #endif
310c903
--- 3148,3154 ----
310c903
  	/* A :ta from a help file will keep the b_help flag set.  For ":ptag"
310c903
  	 * we need to use the flag from the window where we came from. */
310c903
  #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
310c903
! 	if (g_do_tagpreview != 0)
310c903
  	    keep_help_flag = curwin_save->w_buffer->b_help;
310c903
  	else
310c903
  #endif
310c903
***************
310c903
*** 3322,3328 ****
310c903
  	}
310c903
  
310c903
  #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
310c903
! 	if (g_do_tagpreview && curwin != curwin_save && win_valid(curwin_save))
310c903
  	{
310c903
  	    /* Return cursor to where we were */
310c903
  	    validate_cursor();
310c903
--- 3322,3329 ----
310c903
  	}
310c903
  
310c903
  #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
310c903
! 	if (g_do_tagpreview != 0
310c903
! 			   && curwin != curwin_save && win_valid(curwin_save))
310c903
  	{
310c903
  	    /* Return cursor to where we were */
310c903
  	    validate_cursor();
310c903
*** ../vim-7.3.128/src/version.c	2011-02-25 15:11:17.000000000 +0100
310c903
--- src/version.c	2011-02-25 15:12:25.000000000 +0100
310c903
***************
310c903
*** 716,717 ****
310c903
--- 716,719 ----
310c903
  {   /* Add new patch number below this line */
310c903
+ /**/
310c903
+     129,
310c903
  /**/
310c903
310c903
-- 
310c903
PRINCE:    He's come to rescue me, father.
310c903
LAUNCELOT: (embarrassed) Well, let's not jump to conclusions ...
310c903
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
310c903
310c903
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
310c903
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
310c903
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
310c903
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///