annotate runtime/syntax/synload.vim @ 33515:f41bdc22abcd v9.0.2006

patch 9.0.2006: Vim9: need more tests Commit: https://github.com/vim/vim/commit/f4ee1cb74ba86383190ffcda84147892f7740f21 Author: Yegappan Lakshmanan <yegappan@yahoo.com> Date: Mon Oct 9 17:57:27 2023 +0200 patch 9.0.2006: Vim9: need more tests Problem: Vim9: need more tests Solution: add additional disassembly tests closes: #13305 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
author Christian Brabandt <cb@256bit.org>
date Mon, 09 Oct 2023 18:00:10 +0200
parents 4027cefc2aab
children
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
32770
4027cefc2aab Farewell to Bram and dedicate upcoming Vim 9.1 to him (#12749)
Christian Brabandt <cb@256bit.org>
parents: 28517
diff changeset
2 " Maintainer: The Vim Project <https://github.com/vim/vim>
4027cefc2aab Farewell to Bram and dedicate upcoming Vim 9.1 to him (#12749)
Christian Brabandt <cb@256bit.org>
parents: 28517
diff changeset
3 " Last Change: 2023 Aug 10
4027cefc2aab Farewell to Bram and dedicate upcoming Vim 9.1 to him (#12749)
Christian Brabandt <cb@256bit.org>
parents: 28517
diff changeset
4 " Former Maintainer: Bram Moolenaar <Bram@vim.org>
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 " This file sets up for syntax highlighting.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 " It is loaded from "syntax.vim" and "manual.vim".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 " 1. Set the default highlight groups.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 " 2. Install Syntax autocommands for all the available syntax files.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 if !has("syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 " let others know that syntax has been switched on
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 let syntax_on = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 " Set the default highlighting colors. Use a color scheme if specified.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 if exists("colors_name")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 exe "colors " . colors_name
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 runtime! syntax/syncolor.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 " Line continuation is used here, remove 'C' from 'cpoptions'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 let s:cpo_save = &cpo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 set cpo&vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 " First remove all old syntax autocommands.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 au! Syntax
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 au Syntax * call s:SynSet()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 fun! s:SynSet()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 " clear syntax for :set syntax=OFF and any syntax name that doesn't exist
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 syn clear
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 if exists("b:current_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 unlet b:current_syntax
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40
28433
367439b95aba patch 8.2.4741: startup test fails
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
41 0verbose let s = expand("<amatch>")
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 if s == "ON"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 " :set syntax=ON
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 if &filetype == ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 echohl ErrorMsg
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 echo "filetype unknown"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 echohl None
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 let s = &filetype
3847
1003f9b262d7 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3356
diff changeset
50 elseif s == "OFF"
1003f9b262d7 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3356
diff changeset
51 let s = ""
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 if s != ""
782
d20041a02ee5 updated for version 7.0228
vimboss
parents: 164
diff changeset
55 " Load the syntax file(s). When there are several, separated by dots,
20115
bd021eb62e73 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 10348
diff changeset
56 " load each in sequence. Skip empty entries.
782
d20041a02ee5 updated for version 7.0228
vimboss
parents: 164
diff changeset
57 for name in split(s, '\.')
20115
bd021eb62e73 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 10348
diff changeset
58 if !empty(name)
bd021eb62e73 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 10348
diff changeset
59 exe "runtime! syntax/" . name . ".vim syntax/" . name . "/*.vim"
bd021eb62e73 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 10348
diff changeset
60 endif
782
d20041a02ee5 updated for version 7.0228
vimboss
parents: 164
diff changeset
61 endfor
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 endfun
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65
7013
349e6c01f35d Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3847
diff changeset
66 " Handle adding doxygen to other languages (C, C++, C#, IDL, java, php, DataScript)
349e6c01f35d Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3847
diff changeset
67 au Syntax c,cpp,cs,idl,java,php,datascript
22
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
68 \ if (exists('b:load_doxygen_syntax') && b:load_doxygen_syntax)
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
69 \ || (exists('g:load_doxygen_syntax') && g:load_doxygen_syntax)
856
8cd729851562 updated for version 7.0g
vimboss
parents: 782
diff changeset
70 \ | runtime! syntax/doxygen.vim
22
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
71 \ | endif
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
72
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
73
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 " Source the user-specified syntax highlighting file
10348
c78513465e6e commit https://github.com/vim/vim/commit/25de4c232d580583feadae11ab34e3cc6333c350
Christian Brabandt <cb@256bit.org>
parents: 7013
diff changeset
75 if exists("mysyntaxfile")
c78513465e6e commit https://github.com/vim/vim/commit/25de4c232d580583feadae11ab34e3cc6333c350
Christian Brabandt <cb@256bit.org>
parents: 7013
diff changeset
76 let s:fname = expand(mysyntaxfile)
c78513465e6e commit https://github.com/vim/vim/commit/25de4c232d580583feadae11ab34e3cc6333c350
Christian Brabandt <cb@256bit.org>
parents: 7013
diff changeset
77 if filereadable(s:fname)
c78513465e6e commit https://github.com/vim/vim/commit/25de4c232d580583feadae11ab34e3cc6333c350
Christian Brabandt <cb@256bit.org>
parents: 7013
diff changeset
78 execute "source " . fnameescape(s:fname)
c78513465e6e commit https://github.com/vim/vim/commit/25de4c232d580583feadae11ab34e3cc6333c350
Christian Brabandt <cb@256bit.org>
parents: 7013
diff changeset
79 endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 " Restore 'cpoptions'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 let &cpo = s:cpo_save
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 unlet s:cpo_save