summaryrefslogtreecommitdiff
path: root/src/option.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-05-26 21:03:24 +0200
committerBram Moolenaar <Bram@vim.org>2019-05-26 21:03:24 +0200
commit20c023aee0ceafac9431fb8ab8d169747b5140dd (patch)
tree479954fa4e6886dbc3bef40cb00569ae6cf440dc /src/option.c
parent9d591525a5d7a693aa47b4a87c5f53c503500c1c (diff)
downloadvim-git-20c023aee0ceafac9431fb8ab8d169747b5140dd.tar.gz
patch 8.1.1405: "highlight" option of popup windows not supportedv8.1.1405
Problem: "highlight" option of popup windows not supported. Solution: Implement the "highlight" option.
Diffstat (limited to 'src/option.c')
-rw-r--r--src/option.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/option.c b/src/option.c
index 9b23eed58..6bc1499f6 100644
--- a/src/option.c
+++ b/src/option.c
@@ -5954,6 +5954,54 @@ set_string_option_direct(
}
/*
+ * Like set_string_option_direct(), but for a window-local option in "wp".
+ * Blocks autocommands to avoid the old curwin becoming invalid.
+ */
+ void
+set_string_option_direct_in_win(
+ win_T *wp,
+ char_u *name,
+ int opt_idx,
+ char_u *val,
+ int opt_flags,
+ int set_sid)
+{
+ win_T *save_curwin = curwin;
+
+ block_autocmds();
+ curwin = wp;
+ curbuf = curwin->w_buffer;
+ set_string_option_direct(name, opt_idx, val, opt_flags, set_sid);
+ curwin = save_curwin;
+ curbuf = curwin->w_buffer;
+ unblock_autocmds();
+}
+
+/*
+ * Like set_string_option_direct(), but for a buffer-local option in "buf".
+ * Blocks autocommands to avoid the old curbuf becoming invalid.
+ */
+ void
+set_string_option_direct_in_buf(
+ buf_T *buf,
+ char_u *name,
+ int opt_idx,
+ char_u *val,
+ int opt_flags,
+ int set_sid)
+{
+ buf_T *save_curbuf = curbuf;
+
+ block_autocmds();
+ curbuf = buf;
+ curwin->w_buffer = curbuf;
+ set_string_option_direct(name, opt_idx, val, opt_flags, set_sid);
+ curbuf = save_curbuf;
+ curwin->w_buffer = curbuf;
+ unblock_autocmds();
+}
+
+/*
* Set global value for string option when it's a local option.
*/
static void