summaryrefslogtreecommitdiff
path: root/src/ex_cmds.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-06-25 21:17:25 +0200
committerBram Moolenaar <Bram@vim.org>2017-06-25 21:17:25 +0200
commit1814183b865059679f6ee526ec23fc575e536e66 (patch)
tree27687232ab6376a33759072132c4e3bf9c20ba17 /src/ex_cmds.c
parent182a17b1e80b92826204d967808df0d30eb2ef27 (diff)
downloadvim-git-1814183b865059679f6ee526ec23fc575e536e66.tar.gz
patch 8.0.0677: setting 'filetype' may switch buffersv8.0.0677
Problem: Setting 'filetype' internally may cause the current buffer and window to change unexpectedly. Solution: Set curbuf_lock. (closes #1734)
Diffstat (limited to 'src/ex_cmds.c')
-rw-r--r--src/ex_cmds.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index bb9a92776..39f658a6e 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -6835,7 +6835,11 @@ fix_help_buffer(void)
#ifdef FEAT_AUTOCMD
/* Set filetype to "help" if still needed. */
if (STRCMP(curbuf->b_p_ft, "help") != 0)
+ {
+ ++curbuf_lock;
set_option_value((char_u *)"ft", 0L, (char_u *)"help", OPT_LOCAL);
+ --curbuf_lock;
+ }
#endif
#ifdef FEAT_SYN_HL