annotate runtime/syntax/mason.vim @ 30799:ffa5492137c3 v9.0.0734

patch 9.0.0734: cursor position invalid when scrolling with 'smoothscroll' Commit: https://github.com/vim/vim/commit/2fbabd238a94022c99506e920186a5b6cdf15426 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Oct 12 19:53:38 2022 +0100 patch 9.0.0734: cursor position invalid when scrolling with 'smoothscroll' Problem: Cursor position invalid when scrolling with 'smoothscroll' set. (Ernie Rael) Solution: Add w_valid_skipcol and clear flags when it changes. Adjust w_skipcol after moving the cursor.
author Bram Moolenaar <Bram@vim.org>
date Wed, 12 Oct 2022 21:00:05 +0200
parents d1fe80fb35e6
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
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
2 " Language: Mason (Perl embedded in HTML)
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
3 " Maintainer: vim-perl <vim-perl@googlegroups.com>
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
4 " Homepage: https://github.com/vim-perl/vim-perl
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
5 " Bugs/requests: https://github.com/vim-perl/vim-perl/issues
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
6 " License: Vim License (see :help license)
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
7 " Last Change: 2021 Oct 10
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
8 " Contributors: Hinrik Örn Sigurðsson <hinrik.sig@gmail.com>
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
9 " Andrew Smith <andrewdsmith@yahoo.com>
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 "
12499
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
11 " TODO:
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 " - Fix <%text> blocks to show HTML tags but ignore Mason tags.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 7
diff changeset
15 " quit when a syntax file was already loaded
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 7
diff changeset
16 if exists("b:current_syntax")
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 " The HTML syntax file included below uses this variable.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 if !exists("main_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 let main_syntax = 'mason'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 " First pull in the HTML syntax.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 "
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 7
diff changeset
28 runtime! syntax/html.vim
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 7
diff changeset
29 unlet b:current_syntax
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 syn cluster htmlPreproc add=@masonTop
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 " Now pull in the Perl syntax.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 "
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 7
diff changeset
35 syn include @perlTop syntax/perl.vim
12499
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
36 unlet b:current_syntax
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
37 syn include @podTop syntax/pod.vim
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 " It's hard to reduce down to the correct sub-set of Perl to highlight in some
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 " of these cases so I've taken the safe option of just using perlTop in all of
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 " them. If you have any suggestions, please let me know.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 "
12499
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
43 syn region masonPod start="^=[a-z]" end="^=cut" keepend contained contains=@podTop
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
44 syn cluster perlTop remove=perlBraces
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
45 syn region masonLine matchgroup=Delimiter start="^%" end="$" keepend contains=@perlTop
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
46 syn region masonPerlComment start="#" end="\%(%>\)\@=\|$" contained contains=perlTodo,@Spell
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
47 syn region masonExpr matchgroup=Delimiter start="<%" end="%>" contains=@perlTop,masonPerlComment
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
48 syn region masonPerl matchgroup=Delimiter start="<%perl>" end="</%perl>" contains=masonPod,@perlTop
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
49 syn region masonComp keepend matchgroup=Delimiter start="<&\s*\%([-._/[:alnum:]]\+:\)\?[-._/[:alnum:]]*" end="&>" contains=@perlTop
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
50 syn region masonComp keepend matchgroup=Delimiter skipnl start="<&|\s*\%([-._/[:alnum:]]\+:\)\?[-._/[:alnum:]]*" end="&>" contains=@perlTop nextgroup=masonCompContent
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
51 syn region masonCompContent matchgroup=Delimiter start="" end="</&>" contained contains=@masonTop
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52
12499
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
53 syn region masonArgs matchgroup=Delimiter start="<%args>" end="</%args>" contains=masonPod,@perlTop
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54
12499
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
55 syn region masonInit matchgroup=Delimiter start="<%init>" end="</%init>" contains=masonPod,@perlTop
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
56 syn region masonCleanup matchgroup=Delimiter start="<%cleanup>" end="</%cleanup>" contains=masonPod,@perlTop
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
57 syn region masonOnce matchgroup=Delimiter start="<%once>" end="</%once>" contains=masonPod,@perlTop
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
58 syn region masonClass matchgroup=Delimiter start="<%class>" end="</%class>" contains=masonPod,@perlTop
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
59 syn region masonShared matchgroup=Delimiter start="<%shared>" end="</%shared>" contains=masonPod,@perlTop
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60
12499
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
61 syn region masonDef matchgroup=Delimiter start="<%def\s*[-._/[:alnum:]]\+\s*>" end="</%def>" contains=@htmlTop
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
62 syn region masonMethod matchgroup=Delimiter start="<%method\s*[-._/[:alnum:]]\+\s*>" end="</%method>" contains=@htmlTop
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63
12499
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
64 syn region masonFlags matchgroup=Delimiter start="<%flags>" end="</%flags>" contains=masonPod,@perlTop
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
65 syn region masonAttr matchgroup=Delimiter start="<%attr>" end="</%attr>" contains=masonPod,@perlTop
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66
12499
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
67 syn region masonFilter matchgroup=Delimiter start="<%filter>" end="</%filter>" contains=masonPod,@perlTop
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 syn region masonDoc matchgroup=Delimiter start="<%doc>" end="</%doc>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 syn region masonText matchgroup=Delimiter start="<%text>" end="</%text>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 syn cluster masonTop contains=masonLine,masonExpr,masonPerl,masonComp,masonArgs,masonInit,masonCleanup,masonOnce,masonShared,masonDef,masonMethod,masonFlags,masonAttr,masonFilter,masonDoc,masonText
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 " Set up default highlighting. Almost all of this is done in the included
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 " syntax files.
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 7
diff changeset
76 hi def link masonDoc Comment
12499
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
77 hi def link masonPod Comment
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
78 hi def link podOrdinary masonPod
12499
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
79 hi def link masonPerlComment perlComment
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 let b:current_syntax = "mason"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 if main_syntax == 'mason'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 unlet main_syntax
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 endif