summaryrefslogtreecommitdiff
path: root/src/option.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-09-25 20:37:36 +0200
committerBram Moolenaar <Bram@vim.org>2019-09-25 20:37:36 +0200
commit010ee9657acf1a9f799079d718998c94e50ccadc (patch)
treee69265142e192956576867020a98d2f58523edd9 /src/option.c
parent03ac52fc025790c474030ea556cec799400aa046 (diff)
downloadvim-git-010ee9657acf1a9f799079d718998c94e50ccadc.tar.gz
patch 8.1.2073: when editing a buffer 'colorcolumn' may not workv8.1.2073
Problem: When editing a buffer 'colorcolumn' may not work. Solution: Set the buffer before copying option values. Call check_colorcolumn() after copying window options.
Diffstat (limited to 'src/option.c')
-rw-r--r--src/option.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/option.c b/src/option.c
index 1ffa11d12..be967dc00 100644
--- a/src/option.c
+++ b/src/option.c
@@ -2323,19 +2323,14 @@ didset_options(void)
(void)did_set_spell_option(TRUE);
#endif
#ifdef FEAT_CMDWIN
- /* set cedit_key */
+ // set cedit_key
(void)check_cedit();
#endif
#ifdef FEAT_LINEBREAK
- briopt_check(curwin);
-#endif
-#ifdef FEAT_LINEBREAK
/* initialize the table for 'breakat'. */
fill_breakat_flags();
#endif
-#ifdef FEAT_SYN_HL
- fill_culopt_flags(NULL, curwin);
-#endif
+ after_copy_winopt(curwin);
}
/*
@@ -5528,11 +5523,21 @@ win_copy_options(win_T *wp_from, win_T *wp_to)
{
copy_winopt(&wp_from->w_onebuf_opt, &wp_to->w_onebuf_opt);
copy_winopt(&wp_from->w_allbuf_opt, &wp_to->w_allbuf_opt);
-#if defined(FEAT_LINEBREAK)
- briopt_check(wp_to);
+ after_copy_winopt(wp_to);
+}
+
+/*
+ * After copying window options: update variables depending on options.
+ */
+ void
+after_copy_winopt(win_T *wp)
+{
+#ifdef FEAT_LINEBREAK
+ briopt_check(wp);
#endif
#ifdef FEAT_SYN_HL
- fill_culopt_flags(NULL, wp_to);
+ fill_culopt_flags(NULL, wp);
+ check_colorcolumn(wp);
#endif
}