Mercurial > vim
annotate runtime/syntax/valgrind.vim @ 10688:3d1872fbecc4 v8.0.0234
patch 8.0.0234: crash when using put in Visual mode
commit https://github.com/vim/vim/commit/941c12da3c087fd04aa6c120a76bf28f19349d96
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Jan 24 19:55:43 2017 +0100
patch 8.0.0234: crash when using put in Visual mode
Problem: When several lines are visually selected and one of them is short,
using put may cause a crash. (Axel Bender)
Solution: Check for a short line. (Christian Brabandt)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 24 Jan 2017 20:00:04 +0100 |
parents | b0a227941705 |
children | 2704c4e3e20a |
rev | line source |
---|---|
7 | 1 " Vim syntax file |
2 " Language: Valgrind Memory Debugger Output | |
3 " Maintainer: Roger Luethi <rl@hellgate.ch> | |
4 " Program URL: http://devel-home.kde.org/~sewardj/ | |
6583 | 5 " Last Change: 2015 Jan 27 |
6 " Included improvement by Dominique Pelle | |
7 | 7 " |
8 " Notes: mostly based on strace.vim and xml.vim | |
6259 | 9 " |
10 " Contributors: Christoph Gysin <christoph.gysin@gmail.com> | |
7 | 11 |
12 " Quit when a syntax file was already loaded | |
13 if exists("b:current_syntax") | |
14 finish | |
15 endif | |
3496
d1e4abe8342c
Fixed compatible mode in most runtime files.
Bram Moolenaar <bram@vim.org>
parents:
7
diff
changeset
|
16 let s:keepcpo= &cpo |
d1e4abe8342c
Fixed compatible mode in most runtime files.
Bram Moolenaar <bram@vim.org>
parents:
7
diff
changeset
|
17 set cpo&vim |
7 | 18 |
6583 | 19 " Lines can be long with demangled c++ functions. |
20 setlocal synmaxcol=8000 | |
21 | |
7 | 22 syn case match |
23 syn sync minlines=50 | |
24 | |
25 syn match valgrindSpecLine "^[+-]\{2}\d\+[+-]\{2}.*$" | |
26 | |
27 syn region valgrindRegion | |
28 \ start=+^==\z(\d\+\)== \w.*$+ | |
29 \ skip=+^==\z1==\( \| .*\)$+ | |
30 \ end=+^+ | |
31 \ fold | |
32 \ keepend | |
33 \ contains=valgrindPidChunk,valgrindLine | |
34 | |
35 syn region valgrindPidChunk | |
6583 | 36 \ start=+^==\zs+ |
37 \ end=+\ze==+ | |
7 | 38 \ contained |
39 \ contains=valgrindPid0,valgrindPid1,valgrindPid2,valgrindPid3,valgrindPid4,valgrindPid5,valgrindPid6,valgrindPid7,valgrindPid8,valgrindPid9 | |
40 \ keepend | |
41 | |
42 syn match valgrindPid0 "\d\+0=" contained | |
43 syn match valgrindPid1 "\d\+1=" contained | |
44 syn match valgrindPid2 "\d\+2=" contained | |
45 syn match valgrindPid3 "\d\+3=" contained | |
46 syn match valgrindPid4 "\d\+4=" contained | |
47 syn match valgrindPid5 "\d\+5=" contained | |
48 syn match valgrindPid6 "\d\+6=" contained | |
49 syn match valgrindPid7 "\d\+7=" contained | |
50 syn match valgrindPid8 "\d\+8=" contained | |
51 syn match valgrindPid9 "\d\+9=" contained | |
52 | |
53 syn region valgrindLine | |
54 \ start=+\(^==\d\+== \)\@<=+ | |
55 \ end=+$+ | |
56 \ keepend | |
57 \ contained | |
58 \ contains=valgrindOptions,valgrindMsg,valgrindLoc | |
59 | |
60 syn match valgrindOptions "[ ]\{3}-.*$" contained | |
61 | |
62 syn match valgrindMsg "\S.*$" contained | |
63 \ contains=valgrindError,valgrindNote,valgrindSummary | |
64 syn match valgrindError "\(Invalid\|\d\+ errors\|.* definitely lost\).*$" contained | |
65 syn match valgrindNote ".*still reachable.*" contained | |
66 syn match valgrindSummary ".*SUMMARY:" contained | |
67 | |
68 syn match valgrindLoc "\s\+\(by\|at\|Address\).*$" contained | |
69 \ contains=valgrindAt,valgrindAddr,valgrindFunc,valgrindBin,valgrindSrc | |
70 syn match valgrindAt "at\s\@=" contained | |
6583 | 71 syn match valgrindAddr "\W\zs0x\x\+" contained |
72 | |
73 syn match valgrindFunc ": \zs\h[a-zA-Z0-9_:\[\]()<>&*+\-,=%!|^ ]*\ze([^)]*)$" contained | |
74 syn match valgrindBin "(\(with\)\=in \zs\S\+)\@=" contained | |
75 syn match valgrindSrc "(\zs[^)]*:\d\+)\@=" contained | |
7 | 76 |
77 " Define the default highlighting | |
78 | |
79 hi def link valgrindSpecLine Type | |
80 "hi def link valgrindRegion Special | |
81 | |
82 hi def link valgrindPid0 Special | |
83 hi def link valgrindPid1 Comment | |
84 hi def link valgrindPid2 Type | |
85 hi def link valgrindPid3 Constant | |
86 hi def link valgrindPid4 Number | |
87 hi def link valgrindPid5 Identifier | |
88 hi def link valgrindPid6 Statement | |
89 hi def link valgrindPid7 Error | |
90 hi def link valgrindPid8 LineNr | |
91 hi def link valgrindPid9 Normal | |
92 "hi def link valgrindLine Special | |
93 | |
94 hi def link valgrindOptions Type | |
95 "hi def link valgrindMsg Special | |
96 "hi def link valgrindLoc Special | |
97 | |
98 hi def link valgrindError Special | |
99 hi def link valgrindNote Comment | |
100 hi def link valgrindSummary Type | |
101 | |
102 hi def link valgrindAt Special | |
103 hi def link valgrindAddr Number | |
104 hi def link valgrindFunc Type | |
105 hi def link valgrindBin Comment | |
106 hi def link valgrindSrc Statement | |
107 | |
108 let b:current_syntax = "valgrind" | |
3496
d1e4abe8342c
Fixed compatible mode in most runtime files.
Bram Moolenaar <bram@vim.org>
parents:
7
diff
changeset
|
109 |
d1e4abe8342c
Fixed compatible mode in most runtime files.
Bram Moolenaar <bram@vim.org>
parents:
7
diff
changeset
|
110 let &cpo = s:keepcpo |
d1e4abe8342c
Fixed compatible mode in most runtime files.
Bram Moolenaar <bram@vim.org>
parents:
7
diff
changeset
|
111 unlet s:keepcpo |