summaryrefslogtreecommitdiff
path: root/runtime/syntax/lhaskell.vim
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/syntax/lhaskell.vim')
-rw-r--r--runtime/syntax/lhaskell.vim52
1 files changed, 16 insertions, 36 deletions
diff --git a/runtime/syntax/lhaskell.vim b/runtime/syntax/lhaskell.vim
index 077549a0c..78207812f 100644
--- a/runtime/syntax/lhaskell.vim
+++ b/runtime/syntax/lhaskell.vim
@@ -36,11 +36,8 @@
"
-" For version 5.x: Clear all syntax items
-" For version 6.x: Quit when a syntax file was already loaded
-if version < 600
- syntax clear
-elseif exists("b:current_syntax")
+" quit when a syntax file was already loaded
+if exists("b:current_syntax")
finish
endif
@@ -84,15 +81,10 @@ endif
" If user wants us to highlight TeX syntax or guess thinks it's TeX, read it.
if b:lhs_markup == "tex"
- if version < 600
- source <sfile>:p:h/tex.vim
- set isk+=_
- else
- runtime! syntax/tex.vim
- unlet b:current_syntax
- " Tex.vim removes "_" from 'iskeyword', but we need it for Haskell.
- setlocal isk+=_
- endif
+ runtime! syntax/tex.vim
+ unlet b:current_syntax
+ " Tex.vim removes "_" from 'iskeyword', but we need it for Haskell.
+ setlocal isk+=_
syntax cluster lhsTeXContainer contains=tex.*Zone,texAbstract
else
syntax cluster lhsTeXContainer contains=.*
@@ -100,11 +92,7 @@ endif
" Literate Haskell is Haskell in between text, so at least read Haskell
" highlighting
-if version < 600
- syntax include @haskellTop <sfile>:p:h/haskell.vim
-else
- syntax include @haskellTop syntax/haskell.vim
-endif
+syntax include @haskellTop syntax/haskell.vim
syntax region lhsHaskellBirdTrack start="^>" end="\%(^[^>]\)\@=" contains=@haskellTop,lhsBirdTrack containedin=@lhsTeXContainer
syntax region lhsHaskellBeginEndBlock start="^\\begin{code}\s*$" matchgroup=NONE end="\%(^\\end{code}.*$\)\@=" contains=@haskellTop,beginCodeBegin containedin=@lhsTeXContainer
@@ -115,23 +103,15 @@ syntax match beginCodeBegin "^\\begin" nextgroup=beginCodeCode contained
syntax region beginCodeCode matchgroup=texDelimiter start="{" end="}"
" Define the default highlighting.
-" For version 5.7 and earlier: only when not done already
-" For version 5.8 and later: only when an item doesn't have highlighting yet
-if version >= 508 || !exists("did_tex_syntax_inits")
- if version < 508
- let did_tex_syntax_inits = 1
- command -nargs=+ HiLink hi link <args>
- else
- command -nargs=+ HiLink hi def link <args>
- endif
-
- HiLink lhsBirdTrack Comment
-
- HiLink beginCodeBegin texCmdName
- HiLink beginCodeCode texSection
-
- delcommand HiLink
-endif
+" Only when an item doesn't have highlighting yet
+command -nargs=+ HiLink hi def link <args>
+
+HiLink lhsBirdTrack Comment
+
+HiLink beginCodeBegin texCmdName
+HiLink beginCodeCode texSection
+
+delcommand HiLink
" Restore cursor to original position, as it may have been disturbed
" by the searches in our guessing code