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