Dominique Pelle wrote:

> But the patch breaks something.  See the 2 screenshots
> before & after patch (gvim-7.2.102 with/without patch):
>
> http://dominique.pelle.free.fr/pic/visual-sel-before-patch.png
> http://dominique.pelle.free.fr/pic/visual-sel-after-patch.png
>
> After patch, the column in the visual selection where cursor
> is located has the highlight of visual selection instead of
> CursorColumn (good).  However, notice that with the
> patch, the cursorcolumn is no longer completely highlighted
> outside the visual selection which is not right (before patch
> was better in that regard). With patch, the cursor line becomes
> only  highlighted beyond the end of lines (not good).


This new attached patch fixes the problem but I described
with the original patch (patch broke highlighting of cuc outside
visual selection).

See new screenshot with latest patch:

http://dominique.pelle.free.fr/pic/visual-sel-after-new-patch.png

That looks better to me: notice on screenshot that cursor's
column is now properly highlighted outside the visual selection
(using CursorColumn highlight group) and inside the visual
selection the visual selection using Visual highlight group.

Now remains the question. Why the inconsistency: visual
selection disables the cursorline highlighting?  Should this
also be fixed?

Cheers
-- Dominique

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Index: screen.c
===================================================================
RCS file: /cvsroot/vim/vim7/src/screen.c,v
retrieving revision 1.109
diff -c -r1.109 screen.c
*** screen.c	2 Oct 2008 16:04:00 -0000	1.109
--- screen.c	7 Feb 2009 10:41:35 -0000
***************
*** 4555,4569 ****
  #ifdef FEAT_SYN_HL
  	/* Highlight the cursor column if 'cursorcolumn' is set.  But don't
  	 * highlight the cursor position itself. */
- 	if (wp->w_p_cuc && vcol == (long)wp->w_virtcol
- 		&& lnum != wp->w_cursor.lnum
- 		&& draw_state == WL_LINE)
  	{
! 	    vcol_save_attr = char_attr;
! 	    char_attr = hl_combine_attr(char_attr, hl_attr(HLF_CUC));
! 	}
! 	else
! 	    vcol_save_attr = -1;
  #endif
  
  	/*
--- 4555,4595 ----
  #ifdef FEAT_SYN_HL
  	/* Highlight the cursor column if 'cursorcolumn' is set.  But don't
  	 * highlight the cursor position itself. */
  	{
! 	    int in_visual_range;
! 
! 	    if (VIsual_active)
! 	    {
! 		int min_visual_lnum;
! 		int max_visual_lnum;
! 		
! 		if (wp->w_old_cursor_lnum < wp->w_old_visual_lnum)
! 		{
! 		    min_visual_lnum = wp->w_old_cursor_lnum;
! 		    max_visual_lnum = wp->w_old_visual_lnum;
! 		}
! 		else
! 		{
! 		    min_visual_lnum = wp->w_old_visual_lnum;
! 		    max_visual_lnum = wp->w_old_cursor_lnum;
! 		}
! 		in_visual_range = lnum >= min_visual_lnum 
! 			       && lnum <= max_visual_lnum;
! 	    }
! 	    else
! 		in_visual_range = 0;
! 
! 	    if (wp->w_p_cuc && vcol == (long)wp->w_virtcol
! 		    && lnum != wp->w_cursor.lnum
! 		    && draw_state == WL_LINE
! 		    && !in_visual_range)
! 	    {
! 		vcol_save_attr = char_attr;
!                 char_attr = hl_combine_attr(char_attr, hl_attr(HLF_CUC));
!             }
!             else
!                 vcol_save_attr = -1;
!         }
  #endif
  
  	/*

Raspunde prin e-mail lui