4 From: Bram Moolenaar <Bram@moolenaar.net>
8 Problem: GUI: redrawing the non-Visual selection is wrong when the window
9 is unobscured. (Jean-Pierre Etienne)
10 Solution: Redraw the selection properly and don't clear it. Added "len"
11 argument to clip_may_redraw_selection().
12 Files: src/gui.c, src/ui.c, src/proto/ui.pro
15 *** ../vim-5.7.5/src/gui.c Sun Jun 18 13:56:27 2000
16 --- src/gui.c Sat Aug 5 15:45:18 2000
20 gui_mch_draw_string(gui.row, col, s, len, draw_flags);
22 ! /* May need to invert it when it's part of the selection (assumes len==1) */
23 if (flags & GUI_MON_NOCLEAR)
24 ! clip_may_redraw_selection(gui.row, col);
26 if (!(flags & (GUI_MON_IS_CURSOR | GUI_MON_TRS_CURSOR)))
30 gui_mch_draw_string(gui.row, col, s, len, draw_flags);
32 ! /* May need to invert it when it's part of the selection. */
33 if (flags & GUI_MON_NOCLEAR)
34 ! clip_may_redraw_selection(gui.row, col, len);
36 if (!(flags & (GUI_MON_IS_CURSOR | GUI_MON_TRS_CURSOR)))
40 row2 = Y_2_ROW(y + h - 1);
41 col2 = X_2_COL(x + w - 1);
43 ! (void)gui_redraw_block(row1, col1, row2, col2, 0);
46 * We may need to redraw the cursor, but don't take it upon us to change
48 row2 = Y_2_ROW(y + h - 1);
49 col2 = X_2_COL(x + w - 1);
51 ! (void)gui_redraw_block(row1, col1, row2, col2, GUI_MON_NOCLEAR);
54 * We may need to redraw the cursor, but don't take it upon us to change
58 if (gui.row == gui.cursor_row)
59 gui_update_cursor(FALSE, TRUE);
61 - if (clipboard.state != SELECT_CLEARED)
62 - clip_redraw_selection(x, y, w, h);
67 *** ../vim-5.7.5/src/ui.c Sat Aug 5 15:43:46 2000
68 --- src/ui.c Sat Aug 5 15:33:18 2000
74 ! * Redraw the selection if character at "row,col" is inside of it.
77 ! clip_may_redraw_selection(row, col)
80 if (clipboard.state != SELECT_CLEARED
81 ! && ((row == clipboard.start.lnum
82 ! && col >= (int)clipboard.start.col)
83 ! || row > clipboard.start.lnum)
84 ! && ((row == clipboard.end.lnum
85 ! && col < (int)clipboard.end.col)
86 ! || row < clipboard.end.lnum))
87 ! clip_invert_area(row, col, row, col + 1);
95 ! * Redraw part of the selection if character at "row,col" is inside of it.
98 ! clip_may_redraw_selection(row, col, len)
103 + int end = col + len;
105 if (clipboard.state != SELECT_CLEARED
106 ! && row >= clipboard.start.lnum
107 ! && row <= clipboard.end.lnum)
109 ! if (row == clipboard.start.lnum && start < (int)clipboard.start.col)
110 ! start = clipboard.start.col;
111 ! if (row == clipboard.end.lnum && end > (int)clipboard.end.col)
112 ! end = clipboard.end.col;
114 ! clip_invert_area(row, start, row, end);
119 *** ../vim-5.7.5/src/proto/ui.pro Sat Jun 24 11:19:16 2000
120 --- src/proto/ui.pro Sat Aug 5 15:33:41 2000
123 void clip_start_selection __ARGS((int button, int x, int y, int repeated_click, int_u modifiers));
124 void clip_process_selection __ARGS((int button, int x, int y, int repeated_click, int_u modifiers));
125 void clip_redraw_selection __ARGS((int x, int y, int w, int h));
126 ! void clip_may_redraw_selection __ARGS((int row, int col));
127 void clip_clear_selection __ARGS((void));
128 void clip_may_clear_selection __ARGS((int row1, int row2));
129 void clip_scroll_selection __ARGS((int rows));
131 void clip_start_selection __ARGS((int button, int x, int y, int repeated_click, int_u modifiers));
132 void clip_process_selection __ARGS((int button, int x, int y, int repeated_click, int_u modifiers));
133 void clip_redraw_selection __ARGS((int x, int y, int w, int h));
134 ! void clip_may_redraw_selection __ARGS((int row, int col, int len));
135 void clip_clear_selection __ARGS((void));
136 void clip_may_clear_selection __ARGS((int row1, int row2));
137 void clip_scroll_selection __ARGS((int rows));
138 *** ../vim-5.7.5/src/version.c Sat Aug 5 15:43:46 2000
139 --- src/version.c Sat Aug 5 15:42:30 2000
143 { /* Add new patch number below this line */
149 hundred-and-one symptoms of being an internet addict:
150 126. You brag to all of your friends about your date Saturday night...but
151 you don't tell them it was only in a chat room.
153 /// Bram Moolenaar Bram@moolenaar.net http://www.moolenaar.net \\\
154 \\\ Vim: http://www.vim.org ICCF Holland: http://iccf-holland.org ///