]> git.pld-linux.org Git - packages/vim.git/blob - 5.7.006
one glob more (fix missing menu.vim problem)
[packages/vim.git] / 5.7.006
1 To: vim-dev@vim.org
2 Subject: Patch 5.7.006
3 Fcc: outbox
4 From: Bram Moolenaar <Bram@moolenaar.net>
5 ------------
6
7 Patch 5.7.006
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
13
14
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
17 ***************
18 *** 1542,1550 ****
19       /* Draw the text */
20       gui_mch_draw_string(gui.row, col, s, len, draw_flags);
21   
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);
25   
26       if (!(flags & (GUI_MON_IS_CURSOR | GUI_MON_TRS_CURSOR)))
27       {
28 --- 1542,1550 ----
29       /* Draw the text */
30       gui_mch_draw_string(gui.row, col, s, len, draw_flags);
31   
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);
35   
36       if (!(flags & (GUI_MON_IS_CURSOR | GUI_MON_TRS_CURSOR)))
37       {
38 ***************
39 *** 1609,1615 ****
40       row2 = Y_2_ROW(y + h - 1);
41       col2 = X_2_COL(x + w - 1);
42   
43 !     (void)gui_redraw_block(row1, col1, row2, col2, 0);
44   
45       /*
46        * We may need to redraw the cursor, but don't take it upon us to change
47 --- 1609,1615 ----
48       row2 = Y_2_ROW(y + h - 1);
49       col2 = X_2_COL(x + w - 1);
50   
51 !     (void)gui_redraw_block(row1, col1, row2, col2, GUI_MON_NOCLEAR);
52   
53       /*
54        * We may need to redraw the cursor, but don't take it upon us to change
55 ***************
56 *** 1620,1628 ****
57        */
58       if (gui.row == gui.cursor_row)
59         gui_update_cursor(FALSE, TRUE);
60
61 -     if (clipboard.state != SELECT_CLEARED)
62 -       clip_redraw_selection(x, y, w, h);
63   }
64   
65   /*
66 --- 1620,1625 ----
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
69 ***************
70 *** 742,761 ****
71   }
72   
73   /*
74 !  * Redraw the selection if character at "row,col" is inside of it.
75    */
76       void
77 ! clip_may_redraw_selection(row, col)
78 !     int       row, col;
79   {
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);
88   }
89   
90   /*
91 --- 742,768 ----
92   }
93   
94   /*
95 !  * Redraw part of the selection if character at "row,col" is inside of it.
96    */
97       void
98 ! clip_may_redraw_selection(row, col, len)
99 !     int               row, col;
100 !     int               len;
101   {
102 +     int               start = col;
103 +     int               end = col + len;
104
105       if (clipboard.state != SELECT_CLEARED
106 !           && row >= clipboard.start.lnum
107 !           && row <= clipboard.end.lnum)
108 !     {
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;
113 !       if (end > start)
114 !           clip_invert_area(row, start, row, end);
115 !     }
116   }
117   
118   /*
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
121 ***************
122 *** 19,25 ****
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));
130 --- 19,25 ----
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
140 ***************
141 *** 439,440 ****
142 --- 439,442 ----
143   {   /* Add new patch number below this line */
144 + /**/
145 +     6,
146   /**/
147
148 -- 
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.
152
153 ///  Bram Moolenaar     Bram@moolenaar.net     http://www.moolenaar.net  \\\
154 \\\  Vim: http://www.vim.org      ICCF Holland: http://iccf-holland.org  ///
This page took 0.131784 seconds and 3 git commands to generate.