Blame


1 c92e529c 2021-06-15 op /*
2 c92e529c 2021-06-15 op * Copyright (c) 2021 Omar Polo <op@omarpolo.com>
3 c92e529c 2021-06-15 op *
4 c92e529c 2021-06-15 op * Permission to use, copy, modify, and distribute this software for any
5 c92e529c 2021-06-15 op * purpose with or without fee is hereby granted, provided that the above
6 c92e529c 2021-06-15 op * copyright notice and this permission notice appear in all copies.
7 c92e529c 2021-06-15 op *
8 c92e529c 2021-06-15 op * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 c92e529c 2021-06-15 op * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 c92e529c 2021-06-15 op * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 c92e529c 2021-06-15 op * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 c92e529c 2021-06-15 op * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 c92e529c 2021-06-15 op * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 c92e529c 2021-06-15 op * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 c92e529c 2021-06-15 op */
16 c92e529c 2021-06-15 op
17 c92e529c 2021-06-15 op #include "telescope.h"
18 c92e529c 2021-06-15 op
19 c92e529c 2021-06-15 op #include <curses.h>
20 1a99965e 2021-06-19 op #include <limits.h>
21 db7cc27a 2021-06-19 op #include <stdlib.h>
22 69e1d1b6 2021-06-15 op #include <string.h>
23 c92e529c 2021-06-15 op
24 db7cc27a 2021-06-19 op char *new_tab_url = NULL;
25 2c362f95 2021-06-24 op int fill_column = 80;
26 2c362f95 2021-06-24 op int olivetti_mode = 1;
27 2c748a1f 2021-06-21 op int enable_colors = 1;
28 1a99965e 2021-06-19 op
29 c92e529c 2021-06-15 op struct lineprefix line_prefixes[] = {
30 c92e529c 2021-06-15 op [LINE_TEXT] = { "", "" },
31 c92e529c 2021-06-15 op [LINE_LINK] = { "=> ", " " },
32 c92e529c 2021-06-15 op [LINE_TITLE_1] = { "# ", " " },
33 c92e529c 2021-06-15 op [LINE_TITLE_2] = { "## ", " " },
34 c92e529c 2021-06-15 op [LINE_TITLE_3] = { "### ", " " },
35 c92e529c 2021-06-15 op [LINE_ITEM] = { "* ", " " },
36 c92e529c 2021-06-15 op [LINE_QUOTE] = { "> ", " " },
37 c92e529c 2021-06-15 op [LINE_PRE_START] = { "```", " " },
38 c92e529c 2021-06-15 op [LINE_PRE_CONTENT] = { "", "" },
39 c92e529c 2021-06-15 op [LINE_PRE_END] = { "```", "```" },
40 c92e529c 2021-06-15 op };
41 c92e529c 2021-06-15 op
42 c92e529c 2021-06-15 op struct line_face line_faces[] = {
43 2af29222 2021-06-24 op [LINE_TEXT] = {
44 2af29222 2021-06-24 op .prfx_pair = PT_PRFX,
45 2af29222 2021-06-24 op .pair = PT,
46 2af29222 2021-06-24 op .trail_pair = PT_TRAIL,
47 2af29222 2021-06-24 op },
48 2af29222 2021-06-24 op [LINE_LINK] = {
49 2af29222 2021-06-24 op .prfx_pair = PL_PRFX,
50 2af29222 2021-06-24 op .pair = PL,
51 2af29222 2021-06-24 op .trail_pair = PL_TRAIL,
52 2af29222 2021-06-24 op .attr = A_UNDERLINE,
53 2af29222 2021-06-24 op },
54 2af29222 2021-06-24 op [LINE_TITLE_1] = {
55 2af29222 2021-06-24 op .prfx_pair = PT1_PRFX,
56 2af29222 2021-06-24 op .pair = PT1,
57 2af29222 2021-06-24 op .trail_pair = PT1_TRAIL,
58 2af29222 2021-06-24 op .attr = A_BOLD,
59 2af29222 2021-06-24 op },
60 2af29222 2021-06-24 op [LINE_TITLE_2] = {
61 2af29222 2021-06-24 op .prfx_pair = PT2_PRFX,
62 2af29222 2021-06-24 op .pair = PT2,
63 2af29222 2021-06-24 op .trail_pair = PT2_TRAIL,
64 2af29222 2021-06-24 op .attr = A_BOLD,
65 2af29222 2021-06-24 op },
66 2af29222 2021-06-24 op [LINE_TITLE_3] = {
67 2af29222 2021-06-24 op .prfx_pair = PT3_PRFX,
68 2af29222 2021-06-24 op .pair = PT3,
69 2af29222 2021-06-24 op .trail_pair = PT3_TRAIL,
70 2af29222 2021-06-24 op .attr = A_BOLD,
71 2af29222 2021-06-24 op },
72 2af29222 2021-06-24 op [LINE_ITEM] = {
73 2af29222 2021-06-24 op .prfx_pair = PI_PRFX,
74 2af29222 2021-06-24 op .pair = PI,
75 2af29222 2021-06-24 op .trail_pair = PI_TRAIL,
76 2af29222 2021-06-24 op },
77 2af29222 2021-06-24 op [LINE_QUOTE] = {
78 2af29222 2021-06-24 op .prfx_pair = PQ_PRFX,
79 2af29222 2021-06-24 op .pair = PQ,
80 2af29222 2021-06-24 op .trail_pair = PQ_TRAIL,
81 2af29222 2021-06-24 op .attr = A_DIM,
82 2af29222 2021-06-24 op },
83 2af29222 2021-06-24 op [LINE_PRE_START] = {
84 2af29222 2021-06-24 op .prfx_pair = PPSTART_PRFX,
85 2af29222 2021-06-24 op .pair = PPSTART,
86 2af29222 2021-06-24 op .trail_pair = PPSTART_TRAIL,
87 2af29222 2021-06-24 op },
88 2af29222 2021-06-24 op [LINE_PRE_CONTENT] = {
89 2af29222 2021-06-24 op .prfx_pair = PP_PRFX,
90 2af29222 2021-06-24 op .pair = PP,
91 2af29222 2021-06-24 op .trail_pair = PP_TRAIL,
92 2af29222 2021-06-24 op },
93 2af29222 2021-06-24 op [LINE_PRE_END] = {
94 2af29222 2021-06-24 op .prfx_pair = PPEND_PRFX,
95 2af29222 2021-06-24 op .pair = PPEND,
96 2af29222 2021-06-24 op .trail_pair = PPEND_TRAIL,
97 2af29222 2021-06-24 op },
98 c92e529c 2021-06-15 op };
99 c92e529c 2021-06-15 op
100 c92e529c 2021-06-15 op struct tab_face tab_face = {
101 33d904b6 2021-06-22 op .bg_attr = A_REVERSE, .bg_bg = -1, .bg_fg = -1,
102 33d904b6 2021-06-22 op .t_attr = A_REVERSE, .t_bg = -1, .t_fg = -1,
103 33d904b6 2021-06-22 op .c_attr = A_NORMAL, .c_bg = -1, .c_fg = -1,
104 33d904b6 2021-06-22 op
105 33d904b6 2021-06-22 op /*
106 33d904b6 2021-06-22 op * set these so that even when enable-color=0 the bar has some
107 33d904b6 2021-06-22 op * sane defaults.
108 33d904b6 2021-06-22 op */
109 33d904b6 2021-06-22 op .background = A_REVERSE,
110 33d904b6 2021-06-22 op .tab = A_REVERSE,
111 33d904b6 2021-06-22 op .current = A_NORMAL,
112 c92e529c 2021-06-15 op };
113 d5493194 2021-06-15 op
114 b598590d 2021-06-21 op struct body_face body_face = {
115 160abe04 2021-06-21 op .lbg = -1, .lfg = -1,
116 160abe04 2021-06-21 op .bg = -1, .fg = -1,
117 160abe04 2021-06-21 op .rbg = -1, .rfg = -1,
118 b598590d 2021-06-21 op };
119 b598590d 2021-06-21 op
120 d5493194 2021-06-15 op struct modeline_face modeline_face = {
121 24221637 2021-06-25 op .bg = -1,
122 24221637 2021-06-25 op .fg = -1,
123 24221637 2021-06-25 op .attr = A_REVERSE,
124 d5493194 2021-06-15 op };
125 d5493194 2021-06-15 op
126 d5493194 2021-06-15 op struct minibuffer_face minibuffer_face = {
127 24221637 2021-06-25 op .bg = -1,
128 24221637 2021-06-25 op .fg = -1,
129 24221637 2021-06-25 op .attr = A_NORMAL,
130 d5493194 2021-06-15 op };
131 69e1d1b6 2021-06-15 op
132 74a2587f 2021-06-21 op struct mapping {
133 74a2587f 2021-06-21 op const char *label;
134 74a2587f 2021-06-21 op int linetype;
135 74a2587f 2021-06-21 op } mappings[] = {
136 d89b86d6 2021-06-21 op {"text", LINE_TEXT},
137 d89b86d6 2021-06-21 op {"link", LINE_LINK},
138 d89b86d6 2021-06-21 op {"title1", LINE_TITLE_1},
139 d89b86d6 2021-06-21 op {"title2", LINE_TITLE_2},
140 d89b86d6 2021-06-21 op {"title3", LINE_TITLE_3},
141 d89b86d6 2021-06-21 op {"item", LINE_ITEM},
142 d89b86d6 2021-06-21 op {"quote", LINE_QUOTE},
143 d89b86d6 2021-06-21 op {"pre.start", LINE_PRE_START},
144 d89b86d6 2021-06-21 op {"pre", LINE_PRE_CONTENT},
145 d89b86d6 2021-06-21 op {"pre.end", LINE_PRE_END},
146 74a2587f 2021-06-21 op };
147 74a2587f 2021-06-21 op
148 74a2587f 2021-06-21 op static struct mapping *
149 74a2587f 2021-06-21 op mapping_by_name(const char *name)
150 74a2587f 2021-06-21 op {
151 74a2587f 2021-06-21 op size_t i;
152 74a2587f 2021-06-21 op
153 74a2587f 2021-06-21 op for (i = 0; i < sizeof(mappings)/sizeof(mappings[0]); ++i) {
154 74a2587f 2021-06-21 op if (!strcmp(name, mappings[i].label))
155 74a2587f 2021-06-21 op return &mappings[i];
156 74a2587f 2021-06-21 op }
157 74a2587f 2021-06-21 op
158 74a2587f 2021-06-21 op return NULL;
159 74a2587f 2021-06-21 op }
160 74a2587f 2021-06-21 op
161 33fc3a8f 2021-06-21 op void
162 33fc3a8f 2021-06-21 op config_init(void)
163 33fc3a8f 2021-06-21 op {
164 2af29222 2021-06-24 op struct line_face *f;
165 33fc3a8f 2021-06-21 op size_t i, len;
166 33fc3a8f 2021-06-21 op
167 2af29222 2021-06-24 op len = sizeof(line_faces)/sizeof(line_faces[0]);
168 33fc3a8f 2021-06-21 op for (i = 0; i < len; ++i) {
169 2af29222 2021-06-24 op f = &line_faces[i];
170 33fc3a8f 2021-06-21 op
171 2af29222 2021-06-24 op f->prfx_bg = f->bg = f->trail_bg = -1;
172 2af29222 2021-06-24 op f->prfx_fg = f->fg = f->trail_fg = -1;
173 33fc3a8f 2021-06-21 op }
174 752e45c8 2021-06-25 op
175 752e45c8 2021-06-25 op line_faces[LINE_LINK].fg = COLOR_BLUE;
176 33fc3a8f 2021-06-21 op }
177 33fc3a8f 2021-06-21 op
178 69e1d1b6 2021-06-15 op int
179 d89b86d6 2021-06-21 op config_setprfx(const char *name, const char *prfx, const char *cont)
180 69e1d1b6 2021-06-15 op {
181 69e1d1b6 2021-06-15 op struct lineprefix *p;
182 74a2587f 2021-06-21 op struct mapping *m;
183 69e1d1b6 2021-06-15 op
184 69e1d1b6 2021-06-15 op if (!has_prefix(name, "line."))
185 69e1d1b6 2021-06-15 op return 0;
186 69e1d1b6 2021-06-15 op name += 5;
187 69e1d1b6 2021-06-15 op
188 74a2587f 2021-06-21 op if ((m = mapping_by_name(name)) == NULL)
189 74a2587f 2021-06-21 op return 0;
190 69e1d1b6 2021-06-15 op
191 74a2587f 2021-06-21 op p = &line_prefixes[m->linetype];
192 d89b86d6 2021-06-21 op p->prfx1 = prfx;
193 d89b86d6 2021-06-21 op p->prfx2 = cont;
194 69e1d1b6 2021-06-15 op
195 74a2587f 2021-06-21 op return 1;
196 69e1d1b6 2021-06-15 op }
197 86e7d7b4 2021-06-19 op
198 86e7d7b4 2021-06-19 op int
199 86e7d7b4 2021-06-19 op config_setvari(const char *var, int val)
200 86e7d7b4 2021-06-19 op {
201 1a99965e 2021-06-19 op if (!strcmp(var, "fill-column")) {
202 cc073cd2 2021-06-19 op if ((fill_column = val) <= 0)
203 2106687b 2021-06-19 op fill_column = INT_MAX;
204 72b18268 2021-06-19 op } else if (!strcmp(var, "olivetti-mode")) {
205 72b18268 2021-06-19 op olivetti_mode = !!val;
206 2c748a1f 2021-06-21 op } else if (!strcmp(var, "enable-colors")) {
207 2c748a1f 2021-06-21 op enable_colors = !!val;
208 2c748a1f 2021-06-21 op } else {
209 1a99965e 2021-06-19 op return 0;
210 2c748a1f 2021-06-21 op }
211 2c748a1f 2021-06-21 op
212 1a99965e 2021-06-19 op return 1;
213 86e7d7b4 2021-06-19 op }
214 86e7d7b4 2021-06-19 op
215 86e7d7b4 2021-06-19 op int
216 86e7d7b4 2021-06-19 op config_setvars(const char *var, char *val)
217 86e7d7b4 2021-06-19 op {
218 db7cc27a 2021-06-19 op if (!strcmp(var, "new-tab-url")) {
219 db7cc27a 2021-06-19 op if (new_tab_url != NULL)
220 db7cc27a 2021-06-19 op free(new_tab_url);
221 db7cc27a 2021-06-19 op new_tab_url = val;
222 db7cc27a 2021-06-19 op } else
223 db7cc27a 2021-06-19 op return 0;
224 db7cc27a 2021-06-19 op return 1;
225 86e7d7b4 2021-06-19 op }
226 74a2587f 2021-06-21 op
227 74a2587f 2021-06-21 op int
228 d89b86d6 2021-06-21 op config_setcolor(int bg, const char *name, int prfx, int line, int trail)
229 74a2587f 2021-06-21 op {
230 74a2587f 2021-06-21 op struct mapping *m;
231 2af29222 2021-06-24 op struct line_face *f;
232 74a2587f 2021-06-21 op
233 33d904b6 2021-06-22 op if (!strcmp(name, "tabline")) {
234 33d904b6 2021-06-22 op if (bg)
235 33d904b6 2021-06-22 op tab_face.bg_bg = prfx;
236 33d904b6 2021-06-22 op else
237 33d904b6 2021-06-22 op tab_face.bg_fg = prfx;
238 33d904b6 2021-06-22 op } else if (has_prefix(name, "tabline.")) {
239 33d904b6 2021-06-22 op name += 8;
240 33d904b6 2021-06-22 op
241 33d904b6 2021-06-22 op if (!strcmp(name, "tab")) {
242 33d904b6 2021-06-22 op if (bg)
243 33d904b6 2021-06-22 op tab_face.t_bg = prfx;
244 33d904b6 2021-06-22 op else
245 33d904b6 2021-06-22 op tab_face.t_fg = prfx;
246 33d904b6 2021-06-22 op } else if (!strcmp(name, "current")) {
247 33d904b6 2021-06-22 op if (bg)
248 33d904b6 2021-06-22 op tab_face.c_bg = prfx;
249 33d904b6 2021-06-22 op else
250 33d904b6 2021-06-22 op tab_face.c_fg = prfx;
251 33d904b6 2021-06-22 op } else
252 33d904b6 2021-06-22 op return 0;
253 33d904b6 2021-06-22 op } else if (has_prefix(name, "line.")) {
254 50f7147c 2021-06-21 op name += 5;
255 74a2587f 2021-06-21 op
256 50f7147c 2021-06-21 op if ((m = mapping_by_name(name)) == NULL)
257 50f7147c 2021-06-21 op return 0;
258 74a2587f 2021-06-21 op
259 2af29222 2021-06-24 op f = &line_faces[m->linetype];
260 74a2587f 2021-06-21 op
261 50f7147c 2021-06-21 op if (bg) {
262 2af29222 2021-06-24 op f->prfx_bg = prfx;
263 2af29222 2021-06-24 op f->bg = line;
264 2af29222 2021-06-24 op f->trail_bg = trail;
265 50f7147c 2021-06-21 op } else {
266 2af29222 2021-06-24 op f->prfx_fg = prfx;
267 2af29222 2021-06-24 op f->fg = line;
268 2af29222 2021-06-24 op f->trail_fg = trail;
269 50f7147c 2021-06-21 op }
270 b598590d 2021-06-21 op } else if (!strcmp(name, "line")) {
271 160abe04 2021-06-21 op if (bg) {
272 160abe04 2021-06-21 op body_face.lbg = prfx;
273 160abe04 2021-06-21 op body_face.bg = line;
274 160abe04 2021-06-21 op body_face.rbg = trail;
275 160abe04 2021-06-21 op } else {
276 a2cb4f84 2021-06-25 op body_face.lfg = prfx;
277 160abe04 2021-06-21 op body_face.fg = line;
278 a2cb4f84 2021-06-25 op body_face.rfg = trail;
279 160abe04 2021-06-21 op }
280 24221637 2021-06-25 op } else if (!strcmp(name, "minibuffer")) {
281 24221637 2021-06-25 op if (bg)
282 24221637 2021-06-25 op minibuffer_face.bg = prfx;
283 24221637 2021-06-25 op else
284 24221637 2021-06-25 op minibuffer_face.fg = prfx;
285 24221637 2021-06-25 op } else if (!strcmp(name, "modeline")) {
286 24221637 2021-06-25 op if (bg)
287 24221637 2021-06-25 op modeline_face.bg = prfx;
288 24221637 2021-06-25 op else
289 24221637 2021-06-25 op modeline_face.fg = prfx;
290 74a2587f 2021-06-21 op } else {
291 50f7147c 2021-06-21 op return 0;
292 74a2587f 2021-06-21 op }
293 74a2587f 2021-06-21 op
294 74a2587f 2021-06-21 op return 1;
295 74a2587f 2021-06-21 op }
296 74a2587f 2021-06-21 op
297 d0149485 2021-06-22 op int
298 d0149485 2021-06-22 op config_setattr(const char *name, int prfx, int line, int trail)
299 d0149485 2021-06-22 op {
300 d0149485 2021-06-22 op struct mapping *m;
301 2af29222 2021-06-24 op struct line_face *f;
302 d0149485 2021-06-22 op
303 33d904b6 2021-06-22 op if (!strcmp(name, "tabline")) {
304 33d904b6 2021-06-22 op tab_face.bg_attr = prfx;
305 33d904b6 2021-06-22 op } else if (has_prefix(name, "tabline.")) {
306 33d904b6 2021-06-22 op name += 8;
307 33d904b6 2021-06-22 op
308 33d904b6 2021-06-22 op if (!strcmp(name, "tab"))
309 33d904b6 2021-06-22 op tab_face.t_attr = prfx;
310 33d904b6 2021-06-22 op else if (!strcmp(name, "current"))
311 33d904b6 2021-06-22 op tab_face.c_attr = prfx;
312 33d904b6 2021-06-22 op else
313 33d904b6 2021-06-22 op return 0;
314 33d904b6 2021-06-22 op } else if (has_prefix(name, "line.")) {
315 d0149485 2021-06-22 op name += 5;
316 d0149485 2021-06-22 op
317 d0149485 2021-06-22 op if ((m = mapping_by_name(name)) == NULL)
318 d0149485 2021-06-22 op return 0;
319 d0149485 2021-06-22 op
320 2af29222 2021-06-24 op f = &line_faces[m->linetype];
321 d0149485 2021-06-22 op
322 2af29222 2021-06-24 op f->prfx_attr = prfx;
323 2af29222 2021-06-24 op f->attr = line;
324 2af29222 2021-06-24 op f->trail_attr = trail;
325 24221637 2021-06-25 op } else if (!strcmp(name, "minibuffer")) {
326 24221637 2021-06-25 op minibuffer_face.attr = prfx;
327 24221637 2021-06-25 op } else if (!strcmp(name, "modeline")) {
328 24221637 2021-06-25 op modeline_face.attr = prfx;
329 d0149485 2021-06-22 op } else {
330 d0149485 2021-06-22 op return 0;
331 d0149485 2021-06-22 op }
332 d0149485 2021-06-22 op
333 d0149485 2021-06-22 op return 1;
334 986af347 2021-06-24 op }
335 986af347 2021-06-24 op
336 8d7c8aab 2021-06-24 op static inline void
337 986af347 2021-06-24 op tl_init_pair(int colors, int pair, int f, int b)
338 986af347 2021-06-24 op {
339 986af347 2021-06-24 op if (f >= colors || !enable_colors)
340 986af347 2021-06-24 op f = -1;
341 986af347 2021-06-24 op if (b >= colors || !enable_colors)
342 986af347 2021-06-24 op b = -1;
343 986af347 2021-06-24 op init_pair(pair, f, b);
344 d0149485 2021-06-22 op }
345 d0149485 2021-06-22 op
346 74a2587f 2021-06-21 op void
347 42d61f50 2021-06-24 op config_apply_style(void)
348 74a2587f 2021-06-21 op {
349 986af347 2021-06-24 op size_t i, colors, len;
350 74a2587f 2021-06-21 op struct line_face *f;
351 74a2587f 2021-06-21 op
352 986af347 2021-06-24 op colors = COLORS;
353 986af347 2021-06-24 op
354 2af29222 2021-06-24 op len = sizeof(line_faces)/sizeof(line_faces[0]);
355 74a2587f 2021-06-21 op for (i = 0; i < len; ++i) {
356 74a2587f 2021-06-21 op f = &line_faces[i];
357 74a2587f 2021-06-21 op
358 2af29222 2021-06-24 op tl_init_pair(colors, f->prfx_pair, f->prfx_fg, f->prfx_bg);
359 2af29222 2021-06-24 op f->prefix = COLOR_PAIR(f->prfx_pair) | f->prfx_attr;
360 d89b86d6 2021-06-21 op
361 2af29222 2021-06-24 op tl_init_pair(colors, f->pair, f->fg, f->bg);
362 2af29222 2021-06-24 op f->text = COLOR_PAIR(f->pair) | f->attr;
363 d89b86d6 2021-06-21 op
364 2af29222 2021-06-24 op tl_init_pair(colors, f->trail_pair, f->trail_fg, f->trail_bg);
365 2af29222 2021-06-24 op f->trail = COLOR_PAIR(f->trail_pair) | f->trail_attr;
366 74a2587f 2021-06-21 op }
367 b598590d 2021-06-21 op
368 33d904b6 2021-06-22 op /* tab line */
369 986af347 2021-06-24 op tl_init_pair(colors, PTL_BG, tab_face.bg_fg, tab_face.bg_bg);
370 33d904b6 2021-06-22 op tab_face.background = COLOR_PAIR(PTL_BG) | tab_face.bg_attr;
371 33d904b6 2021-06-22 op
372 986af347 2021-06-24 op tl_init_pair(colors, PTL_TAB, tab_face.t_fg, tab_face.t_bg);
373 33d904b6 2021-06-22 op tab_face.tab = COLOR_PAIR(PTL_TAB) | tab_face.t_attr;
374 33d904b6 2021-06-22 op
375 986af347 2021-06-24 op tl_init_pair(colors, PTL_CURR, tab_face.c_fg, tab_face.c_bg);
376 33d904b6 2021-06-22 op tab_face.current = COLOR_PAIR(PTL_CURR) | tab_face.c_attr;
377 33d904b6 2021-06-22 op
378 33d904b6 2021-06-22 op /* body */
379 986af347 2021-06-24 op tl_init_pair(colors, PBODY, body_face.fg, body_face.bg);
380 b598590d 2021-06-21 op body_face.body = COLOR_PAIR(PBODY);
381 160abe04 2021-06-21 op
382 986af347 2021-06-24 op tl_init_pair(colors, PBLEFT, body_face.lfg, body_face.lbg);
383 160abe04 2021-06-21 op body_face.left = COLOR_PAIR(PBLEFT);
384 160abe04 2021-06-21 op
385 986af347 2021-06-24 op tl_init_pair(colors, PBRIGHT, body_face.rfg, body_face.rbg);
386 160abe04 2021-06-21 op body_face.right = COLOR_PAIR(PBRIGHT);
387 24221637 2021-06-25 op
388 24221637 2021-06-25 op /* modeline */
389 24221637 2021-06-25 op tl_init_pair(colors, PMODELINE, modeline_face.fg, modeline_face.bg);
390 24221637 2021-06-25 op modeline_face.background = COLOR_PAIR(PMODELINE) | modeline_face.attr;
391 24221637 2021-06-25 op
392 24221637 2021-06-25 op /* minibuffer */
393 24221637 2021-06-25 op tl_init_pair(colors, PMINIBUF, minibuffer_face.fg, minibuffer_face.bg);
394 24221637 2021-06-25 op minibuffer_face.background = COLOR_PAIR(PMINIBUF) | minibuffer_face.attr;
395 24221637 2021-06-25 op
396 74a2587f 2021-06-21 op }