summaryrefslogtreecommitdiff
path: root/src/fileio.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fileio.c')
-rw-r--r--src/fileio.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/fileio.c b/src/fileio.c
index 52eb34b3b..6fe112745 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -8982,6 +8982,10 @@ win_found:
&& buf_valid(aco->new_curbuf)
&& aco->new_curbuf->b_ml.ml_mfp != NULL)
{
+# if defined(FEAT_SYN_HL) || defined(FEAT_SPELL)
+ if (curwin->w_s == &curbuf->b_s)
+ curwin->w_s = &aco->new_curbuf->b_s;
+# endif
--curbuf->b_nwindows;
curbuf = aco->new_curbuf;
curwin->w_buffer = curbuf;