aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2019-05-02 09:56:29 +0200
committerJustin M. Keyes <justinkz@gmail.com>2019-05-02 21:59:15 +0200
commit660fe979c1f3cc251e42eff99bfaee55c04ee4cc (patch)
treee6abff32eb579a83495966a2939a72672d58b291
parentfd0fd752c872428cc4fb9c95721eab1b505fc111 (diff)
downloadrneovim-660fe979c1f3cc251e42eff99bfaee55c04ee4cc.tar.gz
rneovim-660fe979c1f3cc251e42eff99bfaee55c04ee4cc.tar.bz2
rneovim-660fe979c1f3cc251e42eff99bfaee55c04ee4cc.zip
terminal.c: remove unnecessary macro
-rw-r--r--src/nvim/terminal.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/src/nvim/terminal.c b/src/nvim/terminal.c
index a802a1ffc6..2d479629b0 100644
--- a/src/nvim/terminal.c
+++ b/src/nvim/terminal.c
@@ -1374,23 +1374,16 @@ static bool is_focused(Terminal *term)
return State & TERM_FOCUS && curbuf->terminal == term;
}
-#define GET_CONFIG_VALUE(k, o) \
- do { \
- Error err = ERROR_INIT; \
- /* Only called from terminal_open where curbuf->terminal is the */ \
- /* context */ \
- o = dict_get_value(curbuf->b_vars, cstr_as_string(k), &err); \
- api_clear_error(&err); \
- if (o.type == kObjectTypeNil) { \
- o = dict_get_value(&globvardict, cstr_as_string(k), &err); \
- api_clear_error(&err); \
- } \
- } while (0)
-
static char *get_config_string(char *key)
{
- Object obj;
- GET_CONFIG_VALUE(key, obj);
+ Error err = ERROR_INIT;
+ // Only called from terminal_open where curbuf->terminal is the context.
+ Object obj = dict_get_value(curbuf->b_vars, cstr_as_string(key), &err);
+ api_clear_error(&err);
+ if (obj.type == kObjectTypeNil) {
+ obj = dict_get_value(&globvardict, cstr_as_string(key), &err);
+ api_clear_error(&err);
+ }
if (obj.type == kObjectTypeString) {
return obj.data.string.data;
}