aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/option.c
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2019-01-20 21:23:17 +0100
committerBjörn Linse <bjorn.linse@gmail.com>2019-02-07 16:43:51 +0100
commit37f8df882463431888dbaf205ce3ea6488cf4702 (patch)
tree4ebb1634d1d0e16ae3d16d56c22e63602ef0efe4 /src/nvim/option.c
parented0e96cd28f870c4a580c9e8ab74340fecc90fcb (diff)
downloadrneovim-37f8df882463431888dbaf205ce3ea6488cf4702.tar.gz
rneovim-37f8df882463431888dbaf205ce3ea6488cf4702.tar.bz2
rneovim-37f8df882463431888dbaf205ce3ea6488cf4702.zip
UI: implement 'pumblend' option for semi-transparent popupmenu
Why? - Because we can. - Because the TUI is just another GUI™ - Because it looks kinda nice, and provides useful context like 1 out of 100 times Complies with "don't pay for what you don't use". Some crashes for resizing were unfolded, add tests for those.
Diffstat (limited to 'src/nvim/option.c')
-rw-r--r--src/nvim/option.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c
index 3914e020b1..5517768194 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -50,6 +50,7 @@
#include "nvim/fold.h"
#include "nvim/getchar.h"
#include "nvim/hardcopy.h"
+#include "nvim/highlight.h"
#include "nvim/indent_c.h"
#include "nvim/mbyte.h"
#include "nvim/memfile.h"
@@ -65,6 +66,7 @@
#include "nvim/normal.h"
#include "nvim/os_unix.h"
#include "nvim/path.h"
+#include "nvim/popupmnu.h"
#include "nvim/regexp.h"
#include "nvim/screen.h"
#include "nvim/spell.h"
@@ -4338,6 +4340,14 @@ static char *set_num_option(int opt_idx, char_u *varp, long value,
if (p_uc && !old_value) {
ml_open_files();
}
+ } else if (pp == &p_pb) {
+ p_pb = MAX(MIN(p_pb, 100), 0);
+ if (old_value != 0) {
+ hl_invalidate_blends();
+ }
+ if (pum_drawn()) {
+ pum_recompose();
+ }
} else if (pp == &p_pyx) {
if (p_pyx != 0 && p_pyx != 2 && p_pyx != 3) {
errmsg = e_invarg;