mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
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.
This commit is contained in:
20
src/buffer.c
20
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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user