annotate runtime/syntax/syntax.vim @ 25252:acda780ffc3e v8.2.3162

patch 8.2.3162: Vim9: argument types are not checked at compile time Commit: https://github.com/vim/vim/commit/1a71d31bf34b0b2b08517903826004ec6fd440e5 Author: Yegappan Lakshmanan <yegappan@yahoo.com> Date: Thu Jul 15 12:49:58 2021 +0200 patch 8.2.3162: Vim9: argument types are not checked at compile time Problem: Vim9: argument types are not checked at compile time. Solution: Add more type checks. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/8560)
author Bram Moolenaar <Bram@vim.org>
date Thu, 15 Jul 2021 13:00:06 +0200
parents 3fc0f57ecb91
children 367439b95aba
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>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 " Last Change: 2001 Sep 04
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.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 augroup syntaxset
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 au! FileType * exe "set syntax=" . expand("<amatch>")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 augroup END
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 " Execute the syntax autocommands for the each buffer.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 " If the filetype wasn't detected yet, do that now.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 " Always do the syntaxset autocommands, for buffers where the 'filetype'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 " already was set manually (e.g., help buffers).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 doautoall syntaxset FileType
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 if !s:did_ft
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 doautoall filetypedetect BufRead
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 endif