annotate runtime/syntax/synload.vim @ 14893:291656f731c9 v8.1.0458

patch 8.1.0458: ml_get error and crash when using "do" commit https://github.com/vim/vim/commit/df77cef92ec034796723ffa3adb12e8b46daa98e Author: Bram Moolenaar <Bram@vim.org> Date: Sun Oct 7 17:46:42 2018 +0200 patch 8.1.0458: ml_get error and crash when using "do" Problem: Ml_get error and crash when using "do". Solution: Adjust cursor position also when diffupdate is not needed. (Hirohito Higashi)
author Bram Moolenaar <Bram@vim.org>
date Sun, 07 Oct 2018 18:00:05 +0200
parents c78513465e6e
children bd021eb62e73
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>
10348
c78513465e6e commit https://github.com/vim/vim/commit/25de4c232d580583feadae11ab34e3cc6333c350
Christian Brabandt <cb@256bit.org>
parents: 7013
diff changeset
3 " Last Change: 2016 Nov 04
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 sets up for syntax highlighting.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 " It is loaded from "syntax.vim" and "manual.vim".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 " 1. Set the default highlight groups.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 " 2. Install Syntax autocommands for all the available syntax files.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 if !has("syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 " let others know that syntax has been switched on
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 let syntax_on = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 " Set the default highlighting colors. Use a color scheme if specified.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 if exists("colors_name")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 exe "colors " . colors_name
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 runtime! syntax/syncolor.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 " Line continuation is used here, remove 'C' from 'cpoptions'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 let s:cpo_save = &cpo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 set cpo&vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 " First remove all old syntax autocommands.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 au! Syntax
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 au Syntax * call s:SynSet()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 fun! s:SynSet()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 " clear syntax for :set syntax=OFF and any syntax name that doesn't exist
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 syn clear
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 if exists("b:current_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 unlet b:current_syntax
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 let s = expand("<amatch>")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 if s == "ON"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 " :set syntax=ON
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 if &filetype == ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 echohl ErrorMsg
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 echo "filetype unknown"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 echohl None
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 let s = &filetype
3847
1003f9b262d7 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3356
diff changeset
49 elseif s == "OFF"
1003f9b262d7 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3356
diff changeset
50 let s = ""
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 if s != ""
782
d20041a02ee5 updated for version 7.0228
vimboss
parents: 164
diff changeset
54 " Load the syntax file(s). When there are several, separated by dots,
d20041a02ee5 updated for version 7.0228
vimboss
parents: 164
diff changeset
55 " load each in sequence.
d20041a02ee5 updated for version 7.0228
vimboss
parents: 164
diff changeset
56 for name in split(s, '\.')
d20041a02ee5 updated for version 7.0228
vimboss
parents: 164
diff changeset
57 exe "runtime! syntax/" . name . ".vim syntax/" . name . "/*.vim"
d20041a02ee5 updated for version 7.0228
vimboss
parents: 164
diff changeset
58 endfor
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 endfun
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62
7013
349e6c01f35d Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3847
diff changeset
63 " 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
64 au Syntax c,cpp,cs,idl,java,php,datascript
22
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
65 \ if (exists('b:load_doxygen_syntax') && b:load_doxygen_syntax)
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
66 \ || (exists('g:load_doxygen_syntax') && g:load_doxygen_syntax)
856
8cd729851562 updated for version 7.0g
vimboss
parents: 782
diff changeset
67 \ | runtime! syntax/doxygen.vim
22
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
68 \ | endif
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
69
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
70
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 " 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
72 if exists("mysyntaxfile")
c78513465e6e commit https://github.com/vim/vim/commit/25de4c232d580583feadae11ab34e3cc6333c350
Christian Brabandt <cb@256bit.org>
parents: 7013
diff changeset
73 let s:fname = expand(mysyntaxfile)
c78513465e6e commit https://github.com/vim/vim/commit/25de4c232d580583feadae11ab34e3cc6333c350
Christian Brabandt <cb@256bit.org>
parents: 7013
diff changeset
74 if filereadable(s:fname)
c78513465e6e commit https://github.com/vim/vim/commit/25de4c232d580583feadae11ab34e3cc6333c350
Christian Brabandt <cb@256bit.org>
parents: 7013
diff changeset
75 execute "source " . fnameescape(s:fname)
c78513465e6e commit https://github.com/vim/vim/commit/25de4c232d580583feadae11ab34e3cc6333c350
Christian Brabandt <cb@256bit.org>
parents: 7013
diff changeset
76 endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 " Restore 'cpoptions'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 let &cpo = s:cpo_save
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 unlet s:cpo_save