diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2019-06-25 18:36:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-25 18:36:07 +0200 |
commit | 788bcbba24655d004764edfae7d432cd474d0a96 (patch) | |
tree | 0180de15fd7e7c9d1cc83502db585e27d2fa9903 /src/nvim/option.c | |
parent | 3e6f06f5d2bea05767c62420b4a73a0c266f7f5a (diff) | |
parent | b0c1e2ab5a46a9ab040d8b2be37196d4d00d3944 (diff) | |
download | rneovim-788bcbba24655d004764edfae7d432cd474d0a96.tar.gz rneovim-788bcbba24655d004764edfae7d432cd474d0a96.tar.bz2 rneovim-788bcbba24655d004764edfae7d432cd474d0a96.zip |
Merge pull request #9923 from bfredl/floatblend
blending of floating windows, override individual attributes with ":hi Group blend="
Diffstat (limited to 'src/nvim/option.c')
-rw-r--r-- | src/nvim/option.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c index 8dadf926b9..25b498e3e6 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -74,6 +74,7 @@ #include "nvim/strings.h" #include "nvim/syntax.h" #include "nvim/ui.h" +#include "nvim/ui_compositor.h" #include "nvim/undo.h" #include "nvim/window.h" #include "nvim/os/os.h" @@ -4391,11 +4392,10 @@ static char *set_num_option(int opt_idx, char_u *varp, long value, } } else if (pp == &p_pb) { p_pb = MAX(MIN(p_pb, 100), 0); - if (old_value != 0) { - hl_invalidate_blends(); - } + hl_invalidate_blends(); + pum_grid.blending = (p_pb > 0); if (pum_drawn()) { - pum_recompose(); + pum_redraw(); } } else if (pp == &p_pyx) { if (p_pyx != 0 && p_pyx != 2 && p_pyx != 3) { @@ -4418,6 +4418,11 @@ static char *set_num_option(int opt_idx, char_u *varp, long value, } } else if (pp == &curwin->w_p_nuw) { curwin->w_nrwidth_line_count = 0; + } else if (pp == &curwin->w_p_winbl && value != old_value) { + // 'floatblend' + curwin->w_p_winbl = MAX(MIN(curwin->w_p_winbl, 100), 0); + curwin->w_hl_needs_update = true; + curwin->w_grid.blending = curwin->w_p_winbl > 0; } @@ -5713,6 +5718,7 @@ static char_u *get_varp(vimoption_T *p) case PV_WINHL: return (char_u *)&(curwin->w_p_winhl); case PV_FCS: return (char_u *)&(curwin->w_p_fcs); case PV_LCS: return (char_u *)&(curwin->w_p_lcs); + case PV_WINBL: return (char_u *)&(curwin->w_p_winbl); default: IEMSG(_("E356: get_varp ERROR")); } // always return a valid pointer to avoid a crash! @@ -5792,6 +5798,7 @@ void copy_winopt(winopt_T *from, winopt_T *to) to->wo_winhl = vim_strsave(from->wo_winhl); to->wo_fcs = vim_strsave(from->wo_fcs); to->wo_lcs = vim_strsave(from->wo_lcs); + to->wo_winbl = from->wo_winbl; check_winopt(to); // don't want NULL pointers } @@ -5854,7 +5861,8 @@ void didset_window_options(win_T *wp) briopt_check(wp); set_chars_option(wp, &wp->w_p_fcs); set_chars_option(wp, &wp->w_p_lcs); - parse_winhl_opt(wp); + parse_winhl_opt(wp); // sets w_hl_needs_update also for w_p_winbl + wp->w_grid.blending = wp->w_p_winbl > 0; } |