Mercurial > vim
annotate runtime/syntax/z8a.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: Z80 assembler asz80 | |
3 " Maintainer: Milan Pikula <www@fornax.elf.stuba.sk> | |
4 " Last Change: 2003 May 11 | |
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 | |
11 syn case ignore | |
12 | |
13 " Common Z80 Assembly instructions | |
14 syn keyword z8aInstruction adc add and bit ccf cp cpd cpdr cpi cpir cpl | |
15 syn keyword z8aInstruction daa di djnz ei exx halt im in | |
16 syn keyword z8aInstruction ind ini indr inir jp jr ld ldd lddr ldi ldir | |
17 syn keyword z8aInstruction neg nop or otdr otir out outd outi | |
18 syn keyword z8aInstruction res rl rla rlc rlca rld | |
19 syn keyword z8aInstruction rr rra rrc rrca rrd sbc scf set sla sra | |
20 syn keyword z8aInstruction srl sub xor | |
21 " syn keyword z8aInstruction push pop call ret reti retn inc dec ex rst | |
22 | |
23 " Any other stuff | |
24 syn match z8aIdentifier "[a-z_][a-z0-9_]*" | |
25 | |
26 " Instructions changing stack | |
27 syn keyword z8aSpecInst push pop call ret reti retn rst | |
28 syn match z8aInstruction "\<inc\>" | |
29 syn match z8aInstruction "\<dec\>" | |
30 syn match z8aInstruction "\<ex\>" | |
31 syn match z8aSpecInst "\<inc\s\+sp\>"me=s+3 | |
32 syn match z8aSpecInst "\<dec\s\+sp\>"me=s+3 | |
33 syn match z8aSpecInst "\<ex\s\+(\s*sp\s*)\s*,\s*hl\>"me=s+2 | |
34 | |
35 "Labels | |
36 syn match z8aLabel "[a-z_][a-z0-9_]*:" | |
37 syn match z8aSpecialLabel "[a-z_][a-z0-9_]*::" | |
38 | |
39 " PreProcessor commands | |
40 syn match z8aPreProc "\.org" | |
41 syn match z8aPreProc "\.globl" | |
42 syn match z8aPreProc "\.db" | |
43 syn match z8aPreProc "\.dw" | |
44 syn match z8aPreProc "\.ds" | |
45 syn match z8aPreProc "\.byte" | |
46 syn match z8aPreProc "\.word" | |
47 syn match z8aPreProc "\.blkb" | |
48 syn match z8aPreProc "\.blkw" | |
49 syn match z8aPreProc "\.ascii" | |
50 syn match z8aPreProc "\.asciz" | |
51 syn match z8aPreProc "\.module" | |
52 syn match z8aPreProc "\.title" | |
53 syn match z8aPreProc "\.sbttl" | |
54 syn match z8aPreProc "\.even" | |
55 syn match z8aPreProc "\.odd" | |
56 syn match z8aPreProc "\.area" | |
57 syn match z8aPreProc "\.page" | |
58 syn match z8aPreProc "\.setdp" | |
59 syn match z8aPreProc "\.radix" | |
60 syn match z8aInclude "\.include" | |
61 syn match z8aPreCondit "\.if" | |
62 syn match z8aPreCondit "\.else" | |
63 syn match z8aPreCondit "\.endif" | |
64 | |
65 " Common strings | |
66 syn match z8aString "\".*\"" | |
67 syn match z8aString "\'.*\'" | |
68 | |
69 " Numbers | |
70 syn match z8aNumber "[0-9]\+" | |
71 syn match z8aNumber "0[xXhH][0-9a-fA-F]\+" | |
72 syn match z8aNumber "0[bB][0-1]*" | |
73 syn match z8aNumber "0[oO\@qQ][0-7]\+" | |
74 syn match z8aNumber "0[dD][0-9]\+" | |
75 | |
76 " Character constant | |
77 syn match z8aString "\#\'."hs=s+1 | |
78 | |
79 " Comments | |
80 syn match z8aComment ";.*" | |
81 | |
82 syn case match | |
83 | |
84 " Define the default highlighting. | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
7
diff
changeset
|
85 " Only when an item doesn't have highlighting yet |
7 | 86 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
87 hi def link z8aSection Special |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
88 hi def link z8aLabel Label |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
89 hi def link z8aSpecialLabel Label |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
90 hi def link z8aComment Comment |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
91 hi def link z8aInstruction Statement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
92 hi def link z8aSpecInst Statement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
93 hi def link z8aInclude Include |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
94 hi def link z8aPreCondit PreCondit |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
95 hi def link z8aPreProc PreProc |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
96 hi def link z8aNumber Number |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
97 hi def link z8aString String |
7 | 98 |
99 | |
100 let b:current_syntax = "z8a" | |
101 " vim: ts=8 |