annotate runtime/syntax/lhaskell.vim @ 30807:442a574ffae3 v9.0.0738

patch 9.0.0738: cannot suppress completion "scanning" messages Commit: https://github.com/vim/vim/commit/91ccbad5ded8bcf2cc93a873ff2c3179b0c548c7 Author: =?UTF-8?q?Bj=C3=B6rn=20Linse?= <bjorn.linse@gmail.com> Date: Thu Oct 13 12:51:13 2022 +0100 patch 9.0.0738: cannot suppress completion "scanning" messages Problem: Cannot suppress completion "scanning" messages. Solution: Add the "C" flag in 'shortmess'. (Bjorn Linse, closes https://github.com/vim/vim/issues/11354)
author Bram Moolenaar <Bram@vim.org>
date Thu, 13 Oct 2022 14:00:05 +0200
parents ef454a7f485d
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 file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 " Language: Haskell with literate comments, Bird style,
24024
ef454a7f485d Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
3 " Markdown style, TeX style and plain text surrounding
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4 " \begin{code} \end{code} blocks
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5 " Maintainer: Haskell Cafe mailinglist <haskell-cafe@haskell.org>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 " Original Author: Arthur van Leeuwen <arthurvl@cs.uu.nl>
24024
ef454a7f485d Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
7 " Last Change: 2020 Feb 25
ef454a7f485d Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
8 " Version: 1.05
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 " Thanks to Ian Lynagh for thoughtful comments on initial versions and
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 " for the inspiration for writing this in the first place.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 " This style guesses as to the type of markup used in a literate haskell
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 " file and will highlight (La)TeX markup if it finds any
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 " This behaviour can be overridden, both glabally and locally using
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 " the lhs_markup variable or b:lhs_markup variable respectively.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 " lhs_markup must be set to either tex or none to indicate that
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 " you always want (La)TeX highlighting or no highlighting
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 " must not be set to let the highlighting be guessed
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 " b:lhs_markup must be set to eiterh tex or none to indicate that
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 " you want (La)TeX highlighting or no highlighting for
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 " this particular buffer
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 " must not be set to let the highlighting be guessed
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 " 2004 February 18: New version, based on Ian Lynagh's TeX guessing
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 " lhaskell.vim, cweb.vim, tex.vim, sh.vim and fortran.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 " 2004 February 20: Cleaned up the guessing and overriding a bit
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 " 2004 February 23: Cleaned up syntax highlighting for \begin{code} and
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 " \end{code}, added some clarification to the attributions
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1668
diff changeset
32 " 2008 July 1: Removed % from guess list, as it totally breaks plain
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1668
diff changeset
33 " text markup guessing
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1668
diff changeset
34 " 2009 April 29: Fixed highlighting breakage in TeX mode,
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1668
diff changeset
35 " thanks to Kalman Noel
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 2152
diff changeset
39 " quit when a syntax file was already loaded
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 2152
diff changeset
40 if exists("b:current_syntax")
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 " First off, see if we can inherit a user preference for lhs_markup
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 if !exists("b:lhs_markup")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 if exists("lhs_markup")
24024
ef454a7f485d Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
47 if lhs_markup =~ '\<\%(tex\|md\|none\)\>'
ef454a7f485d Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
48 let b:lhs_markup = matchstr(lhs_markup,'\<\%(tex\|md\|none\)\>')
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 echohl WarningMsg | echo "Unknown value of lhs_markup" | echohl None
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 let b:lhs_markup = "unknown"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 let b:lhs_markup = "unknown"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 else
24024
ef454a7f485d Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
57 if b:lhs_markup !~ '\<\%(tex\|md\|none\)\>'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 let b:lhs_markup = "unknown"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 " Remember where the cursor is, and go to upperleft
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 let s:oldline=line(".")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 let s:oldcolumn=col(".")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 call cursor(1,1)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 " If no user preference, scan buffer for our guess of the markup to
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 " highlight. We only differentiate between TeX and plain markup, where
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 " plain is not highlighted. The heuristic for finding TeX markup is if
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 " one of the following occurs anywhere in the file:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 " - \documentclass
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 " - \begin{env} (for env != code)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 " - \part, \chapter, \section, \subsection, \subsubsection, etc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 if b:lhs_markup == "unknown"
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1668
diff changeset
75 if search('\\documentclass\|\\begin{\(code}\)\@!\|\\\(sub\)*section\|\\chapter|\\part','W') != 0
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 let b:lhs_markup = "tex"
24024
ef454a7f485d Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
77 elseif search('```haskell','W') != 0
ef454a7f485d Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
78 let b:lhs_markup = "md"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 let b:lhs_markup = "plain"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1668
diff changeset
84 " If user wants us to highlight TeX syntax or guess thinks it's TeX, read it.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 if b:lhs_markup == "tex"
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 2152
diff changeset
86 runtime! syntax/tex.vim
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 2152
diff changeset
87 unlet b:current_syntax
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 2152
diff changeset
88 " Tex.vim removes "_" from 'iskeyword', but we need it for Haskell.
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 2152
diff changeset
89 setlocal isk+=_
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1668
diff changeset
90 syntax cluster lhsTeXContainer contains=tex.*Zone,texAbstract
24024
ef454a7f485d Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
91 elseif b:lhs_markup == "md"
ef454a7f485d Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
92 runtime! syntax/markdown.vim
ef454a7f485d Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
93 unlet b:current_syntax
ef454a7f485d Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
94 syntax cluster lhsTeXContainer contains=markdown.*
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1668
diff changeset
95 else
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1668
diff changeset
96 syntax cluster lhsTeXContainer contains=.*
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99 " Literate Haskell is Haskell in between text, so at least read Haskell
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100 " highlighting
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 2152
diff changeset
101 syntax include @haskellTop syntax/haskell.vim
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
102
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1668
diff changeset
103 syntax region lhsHaskellBirdTrack start="^>" end="\%(^[^>]\)\@=" contains=@haskellTop,lhsBirdTrack containedin=@lhsTeXContainer
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 2034
diff changeset
104 syntax region lhsHaskellBeginEndBlock start="^\\begin{code}\s*$" matchgroup=NONE end="\%(^\\end{code}.*$\)\@=" contains=@haskellTop,beginCodeBegin containedin=@lhsTeXContainer
24024
ef454a7f485d Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
105 syntax region lhsHaskellMDBlock start="^```haskell$" matchgroup=NONE end="^```$" keepend contains=@haskellTop,lhsMarkdownCode containedin=@lhsTeXContainer
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107 syntax match lhsBirdTrack "^>" contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108
24024
ef454a7f485d Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
109 syntax match lhsMarkdownCode "^\(```haskell\|^```\)$" contained
ef454a7f485d Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
110
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
111 syntax match beginCodeBegin "^\\begin" nextgroup=beginCodeCode contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
112 syntax region beginCodeCode matchgroup=texDelimiter start="{" end="}"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
113
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
114 " Define the default highlighting.
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 2152
diff changeset
115 " Only when an item doesn't have highlighting yet
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 2152
diff changeset
116
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
117 hi def link lhsBirdTrack Comment
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
118
24024
ef454a7f485d Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
119 hi def link lhsMarkdownCode Comment
ef454a7f485d Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
120
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
121 hi def link beginCodeBegin texCmdName
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
122 hi def link beginCodeCode texSection
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
123
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
124
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
125 " Restore cursor to original position, as it may have been disturbed
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
126 " by the searches in our guessing code
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
127 call cursor (s:oldline, s:oldcolumn)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
128
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
129 unlet s:oldline
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
130 unlet s:oldcolumn
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
131
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
132 let b:current_syntax = "lhaskell"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
133
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
134 " vim: ts=8