Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit fe9aace

Browse filesBrowse files
committed
terminal.c: remove unnecessary macro
1 parent fd0fd75 commit fe9aace
Copy full SHA for fe9aace

File tree

Expand file treeCollapse file tree

1 file changed

+9
-15
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+9
-15
lines changed

‎src/nvim/terminal.c

Copy file name to clipboardExpand all lines: src/nvim/terminal.c
+9-15Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ Terminal *terminal_open(TerminalOptions opts)
279279
char var[64];
280280
snprintf(var, sizeof(var), "terminal_color_%d", i);
281281
char *name = get_config_string(var);
282+
ELOG("i=%d name=%s", i, name);
282283
if (name) {
283284
color_val = name_to_color((uint8_t *)name);
284285
xfree(name);
@@ -1374,23 +1375,16 @@ static bool is_focused(Terminal *term)
13741375
return State & TERM_FOCUS && curbuf->terminal == term;
13751376
}
13761377

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-
13901378
static char *get_config_string(char *key)
13911379
{
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+
}
13941388
if (obj.type == kObjectTypeString) {
13951389
return obj.data.string.data;
13961390
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.