aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/buffer.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-02-12 07:49:09 +0800
committerGitHub <noreply@github.com>2022-02-12 07:49:09 +0800
commitf6485e9446ed6a59accc86724d05981d5ff8f976 (patch)
treef9724c7ccc1fbd7eccd070186933e1f58364b168 /src/nvim/buffer.c
parent906182065bd73e4fbedeecc347ea8c8647c3304f (diff)
parent4ca522fd0290a2c5767d28c896fefb6d54f9c5d1 (diff)
downloadrneovim-f6485e9446ed6a59accc86724d05981d5ff8f976.tar.gz
rneovim-f6485e9446ed6a59accc86724d05981d5ff8f976.tar.bz2
rneovim-f6485e9446ed6a59accc86724d05981d5ff8f976.zip
Merge pull request #16841 from zeertzjq/vim-8.1.2073
vim-patch:8.1.2073: when editing a buffer 'colorcolumn' may not work
Diffstat (limited to 'src/nvim/buffer.c')
-rw-r--r--src/nvim/buffer.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c
index a9addc0e68..ee704bd1bd 100644
--- a/src/nvim/buffer.c
+++ b/src/nvim/buffer.c
@@ -1497,6 +1497,11 @@ void set_curbuf(buf_T *buf, int action)
*/
void enter_buffer(buf_T *buf)
{
+ // 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) {
@@ -1507,11 +1512,6 @@ void enter_buffer(buf_T *buf)
}
foldUpdateAll(curwin); // update folds (later).
- // Get the buffer in the current window.
- curwin->w_buffer = buf;
- curbuf = buf;
- curbuf->b_nwindows++;
-
if (curwin->w_p_diff) {
diff_buf_add(curbuf);
}