|
1 To: [email protected] |
|
2 Subject: Patch 7.2.389 |
|
3 Fcc: outbox |
|
4 From: Bram Moolenaar <[email protected]> |
|
5 Mime-Version: 1.0 |
|
6 Content-Type: text/plain; charset=UTF-8 |
|
7 Content-Transfer-Encoding: 8bit |
|
8 ------------ |
|
9 |
|
10 Patch 7.2.389 |
|
11 Problem: synIDattr() cannot return the font. |
|
12 Solution: Support the "font" argument. (Christian Brabandt) |
|
13 Files: runtime/doc/eval.txt, src/eval.c, src/syntax.c |
|
14 |
|
15 |
|
16 *** ../vim-7.2.388/runtime/doc/eval.txt 2010-01-19 15:51:29.000000000 +0100 |
|
17 --- runtime/doc/eval.txt 2010-03-10 12:52:12.000000000 +0100 |
|
18 *************** |
|
19 *** 5370,5375 **** |
|
20 --- 5388,5395 ---- |
|
21 the color, cterm: color number as a string, |
|
22 term: empty string) |
|
23 "bg" background color (as with "fg") |
|
24 + "font" font name (only available in the GUI) |
|
25 + |highlight-font| |
|
26 "sp" special color (as with "fg") |highlight-guisp| |
|
27 "fg#" like "fg", but for the GUI and the GUI is |
|
28 running the name in "#RRGGBB" form |
|
29 *************** |
|
30 *** 5379,5384 **** |
|
31 --- 5399,5405 ---- |
|
32 "italic" "1" if italic |
|
33 "reverse" "1" if reverse |
|
34 "inverse" "1" if inverse (= reverse) |
|
35 + "standout" "1" if standout |
|
36 "underline" "1" if underlined |
|
37 "undercurl" "1" if undercurled |
|
38 |
|
39 *** ../vim-7.2.388/src/eval.c 2010-02-24 15:47:58.000000000 +0100 |
|
40 --- src/eval.c 2010-03-10 12:54:27.000000000 +0100 |
|
41 *************** |
|
42 *** 16627,16633 **** |
|
43 p = highlight_has_attr(id, HL_BOLD, modec); |
|
44 break; |
|
45 |
|
46 ! case 'f': /* fg[#] */ |
|
47 p = highlight_color(id, what, modec); |
|
48 break; |
|
49 |
|
50 --- 16627,16633 ---- |
|
51 p = highlight_has_attr(id, HL_BOLD, modec); |
|
52 break; |
|
53 |
|
54 ! case 'f': /* fg[#] or font */ |
|
55 p = highlight_color(id, what, modec); |
|
56 break; |
|
57 |
|
58 *** ../vim-7.2.388/src/syntax.c 2010-03-02 17:50:30.000000000 +0100 |
|
59 --- src/syntax.c 2010-03-10 13:05:39.000000000 +0100 |
|
60 *************** |
|
61 *** 8326,8332 **** |
|
62 char_u * |
|
63 highlight_color(id, what, modec) |
|
64 int id; |
|
65 ! char_u *what; /* "fg", "bg", "sp", "fg#", "bg#" or "sp#" */ |
|
66 int modec; /* 'g' for GUI, 'c' for cterm, 't' for term */ |
|
67 { |
|
68 static char_u name[20]; |
|
69 --- 8326,8332 ---- |
|
70 char_u * |
|
71 highlight_color(id, what, modec) |
|
72 int id; |
|
73 ! char_u *what; /* "font", "fg", "bg", "sp", "fg#", "bg#" or "sp#" */ |
|
74 int modec; /* 'g' for GUI, 'c' for cterm, 't' for term */ |
|
75 { |
|
76 static char_u name[20]; |
|
77 *************** |
|
78 *** 8334,8353 **** |
|
79 int fg = FALSE; |
|
80 # ifdef FEAT_GUI |
|
81 int sp = FALSE; |
|
82 # endif |
|
83 |
|
84 if (id <= 0 || id > highlight_ga.ga_len) |
|
85 return NULL; |
|
86 |
|
87 ! if (TOLOWER_ASC(what[0]) == 'f') |
|
88 fg = TRUE; |
|
89 # ifdef FEAT_GUI |
|
90 ! else if (TOLOWER_ASC(what[0]) == 's') |
|
91 sp = TRUE; |
|
92 if (modec == 'g') |
|
93 { |
|
94 /* return #RRGGBB form (only possible when GUI is running) */ |
|
95 ! if (gui.in_use && what[1] && what[2] == '#') |
|
96 { |
|
97 guicolor_T color; |
|
98 long_u rgb; |
|
99 --- 8334,8363 ---- |
|
100 int fg = FALSE; |
|
101 # ifdef FEAT_GUI |
|
102 int sp = FALSE; |
|
103 + int font = FALSE; |
|
104 # endif |
|
105 |
|
106 if (id <= 0 || id > highlight_ga.ga_len) |
|
107 return NULL; |
|
108 |
|
109 ! if (TOLOWER_ASC(what[0]) == 'f' && TOLOWER_ASC(what[1]) == 'g') |
|
110 fg = TRUE; |
|
111 # ifdef FEAT_GUI |
|
112 ! else if (TOLOWER_ASC(what[0]) == 'f' && TOLOWER_ASC(what[1]) == 'o' |
|
113 ! && TOLOWER_ASC(what[2]) == 'n' && TOLOWER_ASC(what[3]) == 't') |
|
114 ! font = TRUE; |
|
115 ! else if (TOLOWER_ASC(what[0]) == 's' && TOLOWER_ASC(what[1]) == 'p') |
|
116 sp = TRUE; |
|
117 + else if (!(TOLOWER_ASC(what[0]) == 'b' && TOLOWER_ASC(what[1]) == 'g')) |
|
118 + return NULL; |
|
119 if (modec == 'g') |
|
120 { |
|
121 + /* return font name */ |
|
122 + if (font) |
|
123 + return HL_TABLE()[id - 1].sg_font_name; |
|
124 + |
|
125 /* return #RRGGBB form (only possible when GUI is running) */ |
|
126 ! if (gui.in_use && what[2] == '#') |
|
127 { |
|
128 guicolor_T color; |
|
129 long_u rgb; |
|
130 *************** |
|
131 *** 8374,8379 **** |
|
132 --- 8384,8391 ---- |
|
133 return (HL_TABLE()[id - 1].sg_gui_sp_name); |
|
134 return (HL_TABLE()[id - 1].sg_gui_bg_name); |
|
135 } |
|
136 + if (font || sp) |
|
137 + return NULL; |
|
138 # endif |
|
139 if (modec == 'c') |
|
140 { |
|
141 *** ../vim-7.2.388/src/version.c 2010-03-10 13:19:28.000000000 +0100 |
|
142 --- src/version.c 2010-03-10 13:33:25.000000000 +0100 |
|
143 *************** |
|
144 *** 683,684 **** |
|
145 --- 683,686 ---- |
|
146 { /* Add new patch number below this line */ |
|
147 + /**/ |
|
148 + 389, |
|
149 /**/ |
|
150 |
|
151 -- |
|
152 WOMAN: Dennis, there's some lovely filth down here. Oh -- how d'you do? |
|
153 ARTHUR: How do you do, good lady. I am Arthur, King of the Britons. |
|
154 Who's castle is that? |
|
155 WOMAN: King of the who? |
|
156 The Quest for the Holy Grail (Monty Python) |
|
157 |
|
158 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\ |
|
159 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ |
|
160 \\\ download, build and distribute -- http://www.A-A-P.org /// |
|
161 \\\ help me help AIDS victims -- http://ICCF-Holland.org /// |