Karsten Hopp 9c8106
To: vim-dev@vim.org
Karsten Hopp 9c8106
Subject: Patch 7.2.111
Karsten Hopp 9c8106
Fcc: outbox
Karsten Hopp 9c8106
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 9c8106
Mime-Version: 1.0
Karsten Hopp 9c8106
Content-Type: text/plain; charset=ISO-8859-1
Karsten Hopp 9c8106
Content-Transfer-Encoding: 8bit
Karsten Hopp 9c8106
------------
Karsten Hopp 9c8106
Karsten Hopp 9c8106
Patch 7.2.111
Karsten Hopp 9c8106
Problem:    When using Visual block mode with 'cursorcolumn' it's unclear what
Karsten Hopp 9c8106
            is selected.
Karsten Hopp 9c8106
Solution:   Don't use 'cursorcolumn' highlighting inside the Visual selection.
Karsten Hopp 9c8106
            (idea by Dominique Pelle)
Karsten Hopp 9c8106
Files:      src/screen.c
Karsten Hopp 9c8106
    
Karsten Hopp 9c8106
Karsten Hopp 9c8106
*** ../vim-7.2.110/src/screen.c	Wed Oct  1 21:09:02 2008
Karsten Hopp 9c8106
--- src/screen.c	Sat Feb 21 21:04:19 2009
Karsten Hopp 9c8106
***************
Karsten Hopp 9c8106
*** 2596,2601 ****
Karsten Hopp 9c8106
--- 2596,2602 ----
Karsten Hopp 9c8106
      int		noinvcur = FALSE;	/* don't invert the cursor */
Karsten Hopp 9c8106
  #ifdef FEAT_VISUAL
Karsten Hopp 9c8106
      pos_T	*top, *bot;
Karsten Hopp 9c8106
+     int		lnum_in_visual_area = FALSE;
Karsten Hopp 9c8106
  #endif
Karsten Hopp 9c8106
      pos_T	pos;
Karsten Hopp 9c8106
      long	v;
Karsten Hopp 9c8106
***************
Karsten Hopp 9c8106
*** 2792,2800 ****
Karsten Hopp 9c8106
  	    top = &VIsual;
Karsten Hopp 9c8106
  	    bot = &curwin->w_cursor;
Karsten Hopp 9c8106
  	}
Karsten Hopp 9c8106
  	if (VIsual_mode == Ctrl_V)	/* block mode */
Karsten Hopp 9c8106
  	{
Karsten Hopp 9c8106
! 	    if (lnum >= top->lnum && lnum <= bot->lnum)
Karsten Hopp 9c8106
  	    {
Karsten Hopp 9c8106
  		fromcol = wp->w_old_cursor_fcol;
Karsten Hopp 9c8106
  		tocol = wp->w_old_cursor_lcol;
Karsten Hopp 9c8106
--- 2793,2802 ----
Karsten Hopp 9c8106
  	    top = &VIsual;
Karsten Hopp 9c8106
  	    bot = &curwin->w_cursor;
Karsten Hopp 9c8106
  	}
Karsten Hopp 9c8106
+ 	lnum_in_visual_area = (lnum >= top->lnum && lnum <= bot->lnum);
Karsten Hopp 9c8106
  	if (VIsual_mode == Ctrl_V)	/* block mode */
Karsten Hopp 9c8106
  	{
Karsten Hopp 9c8106
! 	    if (lnum_in_visual_area)
Karsten Hopp 9c8106
  	    {
Karsten Hopp 9c8106
  		fromcol = wp->w_old_cursor_fcol;
Karsten Hopp 9c8106
  		tocol = wp->w_old_cursor_lcol;
Karsten Hopp 9c8106
***************
Karsten Hopp 9c8106
*** 4557,4563 ****
Karsten Hopp 9c8106
  	 * highlight the cursor position itself. */
Karsten Hopp 9c8106
  	if (wp->w_p_cuc && vcol == (long)wp->w_virtcol
Karsten Hopp 9c8106
  		&& lnum != wp->w_cursor.lnum
Karsten Hopp 9c8106
! 		&& draw_state == WL_LINE)
Karsten Hopp 9c8106
  	{
Karsten Hopp 9c8106
  	    vcol_save_attr = char_attr;
Karsten Hopp 9c8106
  	    char_attr = hl_combine_attr(char_attr, hl_attr(HLF_CUC));
Karsten Hopp 9c8106
--- 4560,4567 ----
Karsten Hopp 9c8106
  	 * highlight the cursor position itself. */
Karsten Hopp 9c8106
  	if (wp->w_p_cuc && vcol == (long)wp->w_virtcol
Karsten Hopp 9c8106
  		&& lnum != wp->w_cursor.lnum
Karsten Hopp 9c8106
! 		&& draw_state == WL_LINE
Karsten Hopp 9c8106
! 		&& !lnum_in_visual_area)
Karsten Hopp 9c8106
  	{
Karsten Hopp 9c8106
  	    vcol_save_attr = char_attr;
Karsten Hopp 9c8106
  	    char_attr = hl_combine_attr(char_attr, hl_attr(HLF_CUC));
Karsten Hopp 9c8106
*** ../vim-7.2.110/src/version.c	Sat Feb 21 20:36:30 2009
Karsten Hopp 9c8106
--- src/version.c	Sat Feb 21 21:08:14 2009
Karsten Hopp 9c8106
***************
Karsten Hopp 9c8106
*** 678,679 ****
Karsten Hopp 9c8106
--- 678,681 ----
Karsten Hopp 9c8106
  {   /* Add new patch number below this line */
Karsten Hopp 9c8106
+ /**/
Karsten Hopp 9c8106
+     111,
Karsten Hopp 9c8106
  /**/
Karsten Hopp 9c8106
Karsten Hopp 9c8106
-- 
Karsten Hopp 9c8106
Contrary to popular belief, Unix is user friendly.
Karsten Hopp 9c8106
It just happens to be selective about who it makes friends with.
Karsten Hopp 9c8106
                                               -- Dave Parnas
Karsten Hopp 9c8106
Karsten Hopp 9c8106
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 9c8106
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 9c8106
\\\        download, build and distribute -- http://www.A-A-P.org        ///
Karsten Hopp 9c8106
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///