Mercurial > vim
annotate runtime/syntax/sgmllnx.vim @ 30487:79e2d9b7780c v9.0.0579
patch 9.0.0579: using freed memory when 'tagfunc' wipes out buffer
Commit: https://github.com/vim/vim/commit/0ff01835a40f549c5c4a550502f62a2ac9ac447c
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Sep 24 19:20:30 2022 +0100
patch 9.0.0579: using freed memory when 'tagfunc' wipes out buffer
Problem: Using freed memory when 'tagfunc' wipes out buffer that holds
'complete'.
Solution: Make a copy of the option. Make sure cursor position is valid.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 24 Sep 2022 20:30:03 +0200 |
parents | 46763b01cd9a |
children |
rev | line source |
---|---|
7 | 1 " Vim syntax file |
2 " Language: SGML-linuxdoc (supported by old sgmltools-1.x) | |
2034 | 3 " Maintainer: SungHyun Nam <goweol@gmail.com> |
4437 | 4 " Last Change: 2013 May 13 |
7 | 5 |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
4437
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:
4437
diff
changeset
|
7 if exists("b:current_syntax") |
7 | 8 finish |
9 endif | |
10 | |
11 syn case ignore | |
12 | |
13 " tags | |
14 syn region sgmllnxEndTag start=+</+ end=+>+ contains=sgmllnxTagN,sgmllnxTagError | |
15 syn region sgmllnxTag start=+<[^/]+ end=+>+ contains=sgmllnxTagN,sgmllnxTagError | |
16 syn match sgmllnxTagN contained +<\s*[-a-zA-Z0-9]\++ms=s+1 contains=sgmllnxTagName | |
17 syn match sgmllnxTagN contained +</\s*[-a-zA-Z0-9]\++ms=s+2 contains=sgmllnxTagName | |
18 | |
19 syn region sgmllnxTag2 start=+<\s*[a-zA-Z]\+/+ keepend end=+/+ contains=sgmllnxTagN2 | |
20 syn match sgmllnxTagN2 contained +/.*/+ms=s+1,me=e-1 | |
21 | |
22 syn region sgmllnxSpecial oneline start="&" end=";" | |
23 | |
24 " tag names | |
25 syn keyword sgmllnxTagName contained article author date toc title sect verb | |
26 syn keyword sgmllnxTagName contained abstract tscreen p itemize item enum | |
27 syn keyword sgmllnxTagName contained descrip quote htmlurl code ref | |
4437 | 28 syn keyword sgmllnxTagName contained tt tag bf it url |
7 | 29 syn match sgmllnxTagName contained "sect\d\+" |
30 | |
31 " Comments | |
32 syn region sgmllnxComment start=+<!--+ end=+-->+ | |
33 syn region sgmllnxDocType start=+<!doctype+ end=+>+ | |
34 | |
35 " Define the default highlighting. | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
4437
diff
changeset
|
36 " Only when an item doesn't have highlighting yet |
7 | 37 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
38 hi def link sgmllnxTag2 Function |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
39 hi def link sgmllnxTagN2 Function |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
40 hi def link sgmllnxTag Special |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
41 hi def link sgmllnxEndTag Special |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
42 hi def link sgmllnxParen Special |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
43 hi def link sgmllnxEntity Type |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
44 hi def link sgmllnxDocEnt Type |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
45 hi def link sgmllnxTagName Statement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
46 hi def link sgmllnxComment Comment |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
47 hi def link sgmllnxSpecial Special |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
48 hi def link sgmllnxDocType PreProc |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
49 hi def link sgmllnxTagError Error |
7 | 50 |
51 | |
52 let b:current_syntax = "sgmllnx" | |
53 | |
54 " vim:set tw=78 ts=8 sts=2 sw=2 noet: |