comparison runtime/syntax/lhaskell.vim @ 10048:43efa4f5a8ea

commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Aug 30 23:26:57 2016 +0200 Updated runtime files. Remove version checks for Vim older than 6.0.
author Christian Brabandt <cb@256bit.org>
date Tue, 30 Aug 2016 23:30:09 +0200
parents b9e314fe473f
children 46763b01cd9a
comparison
equal deleted inserted replaced
10047:a62862410ca1 10048:43efa4f5a8ea
34 " 2009 April 29: Fixed highlighting breakage in TeX mode, 34 " 2009 April 29: Fixed highlighting breakage in TeX mode,
35 " thanks to Kalman Noel 35 " thanks to Kalman Noel
36 " 36 "
37 37
38 38
39 " For version 5.x: Clear all syntax items 39 " quit when a syntax file was already loaded
40 " For version 6.x: Quit when a syntax file was already loaded 40 if exists("b:current_syntax")
41 if version < 600
42 syntax clear
43 elseif exists("b:current_syntax")
44 finish 41 finish
45 endif 42 endif
46 43
47 " First off, see if we can inherit a user preference for lhs_markup 44 " First off, see if we can inherit a user preference for lhs_markup
48 if !exists("b:lhs_markup") 45 if !exists("b:lhs_markup")
82 endif 79 endif
83 endif 80 endif
84 81
85 " If user wants us to highlight TeX syntax or guess thinks it's TeX, read it. 82 " If user wants us to highlight TeX syntax or guess thinks it's TeX, read it.
86 if b:lhs_markup == "tex" 83 if b:lhs_markup == "tex"
87 if version < 600 84 runtime! syntax/tex.vim
88 source <sfile>:p:h/tex.vim 85 unlet b:current_syntax
89 set isk+=_ 86 " Tex.vim removes "_" from 'iskeyword', but we need it for Haskell.
90 else 87 setlocal isk+=_
91 runtime! syntax/tex.vim
92 unlet b:current_syntax
93 " Tex.vim removes "_" from 'iskeyword', but we need it for Haskell.
94 setlocal isk+=_
95 endif
96 syntax cluster lhsTeXContainer contains=tex.*Zone,texAbstract 88 syntax cluster lhsTeXContainer contains=tex.*Zone,texAbstract
97 else 89 else
98 syntax cluster lhsTeXContainer contains=.* 90 syntax cluster lhsTeXContainer contains=.*
99 endif 91 endif
100 92
101 " Literate Haskell is Haskell in between text, so at least read Haskell 93 " Literate Haskell is Haskell in between text, so at least read Haskell
102 " highlighting 94 " highlighting
103 if version < 600 95 syntax include @haskellTop syntax/haskell.vim
104 syntax include @haskellTop <sfile>:p:h/haskell.vim
105 else
106 syntax include @haskellTop syntax/haskell.vim
107 endif
108 96
109 syntax region lhsHaskellBirdTrack start="^>" end="\%(^[^>]\)\@=" contains=@haskellTop,lhsBirdTrack containedin=@lhsTeXContainer 97 syntax region lhsHaskellBirdTrack start="^>" end="\%(^[^>]\)\@=" contains=@haskellTop,lhsBirdTrack containedin=@lhsTeXContainer
110 syntax region lhsHaskellBeginEndBlock start="^\\begin{code}\s*$" matchgroup=NONE end="\%(^\\end{code}.*$\)\@=" contains=@haskellTop,beginCodeBegin containedin=@lhsTeXContainer 98 syntax region lhsHaskellBeginEndBlock start="^\\begin{code}\s*$" matchgroup=NONE end="\%(^\\end{code}.*$\)\@=" contains=@haskellTop,beginCodeBegin containedin=@lhsTeXContainer
111 99
112 syntax match lhsBirdTrack "^>" contained 100 syntax match lhsBirdTrack "^>" contained
113 101
114 syntax match beginCodeBegin "^\\begin" nextgroup=beginCodeCode contained 102 syntax match beginCodeBegin "^\\begin" nextgroup=beginCodeCode contained
115 syntax region beginCodeCode matchgroup=texDelimiter start="{" end="}" 103 syntax region beginCodeCode matchgroup=texDelimiter start="{" end="}"
116 104
117 " Define the default highlighting. 105 " Define the default highlighting.
118 " For version 5.7 and earlier: only when not done already 106 " Only when an item doesn't have highlighting yet
119 " For version 5.8 and later: only when an item doesn't have highlighting yet 107 command -nargs=+ HiLink hi def link <args>
120 if version >= 508 || !exists("did_tex_syntax_inits")
121 if version < 508
122 let did_tex_syntax_inits = 1
123 command -nargs=+ HiLink hi link <args>
124 else
125 command -nargs=+ HiLink hi def link <args>
126 endif
127 108
128 HiLink lhsBirdTrack Comment 109 HiLink lhsBirdTrack Comment
129 110
130 HiLink beginCodeBegin texCmdName 111 HiLink beginCodeBegin texCmdName
131 HiLink beginCodeCode texSection 112 HiLink beginCodeCode texSection
132 113
133 delcommand HiLink 114 delcommand HiLink
134 endif
135 115
136 " Restore cursor to original position, as it may have been disturbed 116 " Restore cursor to original position, as it may have been disturbed
137 " by the searches in our guessing code 117 " by the searches in our guessing code
138 call cursor (s:oldline, s:oldcolumn) 118 call cursor (s:oldline, s:oldcolumn)
139 119