summaryrefslogtreecommitdiffstats
path: root/src/buffer.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/buffer.c
parent03ac52fc025790c474030ea556cec799400aa046 (diff)
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/buffer.c')
-rw-r--r--src/buffer.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 81f2799f49..4f754f5452 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -1738,22 +1738,22 @@ set_curbuf(buf_T *buf, int action)
static void
enter_buffer(buf_T *buf)
{
- /* Copy buffer and window local option values. Not for a help buffer. */
+ // Get the buffer in the current window.
+ curwin->w_buffer = buf;
+ curbuf = buf;
+ ++curbuf->b_nwindows;
+
+ // Copy buffer and window local option values. Not for a help buffer.
buf_copy_options(buf, BCO_ENTER | BCO_NOHELP);
if (!buf->b_help)
get_winopts(buf);
#ifdef FEAT_FOLDING
else
- /* Remove all folds in the window. */
+ // Remove all folds in the window.
clearFolding(curwin);
- foldUpdateAll(curwin); /* update folds (later). */
+ foldUpdateAll(curwin); // update folds (later).
#endif
- /* Get the buffer in the current window. */
- curwin->w_buffer = buf;
- curbuf = buf;
- ++curbuf->b_nwindows;
-
#ifdef FEAT_DIFF
if (curwin->w_p_diff)
diff_buf_add(curbuf);
@@ -2980,9 +2980,7 @@ get_winopts(buf_T *buf)
if (p_fdls >= 0)
curwin->w_p_fdl = p_fdls;
#endif
-#ifdef FEAT_SYN_HL
- check_colorcolumn(curwin);
-#endif
+ after_copy_winopt(curwin);
}
/*