|
1 To: [email protected] |
|
2 Subject: Patch 7.2.099 |
|
3 Fcc: outbox |
|
4 From: Bram Moolenaar <[email protected]> |
|
5 Mime-Version: 1.0 |
|
6 Content-Type: text/plain; charset=ISO-8859-1 |
|
7 Content-Transfer-Encoding: 8bit |
|
8 ------------ |
|
9 |
|
10 Patch 7.2.099 |
|
11 Problem: Changing GUI options causes an unnecessary redraw when the GUI |
|
12 isn't active. |
|
13 Solution: Avoid the redraw. (Lech Lorens) |
|
14 Files: src/option.c |
|
15 |
|
16 |
|
17 *** ../vim-7.2.098/src/option.c Wed Dec 24 12:53:33 2008 |
|
18 --- src/option.c Wed Feb 4 16:59:56 2009 |
|
19 *************** |
|
20 *** 5407,5412 **** |
|
21 --- 5407,5416 ---- |
|
22 int did_chartab = FALSE; |
|
23 char_u **gvarp; |
|
24 long_u free_oldval = (options[opt_idx].flags & P_ALLOCED); |
|
25 + #ifdef FEAT_GUI |
|
26 + /* set when changing an option that only requires a redraw in the GUI */ |
|
27 + int redraw_gui_only = FALSE; |
|
28 + #endif |
|
29 |
|
30 /* Get the global option to compare with, otherwise we would have to check |
|
31 * two values for all local options. */ |
|
32 *************** |
|
33 *** 6055,6060 **** |
|
34 --- 6059,6065 ---- |
|
35 errmsg = (char_u *)N_("E596: Invalid font(s)"); |
|
36 } |
|
37 } |
|
38 + redraw_gui_only = TRUE; |
|
39 } |
|
40 # ifdef FEAT_XFONTSET |
|
41 else if (varp == &p_guifontset) |
|
42 *************** |
|
43 *** 6063,6068 **** |
|
44 --- 6068,6074 ---- |
|
45 errmsg = (char_u *)N_("E597: can't select fontset"); |
|
46 else if (gui.in_use && gui_init_font(p_guifontset, TRUE) != OK) |
|
47 errmsg = (char_u *)N_("E598: Invalid fontset"); |
|
48 + redraw_gui_only = TRUE; |
|
49 } |
|
50 # endif |
|
51 # ifdef FEAT_MBYTE |
|
52 *************** |
|
53 *** 6072,6077 **** |
|
54 --- 6078,6084 ---- |
|
55 errmsg = (char_u *)N_("E533: can't select wide font"); |
|
56 else if (gui_get_wide_font() == FAIL) |
|
57 errmsg = (char_u *)N_("E534: Invalid wide font"); |
|
58 + redraw_gui_only = TRUE; |
|
59 } |
|
60 # endif |
|
61 #endif |
|
62 *************** |
|
63 *** 6133,6145 **** |
|
64 --- 6140,6163 ---- |
|
65 #ifdef FEAT_GUI |
|
66 /* 'guioptions' */ |
|
67 else if (varp == &p_go) |
|
68 + { |
|
69 gui_init_which_components(oldval); |
|
70 + redraw_gui_only = TRUE; |
|
71 + } |
|
72 #endif |
|
73 |
|
74 #if defined(FEAT_GUI_TABLINE) |
|
75 /* 'guitablabel' */ |
|
76 else if (varp == &p_gtl) |
|
77 + { |
|
78 redraw_tabline = TRUE; |
|
79 + redraw_gui_only = TRUE; |
|
80 + } |
|
81 + /* 'guitabtooltip' */ |
|
82 + else if (varp == &p_gtt) |
|
83 + { |
|
84 + redraw_gui_only = TRUE; |
|
85 + } |
|
86 #endif |
|
87 |
|
88 #if defined(FEAT_MOUSE_TTY) && (defined(UNIX) || defined(VMS)) |
|
89 *************** |
|
90 *** 6717,6723 **** |
|
91 |
|
92 if (curwin->w_curswant != MAXCOL) |
|
93 curwin->w_set_curswant = TRUE; /* in case 'showbreak' changed */ |
|
94 ! check_redraw(options[opt_idx].flags); |
|
95 |
|
96 return errmsg; |
|
97 } |
|
98 --- 6735,6745 ---- |
|
99 |
|
100 if (curwin->w_curswant != MAXCOL) |
|
101 curwin->w_set_curswant = TRUE; /* in case 'showbreak' changed */ |
|
102 ! #ifdef FEAT_GUI |
|
103 ! /* check redraw when it's not a GUI option or the GUI is active. */ |
|
104 ! if (!redraw_gui_only || gui.in_use) |
|
105 ! #endif |
|
106 ! check_redraw(options[opt_idx].flags); |
|
107 |
|
108 return errmsg; |
|
109 } |
|
110 *** ../vim-7.2.098/src/version.c Wed Feb 4 16:25:53 2009 |
|
111 --- src/version.c Wed Feb 4 17:24:11 2009 |
|
112 *************** |
|
113 *** 678,679 **** |
|
114 --- 678,681 ---- |
|
115 { /* Add new patch number below this line */ |
|
116 + /**/ |
|
117 + 99, |
|
118 /**/ |
|
119 |
|
120 -- |
|
121 I started out with nothing, and I still have most of it. |
|
122 -- Michael Davis -- "Tonight Show" |
|
123 |
|
124 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\ |
|
125 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ |
|
126 \\\ download, build and distribute -- http://www.A-A-P.org /// |
|
127 \\\ help me help AIDS victims -- http://ICCF-Holland.org /// |