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