@@ -279,6 +279,7 @@ Terminal *terminal_open(TerminalOptions opts)
279
279
char var [64 ];
280
280
snprintf (var , sizeof (var ), "terminal_color_%d" , i );
281
281
char * name = get_config_string (var );
282
+ ELOG ("i=%d name=%s" , i , name );
282
283
if (name ) {
283
284
color_val = name_to_color ((uint8_t * )name );
284
285
xfree (name );
@@ -1374,23 +1375,16 @@ static bool is_focused(Terminal *term)
1374
1375
return State & TERM_FOCUS && curbuf -> terminal == term ;
1375
1376
}
1376
1377
1377
- #define GET_CONFIG_VALUE (k , o ) \
1378
- do { \
1379
- Error err = ERROR_INIT; \
1380
- /* Only called from terminal_open where curbuf->terminal is the */ \
1381
- /* context */ \
1382
- o = dict_get_value(curbuf->b_vars, cstr_as_string(k), &err); \
1383
- api_clear_error(&err); \
1384
- if (o.type == kObjectTypeNil) { \
1385
- o = dict_get_value(&globvardict, cstr_as_string(k), &err); \
1386
- api_clear_error(&err); \
1387
- } \
1388
- } while (0)
1389
-
1390
1378
static char * get_config_string (char * key )
1391
1379
{
1392
- Object obj ;
1393
- GET_CONFIG_VALUE (key , obj );
1380
+ Error err = ERROR_INIT ;
1381
+ // Only called from terminal_open where curbuf->terminal is the context.
1382
+ Object obj = dict_get_value (curbuf -> b_vars , cstr_as_string (key ), & err );
1383
+ api_clear_error (& err );
1384
+ if (obj .type == kObjectTypeNil ) {
1385
+ obj = dict_get_value (& globvardict , cstr_as_string (key ), & err );
1386
+ api_clear_error (& err );
1387
+ }
1394
1388
if (obj .type == kObjectTypeString ) {
1395
1389
return obj .data .string .data ;
1396
1390
}
0 commit comments