Skip to content

Commit 885f24f

Browse files
committed
patch 7.4.1236
Problem: When "syntax manual" was used switching between buffers removes the highlighting. Solution: Set the syntax option without changing the value. (Anton Lindqvist)
1 parent 11e0afa commit 885f24f

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

runtime/syntax/manual.vim

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
" Vim syntax support file
22
" Maintainer: Bram Moolenaar <[email protected]>
3-
" Last Change: 2008 Jan 26
3+
" Last Change: 2016 Feb 01
44

55
" This file is used for ":syntax manual".
66
" It installs the Syntax autocommands, but no the FileType autocommands.
@@ -16,10 +16,11 @@ endif
1616

1717
let syntax_manual = 1
1818

19-
" Remove the connection between FileType and Syntax autocommands.
20-
if exists('#syntaxset')
21-
au! syntaxset FileType
22-
endif
19+
" Overrule the connection between FileType and Syntax autocommands. This sets
20+
" the syntax when the file type is detected, without changing the value.
21+
augroup syntaxset
22+
au! FileType * exe "set syntax=" . &syntax
23+
augroup END
2324

2425
" If the GUI is already running, may still need to install the FileType menu.
2526
" Don't do it when the 'M' flag is included in 'guioptions'.

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -742,6 +742,8 @@ static char *(features[]) =
742742

743743
static int included_patches[] =
744744
{ /* Add new patch number below this line */
745+
/**/
746+
1236,
745747
/**/
746748
1235,
747749
/**/

0 commit comments

Comments
 (0)