Mercurial > vim
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 |
rev | line source |
---|---|
7 | 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 | 5 |
6 " This file sets up for syntax highlighting. | |
7 " It is loaded from "syntax.vim" and "manual.vim". | |
8 " 1. Set the default highlight groups. | |
9 " 2. Install Syntax autocommands for all the available syntax files. | |
10 | |
11 if !has("syntax") | |
12 finish | |
13 endif | |
14 | |
15 " let others know that syntax has been switched on | |
16 let syntax_on = 1 | |
17 | |
18 " Set the default highlighting colors. Use a color scheme if specified. | |
19 if exists("colors_name") | |
20 exe "colors " . colors_name | |
21 else | |
22 runtime! syntax/syncolor.vim | |
23 endif | |
24 | |
25 " Line continuation is used here, remove 'C' from 'cpoptions' | |
26 let s:cpo_save = &cpo | |
27 set cpo&vim | |
28 | |
29 " First remove all old syntax autocommands. | |
30 au! Syntax | |
31 | |
32 au Syntax * call s:SynSet() | |
33 | |
34 fun! s:SynSet() | |
35 " clear syntax for :set syntax=OFF and any syntax name that doesn't exist | |
36 syn clear | |
37 if exists("b:current_syntax") | |
38 unlet b:current_syntax | |
39 endif | |
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 | 42 if s == "ON" |
43 " :set syntax=ON | |
44 if &filetype == "" | |
45 echohl ErrorMsg | |
46 echo "filetype unknown" | |
47 echohl None | |
48 endif | |
49 let s = &filetype | |
3847 | 50 elseif s == "OFF" |
51 let s = "" | |
7 | 52 endif |
53 | |
54 if s != "" | |
782 | 55 " Load the syntax file(s). When there are several, separated by dots, |
20115 | 56 " load each in sequence. Skip empty entries. |
782 | 57 for name in split(s, '\.') |
20115 | 58 if !empty(name) |
59 exe "runtime! syntax/" . name . ".vim syntax/" . name . "/*.vim" | |
60 endif | |
782 | 61 endfor |
7 | 62 endif |
63 endfun | |
64 | |
65 | |
7013 | 66 " Handle adding doxygen to other languages (C, C++, C#, IDL, java, php, DataScript) |
67 au Syntax c,cpp,cs,idl,java,php,datascript | |
22 | 68 \ if (exists('b:load_doxygen_syntax') && b:load_doxygen_syntax) |
69 \ || (exists('g:load_doxygen_syntax') && g:load_doxygen_syntax) | |
856 | 70 \ | runtime! syntax/doxygen.vim |
22 | 71 \ | endif |
72 | |
73 | |
7 | 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 | 80 endif |
81 | |
82 " Restore 'cpoptions' | |
83 let &cpo = s:cpo_save | |
84 unlet s:cpo_save |