Mercurial > vim
annotate runtime/syntax/omnimark.vim @ 33872:2c5ae1ce5af2 v9.0.2146
patch 9.0.2146: text-property without type errors when joining
Commit: https://github.com/vim/vim/commit/0d0b3b19517c321b089d637919e88e49a07a3d85
Author: Christian Brabandt <cb@256bit.org>
Date: Sun Dec 3 17:56:43 2023 +0100
patch 9.0.2146: text-property without type errors when joining
Problem: text-property without type errors when joining
Solution: count all text-properties, with or without type
before joining lines
Error when joining lines with text properties without a proper type
When joining lines, we need to consider all text properties that are
attached to a line, even when those text properties are invalid and do
not have a type attached to them.
However, since patch v9.0.0993
(commit: 89469d157aea01513bde826b4519dd6b5fbceae4)
those text properties won't be counted when joining lines and therefore
this will cause the adjustment for text properties on joining to go
wrong (and may later cause SIGABRT with an invalid free pointer)
I am not sure, why the condition to not count text properties with a
valid type was added in patch v9.0.993, because no test fails if those
condition is removed. So let's just remove this condition and add a test
that verifies, that we are able to join lines, even when the text
properties attached to it do not have a valid type.
fixes: #13609
closes: #13614
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 10 Dec 2023 15:16:11 +0100 |
parents | 46763b01cd9a |
children |
rev | line source |
---|---|
7 | 1 " Vim syntax file |
2 " Language: Omnimark | |
3 " Maintainer: Paul Terray <mailto:terray@4dconcept.fr> | |
4 " Last Change: 11 Oct 2000 | |
5 | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
7
diff
changeset
|
6 " 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
|
7 if exists("b:current_syntax") |
7 | 8 finish |
9 endif | |
10 | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
7
diff
changeset
|
11 setlocal iskeyword=@,48-57,_,128-167,224-235,- |
7 | 12 |
13 syn keyword omnimarkKeywords ACTIVATE AGAIN | |
14 syn keyword omnimarkKeywords CATCH CLEAR CLOSE COPY COPY-CLEAR CROSS-TRANSLATE | |
15 syn keyword omnimarkKeywords DEACTIVATE DECLARE DECREMENT DEFINE DISCARD DIVIDE DO DOCUMENT-END DOCUMENT-START DONE DTD-START | |
16 syn keyword omnimarkKeywords ELEMENT ELSE ESCAPE EXIT | |
17 syn keyword omnimarkKeywords FAIL FIND FIND-END FIND-START FORMAT | |
18 syn keyword omnimarkKeywords GROUP | |
19 syn keyword omnimarkKeywords HALT HALT-EVERYTHING | |
20 syn keyword omnimarkKeywords IGNORE IMPLIED INCLUDE INCLUDE-END INCLUDE-START INCREMENT INPUT | |
21 syn keyword omnimarkKeywords JOIN | |
22 syn keyword omnimarkKeywords LINE-END LINE-START LOG LOOKAHEAD | |
23 syn keyword omnimarkKeywords MACRO | |
24 syn keyword omnimarkKeywords MACRO-END MARKED-SECTION MARKUP-COMMENT MARKUP-ERROR MARKUP-PARSER MASK MATCH MINUS MODULO | |
25 syn keyword omnimarkKeywords NEW NEWLINE NEXT | |
26 syn keyword omnimarkKeywords OPEN OUTPUT OUTPUT-TO OVER | |
27 syn keyword omnimarkKeywords PROCESS PROCESS-END PROCESS-START PROCESSING-INSTRUCTION PROLOG-END PROLOG-IN-ERROR PUT | |
28 syn keyword omnimarkKeywords REMOVE REOPEN REPEAT RESET RETHROW RETURN | |
29 syn keyword omnimarkKeywords WHEN WHITE-SPACE | |
30 syn keyword omnimarkKeywords SAVE SAVE-CLEAR SCAN SELECT SET SGML SGML-COMMENT SGML-DECLARATION-END SGML-DTD SGML-DTDS SGML-ERROR SGML-IN SGML-OUT SGML-PARSE SGML-PARSER SHIFT SUBMIT SUCCEED SUPPRESS | |
31 syn keyword omnimarkKeywords SYSTEM-CALL | |
32 syn keyword omnimarkKeywords TEST-SYSTEM THROW TO TRANSLATE | |
33 syn keyword omnimarkKeywords UC UL UNLESS UP-TRANSLATE | |
34 syn keyword omnimarkKeywords XML-PARSE | |
35 | |
36 syn keyword omnimarkCommands ACTIVE AFTER ANCESTOR AND ANOTHER ARG AS ATTACHED ATTRIBUTE ATTRIBUTES | |
37 syn keyword omnimarkCommands BASE BEFORE BINARY BINARY-INPUT BINARY-MODE BINARY-OUTPUT BREAK-WIDTH BUFFER BY | |
38 syn keyword omnimarkCommands CASE CHILDREN CLOSED COMPILED-DATE COMPLEMENT CONREF CONTENT CONTEXT-TRANSLATE COUNTER CREATED CREATING CREATOR CURRENT | |
39 syn keyword omnimarkCommands DATA-ATTRIBUTE DATA-ATTRIBUTES DATA-CONTENT DATA-LETTERS DATE DECLARED-CONREF DECLARED-CURRENT DECLARED-DEFAULTED DECLARED-FIXED DECLARED-IMPLIED DECLARED-REQUIRED | |
40 syn keyword omnimarkCommands DEFAULT-ENTITY DEFAULTED DEFAULTING DELIMITER DIFFERENCE DIRECTORY DOCTYPE DOCUMENT DOCUMENT-ELEMENT DOMAIN-FREE DOWN-TRANSLATE DTD DTD-END DTDS | |
41 syn keyword omnimarkCommands ELEMENTS ELSEWHERE EMPTY ENTITIES ENTITY EPILOG-START EQUAL EXCEPT EXISTS EXTERNAL EXTERNAL-DATA-ENTITY EXTERNAL-ENTITY EXTERNAL-FUNCTION EXTERNAL-OUTPUT-FUNCTION | |
42 syn keyword omnimarkCommands EXTERNAL-TEXT-ENTITY | |
43 syn keyword omnimarkCommands FALSE FILE FUNCTION FUNCTION-LIBRARY | |
44 syn keyword omnimarkCommands GENERAL GLOBAL GREATER-EQUAL GREATER-THAN GROUPS | |
45 syn keyword omnimarkCommands HAS HASNT HERALDED-NAMES | |
46 syn keyword omnimarkCommands ID ID-CHECKING IDREF IDREFS IN IN-LIBRARY INCLUSION INITIAL INITIAL-SIZE INSERTION-BREAK INSTANCE INTERNAL INVALID-DATA IS ISNT ITEM | |
47 syn keyword omnimarkCommands KEY KEYED | |
48 syn keyword omnimarkCommands LAST LASTMOST LC LENGTH LESS-EQUAL LESS-THAN LETTERS LIBRARY LITERAL LOCAL | |
49 syn keyword omnimarkCommands MATCHES MIXED MODIFIABLE | |
50 syn keyword omnimarkCommands NAME NAME-LETTERS NAMECASE NAMED NAMES NDATA-ENTITY NEGATE NESTED-REFERENTS NMTOKEN NMTOKENS NO NO-DEFAULT-IO NON-CDATA NON-IMPLIED NON-SDATA NOT NOTATION NUMBER-OF NUMBERS | |
51 syn keyword omnimarkCommands NUTOKEN NUTOKENS | |
52 syn keyword omnimarkCommands OCCURRENCE OF OPAQUE OPTIONAL OR | |
53 syn keyword omnimarkCommands PARAMETER PARENT PAST PATTERN PLUS PREPARENT PREVIOUS PROPER PUBLIC | |
54 syn keyword omnimarkCommands READ-ONLY READABLE REFERENT REFERENTS REFERENTS-ALLOWED REFERENTS-DISPLAYED REFERENTS-NOT-ALLOWED REMAINDER REPEATED REPLACEMENT-BREAK REVERSED | |
55 syn keyword omnimarkCommands SILENT-REFERENT SIZE SKIP SOURCE SPECIFIED STATUS STREAM SUBDOC-ENTITY SUBDOCUMENT SUBDOCUMENTS SUBELEMENT SWITCH SYMBOL SYSTEM | |
56 syn keyword omnimarkCommands TEXT-MODE THIS TIMES TOKEN TRUE | |
57 syn keyword omnimarkCommands UNANCHORED UNATTACHED UNION USEMAP USING | |
58 syn keyword omnimarkCommands VALUE VALUED VARIABLE | |
59 syn keyword omnimarkCommands WITH WRITABLE | |
60 syn keyword omnimarkCommands XML XML-DTD XML-DTDS | |
61 syn keyword omnimarkCommands YES | |
62 syn keyword omnimarkCommands #ADDITIONAL-INFO #APPINFO #CAPACITY #CHARSET #CLASS #COMMAND-LINE-NAMES #CONSOLE #CURRENT-INPUT #CURRENT-OUTPUT #DATA #DOCTYPE #DOCUMENT #DTD #EMPTY #ERROR #ERROR-CODE | |
63 syn keyword omnimarkCommands #FILE-NAME #FIRST #GROUP #IMPLIED #ITEM #LANGUAGE-VERSION #LAST #LIBPATH #LIBRARY #LIBVALUE #LINE-NUMBER #MAIN-INPUT #MAIN-OUTPUT #MARKUP-ERROR-COUNT #MARKUP-ERROR-TOTAL | |
64 syn keyword omnimarkCommands #MARKUP-PARSER #MARKUP-WARNING-COUNT #MARKUP-WARNING-TOTAL #MESSAGE #NONE #OUTPUT #PLATFORM-INFO #PROCESS-INPUT #PROCESS-OUTPUT #RECOVERY-INFO #SGML #SGML-ERROR-COUNT | |
65 syn keyword omnimarkCommands #SGML-ERROR-TOTAL #SGML-WARNING-COUNT #SGML-WARNING-TOTAL #SUPPRESS #SYNTAX #! | |
66 | |
67 syn keyword omnimarkPatterns ANY ANY-TEXT | |
68 syn keyword omnimarkPatterns BLANK | |
69 syn keyword omnimarkPatterns CDATA CDATA-ENTITY CONTENT-END CONTENT-START | |
70 syn keyword omnimarkPatterns DIGIT | |
71 syn keyword omnimarkPatterns LETTER | |
72 syn keyword omnimarkPatterns NUMBER | |
73 syn keyword omnimarkPatterns PCDATA | |
74 syn keyword omnimarkPatterns RCDATA | |
75 syn keyword omnimarkPatterns SDATA SDATA-ENTITY SPACE | |
76 syn keyword omnimarkPatterns TEXT | |
77 syn keyword omnimarkPatterns VALUE-END VALUE-START | |
78 syn keyword omnimarkPatterns WORD-END WORD-START | |
79 | |
80 syn region omnimarkComment start=";" end="$" | |
81 | |
82 " strings | |
83 syn region omnimarkString matchgroup=Normal start=+'+ end=+'+ skip=+%'+ contains=omnimarkEscape | |
84 syn region omnimarkString matchgroup=Normal start=+"+ end=+"+ skip=+%"+ contains=omnimarkEscape | |
85 syn match omnimarkEscape contained +%.+ | |
86 syn match omnimarkEscape contained +%[0-9][0-9]#+ | |
87 | |
88 "syn sync maxlines=100 | |
89 syn sync minlines=2000 | |
90 | |
91 " Define the default highlighting. | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
7
diff
changeset
|
92 " Only when an item doesn't have highlighting yet |
7 | 93 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
94 hi def link omnimarkCommands Statement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
95 hi def link omnimarkKeywords Identifier |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
96 hi def link omnimarkString String |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
97 hi def link omnimarkPatterns Macro |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
98 " hi def link omnimarkNumber Number |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
99 hi def link omnimarkComment Comment |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
100 hi def link omnimarkEscape Special |
7 | 101 |
102 | |
103 let b:current_syntax = "omnimark" | |
104 | |
105 " vim: ts=8 | |
106 |