diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2017-06-14 20:32:16 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-14 20:32:16 +0200 |
commit | 7918845215855814cf16b483fb0bec9cdad313d2 (patch) | |
tree | 7c4b17c92f72df637d096e43ccbd00891a896e87 /src/nvim/option.c | |
parent | 6650588c4a89616249e964631dad17a66e1c6592 (diff) | |
parent | ad73a70e5a1c7da58d7afbb70310c14c62b2519d (diff) | |
download | rneovim-7918845215855814cf16b483fb0bec9cdad313d2.tar.gz rneovim-7918845215855814cf16b483fb0bec9cdad313d2.tar.bz2 rneovim-7918845215855814cf16b483fb0bec9cdad313d2.zip |
Merge pull request #6700 from bfredl/winhl
window specific ui highlighting: part 2
Diffstat (limited to 'src/nvim/option.c')
-rw-r--r-- | src/nvim/option.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c index 337d16a55b..b48ffae85b 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -3579,7 +3579,9 @@ static char_u *compile_cap_prog(synblock_T *synblock) /// Handle setting `winhighlight' in window "wp" static bool parse_winhl_opt(win_T *wp) { - int w_hl_id = 0, w_hl_id_inactive = 0; + int w_hl_id_normal = 0; + int w_hl_ids[HLF_COUNT] = { 0 }; + int hlf; const char *p = (const char *)wp->w_p_winhl; while (*p) { @@ -3593,18 +3595,25 @@ static bool parse_winhl_opt(win_T *wp) int hl_id = syn_check_group((char_u *)hi, (int)(commap-hi)); if (strncmp("Normal", p, nlen) == 0) { - w_hl_id = hl_id; - } else if (strncmp("NormalNC", p, nlen) == 0) { - w_hl_id_inactive = hl_id; + w_hl_id_normal = hl_id; } else { - return false; + for (hlf = 0; hlf < (int)HLF_COUNT; hlf++) { + if (strncmp(hlf_names[hlf], p, nlen) == 0) { + w_hl_ids[hlf] = hl_id; + break; + } + } + if (hlf == HLF_COUNT) { + return false; + } } p = *commap ? commap+1 : ""; } - wp->w_hl_id = w_hl_id; - wp->w_hl_id_inactive = w_hl_id_inactive; + wp->w_hl_id_normal = w_hl_id_normal; + memcpy(wp->w_hl_ids, w_hl_ids, sizeof(w_hl_ids)); + wp->w_hl_needs_update = true; return true; } |