summaryrefslogtreecommitdiffstats
path: root/source/ap/vim/patches/7.2.389
blob: a4af355fbec3db366498a958ad884f562ec7ec10 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
To: vim-dev@vim.org
Subject: Patch 7.2.389
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 7.2.389
Problem:    synIDattr() cannot return the font.
Solution:   Support the "font" argument. (Christian Brabandt)
Files:	    runtime/doc/eval.txt, src/eval.c, src/syntax.c


*** ../vim-7.2.388/runtime/doc/eval.txt	2010-01-19 15:51:29.000000000 +0100
--- runtime/doc/eval.txt	2010-03-10 12:52:12.000000000 +0100
***************
*** 5370,5375 ****
--- 5388,5395 ----
  				the color, cterm: color number as a string,
  				term: empty string)
  		"bg"		background color (as with "fg")
+ 		"font"		font name (only available in the GUI)
+ 				|highlight-font|
  		"sp"		special color (as with "fg") |highlight-guisp|
  		"fg#"		like "fg", but for the GUI and the GUI is
  				running the name in "#RRGGBB" form
***************
*** 5379,5384 ****
--- 5399,5405 ----
  		"italic"	"1" if italic
  		"reverse"	"1" if reverse
  		"inverse"	"1" if inverse (= reverse)
+ 		"standout"	"1" if standout
  		"underline"	"1" if underlined
  		"undercurl"	"1" if undercurled
  
*** ../vim-7.2.388/src/eval.c	2010-02-24 15:47:58.000000000 +0100
--- src/eval.c	2010-03-10 12:54:27.000000000 +0100
***************
*** 16627,16633 ****
  		    p = highlight_has_attr(id, HL_BOLD, modec);
  		break;
  
! 	case 'f':					/* fg[#] */
  		p = highlight_color(id, what, modec);
  		break;
  
--- 16627,16633 ----
  		    p = highlight_has_attr(id, HL_BOLD, modec);
  		break;
  
! 	case 'f':					/* fg[#] or font */
  		p = highlight_color(id, what, modec);
  		break;
  
*** ../vim-7.2.388/src/syntax.c	2010-03-02 17:50:30.000000000 +0100
--- src/syntax.c	2010-03-10 13:05:39.000000000 +0100
***************
*** 8326,8332 ****
      char_u *
  highlight_color(id, what, modec)
      int		id;
!     char_u	*what;	/* "fg", "bg", "sp", "fg#", "bg#" or "sp#" */
      int		modec;	/* 'g' for GUI, 'c' for cterm, 't' for term */
  {
      static char_u	name[20];
--- 8326,8332 ----
      char_u *
  highlight_color(id, what, modec)
      int		id;
!     char_u	*what;	/* "font", "fg", "bg", "sp", "fg#", "bg#" or "sp#" */
      int		modec;	/* 'g' for GUI, 'c' for cterm, 't' for term */
  {
      static char_u	name[20];
***************
*** 8334,8353 ****
      int			fg = FALSE;
  # ifdef FEAT_GUI
      int			sp = FALSE;
  # endif
  
      if (id <= 0 || id > highlight_ga.ga_len)
  	return NULL;
  
!     if (TOLOWER_ASC(what[0]) == 'f')
  	fg = TRUE;
  # ifdef FEAT_GUI
!     else if (TOLOWER_ASC(what[0]) == 's')
  	sp = TRUE;
      if (modec == 'g')
      {
  	/* return #RRGGBB form (only possible when GUI is running) */
! 	if (gui.in_use && what[1] && what[2] == '#')
  	{
  	    guicolor_T		color;
  	    long_u		rgb;
--- 8334,8363 ----
      int			fg = FALSE;
  # ifdef FEAT_GUI
      int			sp = FALSE;
+     int			font = FALSE;
  # endif
  
      if (id <= 0 || id > highlight_ga.ga_len)
  	return NULL;
  
!     if (TOLOWER_ASC(what[0]) == 'f' && TOLOWER_ASC(what[1]) == 'g')
  	fg = TRUE;
  # ifdef FEAT_GUI
!     else if (TOLOWER_ASC(what[0]) == 'f' && TOLOWER_ASC(what[1]) == 'o'
!              && TOLOWER_ASC(what[2]) == 'n' && TOLOWER_ASC(what[3]) == 't')
! 	font = TRUE;
!     else if (TOLOWER_ASC(what[0]) == 's' && TOLOWER_ASC(what[1]) == 'p')
  	sp = TRUE;
+     else if (!(TOLOWER_ASC(what[0]) == 'b' && TOLOWER_ASC(what[1]) == 'g'))
+ 	return NULL;
      if (modec == 'g')
      {
+ 	/* return font name */
+ 	if (font)
+ 	    return HL_TABLE()[id - 1].sg_font_name;
+ 
  	/* return #RRGGBB form (only possible when GUI is running) */
! 	if (gui.in_use && what[2] == '#')
  	{
  	    guicolor_T		color;
  	    long_u		rgb;
***************
*** 8374,8379 ****
--- 8384,8391 ----
  	    return (HL_TABLE()[id - 1].sg_gui_sp_name);
  	return (HL_TABLE()[id - 1].sg_gui_bg_name);
      }
+     if (font || sp)
+ 	return NULL;
  # endif
      if (modec == 'c')
      {
*** ../vim-7.2.388/src/version.c	2010-03-10 13:19:28.000000000 +0100
--- src/version.c	2010-03-10 13:33:25.000000000 +0100
***************
*** 683,684 ****
--- 683,686 ----
  {   /* Add new patch number below this line */
+ /**/
+     389,
  /**/

-- 
WOMAN:   Dennis, there's some lovely filth down here.  Oh -- how d'you do?
ARTHUR:  How do you do, good lady.  I am Arthur, King of the Britons.
         Who's castle is that?
WOMAN:   King of the who?
                                  The Quest for the Holy Grail (Monty Python)

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///