Mercurial > vim
annotate runtime/syntax/sm.vim @ 34665:ca2da8e8fb53 v9.1.0215
patch 9.1.0215: Half-page scrolling does not support smooth-scrolling
Commit: https://github.com/vim/vim/commit/5a2e3ec9ac72b6e644fea4ebba7e632498296e2f
Author: Luuk van Baal <luukvbaal@gmail.com>
Date: Thu Mar 28 10:07:29 2024 +0100
patch 9.1.0215: Half-page scrolling does not support smooth-scrolling
Problem: Page-wise scrolling with Ctrl-D/Ctrl-U implements
it's own logic to change the topline and cursor.
More logic than necessary for scrolling with Ctrl-F/Ctrl-B
was removed in patch 9.1.0211.
Solution: Re-use the logic from Ctrl-E/Ctrl-Y/Ctrl-F/Ctrl-B while
staying backward compatible as much as possible.
Restore some of the logic that determined how many lines will
be scrolled (Luuk van Baal)
closes: #14316
Signed-off-by: Luuk van Baal <luukvbaal@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 28 Mar 2024 10:15:08 +0100 |
parents | 02bd0fe77c68 |
children |
rev | line source |
---|---|
7 | 1 " Vim syntax file |
2 " Language: sendmail | |
34375
02bd0fe77c68
runtime(misc): announce adoption of various runtime files
Christian Brabandt <cb@256bit.org>
parents:
19180
diff
changeset
|
3 " Maintainer: This runtime file is looking for a new maintainer. |
02bd0fe77c68
runtime(misc): announce adoption of various runtime files
Christian Brabandt <cb@256bit.org>
parents:
19180
diff
changeset
|
4 " Former Maintainer: Charles E. Campbell |
10306
d75e2380db0e
commit https://github.com/vim/vim/commit/6d5ad4c4118cab5fd96db157621c3aa9af368edb
Christian Brabandt <cb@256bit.org>
parents:
10051
diff
changeset
|
5 " Last Change: Oct 25, 2016 |
34375
02bd0fe77c68
runtime(misc): announce adoption of various runtime files
Christian Brabandt <cb@256bit.org>
parents:
19180
diff
changeset
|
6 " 2024 Feb 19 by Vim Project (announce adoption) |
19180 | 7 " Version: 9 |
34375
02bd0fe77c68
runtime(misc): announce adoption of various runtime files
Christian Brabandt <cb@256bit.org>
parents:
19180
diff
changeset
|
8 " Former URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SM |
6484 | 9 if exists("b:current_syntax") |
7 | 10 finish |
11 endif | |
12 | |
13 " Comments | |
14 syn match smComment "^#.*$" contains=@Spell | |
15 | |
16 " Definitions, Classes, Files, Options, Precedence, Trusted Users, Mailers | |
17 syn match smDefine "^[CDF]." | |
18 syn match smDefine "^O[AaBcdDeFfgHiLmNoQqrSsTtuvxXyYzZ]" | |
19 syn match smDefine "^O\s"he=e-1 | |
20 syn match smDefine "^M[a-zA-Z0-9]\+,"he=e-1 | |
21 syn match smDefine "^T" nextgroup=smTrusted | |
22 syn match smDefine "^P" nextgroup=smMesg | |
23 syn match smTrusted "\S\+$" contained | |
24 syn match smMesg "\S*="he=e-1 contained nextgroup=smPrecedence | |
25 syn match smPrecedence "-\=[0-9]\+" contained | |
26 | |
27 " Header Format H?list-of-mailer-flags?name: format | |
28 syn match smHeaderSep contained "[?:]" | |
29 syn match smHeader "^H\(?[a-zA-Z]\+?\)\=[-a-zA-Z_]\+:" contains=smHeaderSep | |
30 | |
31 " Variables | |
32 syn match smVar "\$[a-z\.\|]" | |
33 | |
34 " Rulesets | |
35 syn match smRuleset "^S\d*" | |
36 | |
37 " Rewriting Rules | |
38 syn match smRewrite "^R" skipwhite nextgroup=smRewriteLhsToken,smRewriteLhsUser | |
39 | |
40 syn match smRewriteLhsUser contained "[^\t$]\+" skipwhite nextgroup=smRewriteLhsToken,smRewriteLhsSep | |
41 syn match smRewriteLhsToken contained "\(\$[-*+]\|\$[-=][A-Za-z]\|\$Y\)\+" skipwhite nextgroup=smRewriteLhsUser,smRewriteLhsSep | |
42 | |
43 syn match smRewriteLhsSep contained "\t\+" skipwhite nextgroup=smRewriteRhsToken,smRewriteRhsUser | |
44 | |
45 syn match smRewriteRhsUser contained "[^\t$]\+" skipwhite nextgroup=smRewriteRhsToken,smRewriteRhsSep | |
46 syn match smRewriteRhsToken contained "\(\$\d\|\$>\d\|\$#\|\$@\|\$:[-_a-zA-Z]\+\|\$[[\]]\|\$@\|\$:\|\$[A-Za-z]\)\+" skipwhite nextgroup=smRewriteRhsUser,smRewriteRhsSep | |
47 | |
48 syn match smRewriteRhsSep contained "\t\+" skipwhite nextgroup=smRewriteComment,smRewriteRhsSep | |
49 syn match smRewriteRhsSep contained "$" | |
50 | |
51 syn match smRewriteComment contained "[^\t$]*$" | |
52 | |
53 " Clauses | |
54 syn match smClauseError "\$\." | |
55 syn match smElse contained "\$|" | |
56 syn match smClauseCont contained "^\t" | |
57 syn region smClause matchgroup=Delimiter start="\$?." matchgroup=Delimiter end="\$\." contains=smElse,smClause,smVar,smClauseCont | |
58 | |
59 " Define the default highlighting. | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
6744
diff
changeset
|
60 " Only when an item doesn't have highlighting yet |
7 | 61 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
62 hi def link smClause Special |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
63 hi def link smClauseError Error |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
64 hi def link smComment Comment |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
65 hi def link smDefine Statement |
10306
d75e2380db0e
commit https://github.com/vim/vim/commit/6d5ad4c4118cab5fd96db157621c3aa9af368edb
Christian Brabandt <cb@256bit.org>
parents:
10051
diff
changeset
|
66 hi def link smElse Delimiter |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
67 hi def link smHeader Statement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
68 hi def link smHeaderSep String |
10306
d75e2380db0e
commit https://github.com/vim/vim/commit/6d5ad4c4118cab5fd96db157621c3aa9af368edb
Christian Brabandt <cb@256bit.org>
parents:
10051
diff
changeset
|
69 hi def link smMesg Special |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
70 hi def link smPrecedence Number |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
71 hi def link smRewrite Statement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
72 hi def link smRewriteComment Comment |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
73 hi def link smRewriteLhsToken String |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
74 hi def link smRewriteLhsUser Statement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
75 hi def link smRewriteRhsToken String |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
76 hi def link smRuleset Preproc |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
77 hi def link smTrusted Special |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
78 hi def link smVar String |
7 | 79 |
80 let b:current_syntax = "sm" | |
81 | |
82 " vim: ts=18 |