43459ae
To: vim-dev@vim.org
43459ae
Subject: Patch 7.2.148
43459ae
Fcc: outbox
43459ae
From: Bram Moolenaar <Bram@moolenaar.net>
43459ae
Mime-Version: 1.0
43459ae
Content-Type: text/plain; charset=ISO-8859-1
43459ae
Content-Transfer-Encoding: 8bit
43459ae
------------
43459ae
43459ae
Patch 7.2.148
43459ae
Problem:    When searching for "$" while 'hlsearch' is set, highlighting the
43459ae
	    character after the line does not work in the cursor column.
43459ae
	    Also highlighting for Visual mode after the line end when this
43459ae
	    isn't needed.  (Markus Heidelberg)
43459ae
Solution:   Only compare the cursor column in the cursor line.  Only highlight
43459ae
	    for Visual selection after the last character when it's needed to
43459ae
	    see where the Visual selection ends.
43459ae
Files:	    src/screen.c
43459ae
43459ae
43459ae
*** ../vim-7.2.147/src/screen.c	Wed Mar 18 16:26:31 2009
43459ae
--- src/screen.c	Wed Mar 18 17:24:56 2009
43459ae
***************
43459ae
*** 2889,2896 ****
43459ae
  	}
43459ae
  	else
43459ae
  	    tocol = MAXCOL;
43459ae
! 	if (fromcol == tocol)		/* do at least one character */
43459ae
! 	    tocol = fromcol + 1;	/* happens when past end of line */
43459ae
  	area_highlighting = TRUE;
43459ae
  	attr = hl_attr(HLF_I);
43459ae
      }
43459ae
--- 2889,2897 ----
43459ae
  	}
43459ae
  	else
43459ae
  	    tocol = MAXCOL;
43459ae
! 	/* do at least one character; happens when past end of line */
43459ae
! 	if (fromcol == tocol)
43459ae
! 	    tocol = fromcol + 1;
43459ae
  	area_highlighting = TRUE;
43459ae
  	attr = hl_attr(HLF_I);
43459ae
      }
43459ae
***************
43459ae
*** 4118,4123 ****
43459ae
--- 4119,4125 ----
43459ae
  # endif
43459ae
  				    (col < W_WIDTH(wp)))
43459ae
  				&& !(noinvcur
43459ae
+ 				    && lnum == wp->w_cursor.lnum
43459ae
  				    && (colnr_T)vcol == wp->w_virtcol)))
43459ae
  			&& lcs_eol_one >= 0)
43459ae
  		{
43459ae
***************
43459ae
*** 4259,4265 ****
43459ae
  	 * preedit_changed and commit.  Thus Vim can't set "im_is_active", use
43459ae
  	 * im_is_preediting() here. */
43459ae
  	if (xic != NULL
43459ae
! 		&& lnum == curwin->w_cursor.lnum
43459ae
  		&& (State & INSERT)
43459ae
  		&& !p_imdisable
43459ae
  		&& im_is_preediting()
43459ae
--- 4261,4267 ----
43459ae
  	 * preedit_changed and commit.  Thus Vim can't set "im_is_active", use
43459ae
  	 * im_is_preediting() here. */
43459ae
  	if (xic != NULL
43459ae
! 		&& lnum == wp->w_cursor.lnum
43459ae
  		&& (State & INSERT)
43459ae
  		&& !p_imdisable
43459ae
  		&& im_is_preediting()
43459ae
***************
43459ae
*** 4268,4274 ****
43459ae
  	    colnr_T tcol;
43459ae
  
43459ae
  	    if (preedit_end_col == MAXCOL)
43459ae
! 		getvcol(curwin, &(curwin->w_cursor), &tcol, NULL, NULL);
43459ae
  	    else
43459ae
  		tcol = preedit_end_col;
43459ae
  	    if ((long)preedit_start_col <= vcol && vcol < (long)tcol)
43459ae
--- 4270,4276 ----
43459ae
  	    colnr_T tcol;
43459ae
  
43459ae
  	    if (preedit_end_col == MAXCOL)
43459ae
! 		getvcol(curwin, &(wp->w_cursor), &tcol, NULL, NULL);
43459ae
  	    else
43459ae
  		tcol = preedit_end_col;
43459ae
  	    if ((long)preedit_start_col <= vcol && vcol < (long)tcol)
43459ae
***************
43459ae
*** 4365,4371 ****
43459ae
  	    }
43459ae
  #endif
43459ae
  	    if (lcs_eol == lcs_eol_one
43459ae
! 		    && ((area_attr != 0 && vcol == fromcol && c == NUL)
43459ae
  #ifdef FEAT_SEARCH_EXTRA
43459ae
  			/* highlight 'hlsearch' match at end of line */
43459ae
  			|| (prevcol_hl_flag == TRUE
43459ae
--- 4367,4379 ----
43459ae
  	    }
43459ae
  #endif
43459ae
  	    if (lcs_eol == lcs_eol_one
43459ae
! 		    && ((area_attr != 0 && vcol == fromcol
43459ae
! #ifdef FEAT_VISUAL
43459ae
! 			    && (VIsual_mode != Ctrl_V
43459ae
! 				|| lnum == VIsual.lnum
43459ae
! 				|| lnum == curwin->w_cursor.lnum)
43459ae
! #endif
43459ae
! 			    && c == NUL)
43459ae
  #ifdef FEAT_SEARCH_EXTRA
43459ae
  			/* highlight 'hlsearch' match at end of line */
43459ae
  			|| (prevcol_hl_flag == TRUE
43459ae
***************
43459ae
*** 4459,4465 ****
43459ae
  	if (c == NUL)
43459ae
  	{
43459ae
  #ifdef FEAT_SYN_HL
43459ae
! 	    if (eol_hl_off > 0 && vcol - eol_hl_off == (long)wp->w_virtcol)
43459ae
  	    {
43459ae
  		/* highlight last char after line */
43459ae
  		--col;
43459ae
--- 4467,4474 ----
43459ae
  	if (c == NUL)
43459ae
  	{
43459ae
  #ifdef FEAT_SYN_HL
43459ae
! 	    if (eol_hl_off > 0 && vcol - eol_hl_off == (long)wp->w_virtcol
43459ae
! 		    && lnum == wp->w_cursor.lnum)
43459ae
  	    {
43459ae
  		/* highlight last char after line */
43459ae
  		--col;
43459ae
*** ../vim-7.2.147/src/version.c	Wed Mar 18 16:26:31 2009
43459ae
--- src/version.c	Wed Mar 18 19:05:37 2009
43459ae
***************
43459ae
*** 678,679 ****
43459ae
--- 678,681 ----
43459ae
  {   /* Add new patch number below this line */
43459ae
+ /**/
43459ae
+     148,
43459ae
  /**/
43459ae
43459ae
-- 
43459ae
hundred-and-one symptoms of being an internet addict:
43459ae
239. You think "surfing" is something you do on dry land.
43459ae
43459ae
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
43459ae
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
43459ae
\\\        download, build and distribute -- http://www.A-A-P.org        ///
43459ae
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///