annotate runtime/syntax/syntax.vim @ 31263:d8e7d725a666 v9.0.0965

patch 9.0.0965: using one window for executing autocommands is insufficient Commit: https://github.com/vim/vim/commit/e76062c078debed0df818f70e4db14ad7a7cb53a Author: Bram Moolenaar <Bram@vim.org> Date: Mon Nov 28 18:51:43 2022 +0000 patch 9.0.0965: using one window for executing autocommands is insufficient Problem: Using one window for executing autocommands is insufficient. Solution: Use up to five windows for executing autocommands.
author Bram Moolenaar <Bram@vim.org>
date Mon, 28 Nov 2022 20:00:05 +0100
parents f73a9bdff3a3
children 4027cefc2aab
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim syntax support file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 " Maintainer: Bram Moolenaar <Bram@vim.org>
28517
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 28433
diff changeset
3 " Last Change: 2022 Apr 12
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5 " This file is used for ":syntax on".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 " It installs the autocommands and starts highlighting for all buffers.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 if !has("syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 " If Syntax highlighting appears to be on already, turn it off first, so that
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 " any leftovers are cleared.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 if exists("syntax_on") || exists("syntax_manual")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 so <sfile>:p:h/nosyntax.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 " Load the Syntax autocommands and set the default methods for highlighting.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 runtime syntax/synload.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 " Load the FileType autocommands if not done yet.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 if exists("did_load_filetypes")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 let s:did_ft = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 filetype on
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 let s:did_ft = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 " Set up the connection between FileType and Syntax autocommands.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 " This makes the syntax automatically set when the file type is detected.
28433
367439b95aba patch 8.2.4741: startup test fails
Bram Moolenaar <Bram@vim.org>
parents: 7
diff changeset
31 " Avoid an error when 'verbose' is set and <amatch> expansion fails.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 augroup syntaxset
28433
367439b95aba patch 8.2.4741: startup test fails
Bram Moolenaar <Bram@vim.org>
parents: 7
diff changeset
33 au! FileType * 0verbose exe "set syntax=" . expand("<amatch>")
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 augroup END
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 " Execute the syntax autocommands for the each buffer.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 " If the filetype wasn't detected yet, do that now.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 " Always do the syntaxset autocommands, for buffers where the 'filetype'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 " already was set manually (e.g., help buffers).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 doautoall syntaxset FileType
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 if !s:did_ft
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 doautoall filetypedetect BufRead
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 endif