diff src/buffer.c @ 18156:c81370b3ede4 v8.1.2073

patch 8.1.2073: when editing a buffer 'colorcolumn' may not work Commit: https://github.com/vim/vim/commit/010ee9657acf1a9f799079d718998c94e50ccadc Author: Bram Moolenaar <Bram@vim.org> Date: Wed Sep 25 20:37:36 2019 +0200 patch 8.1.2073: when editing a buffer 'colorcolumn' may not work Problem: When editing a buffer 'colorcolumn' may not work. Solution: Set the buffer before copying option values. Call check_colorcolumn() after copying window options.
author Bram Moolenaar <Bram@vim.org>
date Wed, 25 Sep 2019 20:45:03 +0200
parents cf8e0c7e0cb9
children e0ec4cd7a865
line wrap: on
line diff
--- 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);
 }
 
 /*