Mercurial > vim
comparison src/ex_cmds.c @ 11533:c83dd5fa40d8 v8.0.0649
patch 8.0.0649: when opening a help file the filetype is set several times
commit https://github.com/vim/vim/commit/9049298f8d0bbc237b7c666c7ad6cdabe738e8fc
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Jun 22 14:16:31 2017 +0200
patch 8.0.0649: when opening a help file the filetype is set several times
Problem: When opening a help file the filetype is set several times.
Solution: When setting the filetype to the same value from a modeline, don't
trigger FileType autocommands. Don't set the filetype to "help"
when it's already set correctly.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 22 Jun 2017 14:30:03 +0200 |
parents | 578df034735d |
children | e0eb2de60f09 |
comparison
equal
deleted
inserted
replaced
11532:fbc166ba3f00 | 11533:c83dd5fa40d8 |
---|---|
6830 char_u *fname; | 6830 char_u *fname; |
6831 char_u *p; | 6831 char_u *p; |
6832 char_u *rt; | 6832 char_u *rt; |
6833 int mustfree; | 6833 int mustfree; |
6834 | 6834 |
6835 /* set filetype to "help". */ | 6835 /* Set filetype to "help" if still needed. */ |
6836 set_option_value((char_u *)"ft", 0L, (char_u *)"help", OPT_LOCAL); | 6836 if (STRCMP(curbuf->b_p_ft, "help") != 0) |
6837 set_option_value((char_u *)"ft", 0L, (char_u *)"help", OPT_LOCAL); | |
6837 | 6838 |
6838 #ifdef FEAT_SYN_HL | 6839 #ifdef FEAT_SYN_HL |
6839 if (!syntax_present(curwin)) | 6840 if (!syntax_present(curwin)) |
6840 #endif | 6841 #endif |
6841 { | 6842 { |