diff options
author | Natasha England-Elbro <46329225+0x00002a@users.noreply.github.com> | 2022-07-15 18:42:01 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-15 10:42:01 -0700 |
commit | 86f0da922fbf37278abd62a0fb90fe7e2452ad93 (patch) | |
tree | 55eb9a0e36771b99a947d0c9d23ad87fc1e934a2 | |
parent | 6645f59832682e9a3623c2b1e45369529bef201a (diff) | |
download | rneovim-86f0da922fbf37278abd62a0fb90fe7e2452ad93.tar.gz rneovim-86f0da922fbf37278abd62a0fb90fe7e2452ad93.tar.bz2 rneovim-86f0da922fbf37278abd62a0fb90fe7e2452ad93.zip |
fix: remote UI may get invalid 'pumblend' value #19379
fixes: https://github.com/neovim/neovim/issues/19340
-rw-r--r-- | src/nvim/option.c | 4 | ||||
-rw-r--r-- | test/functional/ui/options_spec.lua | 6 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c index a3bd960fa5..821c7208e3 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -4343,7 +4343,7 @@ static char *set_bool_option(const int opt_idx, char_u *const varp, const int va if (options[opt_idx].flags & P_UI_OPTION) { ui_call_option_set(cstr_as_string(options[opt_idx].fullname), - BOOLEAN_OBJ(value)); + BOOLEAN_OBJ(*varp)); } comp_col(); // in case 'ruler' or 'showcmd' changed @@ -4784,7 +4784,7 @@ static char *set_num_option(int opt_idx, char_u *varp, long value, char *errbuf, if (errmsg == NULL && options[opt_idx].flags & P_UI_OPTION) { ui_call_option_set(cstr_as_string(options[opt_idx].fullname), - INTEGER_OBJ(value)); + INTEGER_OBJ(*pp)); } comp_col(); // in case 'columns' or 'ls' changed diff --git a/test/functional/ui/options_spec.lua b/test/functional/ui/options_spec.lua index 82f856e4df..346a64c63b 100644 --- a/test/functional/ui/options_spec.lua +++ b/test/functional/ui/options_spec.lua @@ -87,6 +87,12 @@ describe('UI receives option updates', function() eq(expected, screen.options) end) + command("set pumblend=-1") + expected.pumblend = 0 + screen:expect(function() + eq(expected, screen.options) + end) + command("set guifont=Comic\\ Sans") expected.guifont = "Comic Sans" screen:expect(function() |