diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-05-02 22:52:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-02 22:52:28 +0200 |
commit | 9d58a58980c666a3abf515a1dd6b813b13d2d5ae (patch) | |
tree | e6abff32eb579a83495966a2939a72672d58b291 /src | |
parent | 49c51f839b537ac8ff60671030a8d7b2399ad4a7 (diff) | |
parent | 660fe979c1f3cc251e42eff99bfaee55c04ee4cc (diff) | |
download | rneovim-9d58a58980c666a3abf515a1dd6b813b13d2d5ae.tar.gz rneovim-9d58a58980c666a3abf515a1dd6b813b13d2d5ae.tar.bz2 rneovim-9d58a58980c666a3abf515a1dd6b813b13d2d5ae.zip |
Merge #9966 from justinmk/te-hl
terminal: swap priority of terminal, editor highlights
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/screen.c | 16 | ||||
-rw-r--r-- | src/nvim/terminal.c | 23 |
2 files changed, 17 insertions, 22 deletions
diff --git a/src/nvim/screen.c b/src/nvim/screen.c index cd472ea1e4..d61be4af1c 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -3275,16 +3275,18 @@ win_line ( line = ml_get_buf(wp->w_buffer, lnum, FALSE); ptr = line + v; - if (!attr_pri) + if (!attr_pri) { char_attr = syntax_attr; - else + } else { char_attr = hl_combine_attr(syntax_attr, char_attr); - /* no concealing past the end of the line, it interferes - * with line highlighting */ - if (c == NUL) + } + // no concealing past the end of the line, it interferes + // with line highlighting. + if (c == NUL) { syntax_flags = 0; - else + } else { syntax_flags = get_syntax_info(&syntax_seqnr); + } } else if (!attr_pri) { char_attr = 0; } @@ -3376,7 +3378,7 @@ win_line ( } if (wp->w_buffer->terminal) { - char_attr = hl_combine_attr(char_attr, term_attrs[vcol]); + char_attr = hl_combine_attr(term_attrs[vcol], char_attr); } // Found last space before word: check for line break. 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; } |