4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
11 Problem: When using Visual block mode with 'cursorcolumn' it's unclear what
13 Solution: Don't use 'cursorcolumn' highlighting inside the Visual selection.
14 (idea by Dominique Pelle)
18 *** ../vim-7.2.110/src/screen.c Wed Oct 1 21:09:02 2008
19 --- src/screen.c Sat Feb 21 21:04:19 2009
23 int noinvcur = FALSE; /* don't invert the cursor */
26 + int lnum_in_visual_area = FALSE;
33 bot = &curwin->w_cursor;
35 if (VIsual_mode == Ctrl_V) /* block mode */
37 ! if (lnum >= top->lnum && lnum <= bot->lnum)
39 fromcol = wp->w_old_cursor_fcol;
40 tocol = wp->w_old_cursor_lcol;
43 bot = &curwin->w_cursor;
45 + lnum_in_visual_area = (lnum >= top->lnum && lnum <= bot->lnum);
46 if (VIsual_mode == Ctrl_V) /* block mode */
48 ! if (lnum_in_visual_area)
50 fromcol = wp->w_old_cursor_fcol;
51 tocol = wp->w_old_cursor_lcol;
54 * highlight the cursor position itself. */
55 if (wp->w_p_cuc && vcol == (long)wp->w_virtcol
56 && lnum != wp->w_cursor.lnum
57 ! && draw_state == WL_LINE)
59 vcol_save_attr = char_attr;
60 char_attr = hl_combine_attr(char_attr, hl_attr(HLF_CUC));
62 * highlight the cursor position itself. */
63 if (wp->w_p_cuc && vcol == (long)wp->w_virtcol
64 && lnum != wp->w_cursor.lnum
65 ! && draw_state == WL_LINE
66 ! && !lnum_in_visual_area)
68 vcol_save_attr = char_attr;
69 char_attr = hl_combine_attr(char_attr, hl_attr(HLF_CUC));
70 *** ../vim-7.2.110/src/version.c Sat Feb 21 20:36:30 2009
71 --- src/version.c Sat Feb 21 21:08:14 2009
75 { /* Add new patch number below this line */
81 Contrary to popular belief, Unix is user friendly.
82 It just happens to be selective about who it makes friends with.
85 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
86 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
87 \\\ download, build and distribute -- http://www.A-A-P.org ///
88 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///