annotate runtime/syntax/po.vim @ 9309:178252c6850e v7.4.1937

commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Jun 14 22:02:26 2016 +0200 patch 7.4.1937 Problem: No test for directory stack in quickfix. Solution: Add a test. (Yegappan Lakshmanan)
author Christian Brabandt <cb@256bit.org>
date Tue, 14 Jun 2016 22:15:08 +0200
parents 0303182665d5
children 43efa4f5a8ea
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim syntax file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 " Language: po (gettext)
347
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
3 " Maintainer: Dwayne Bailey <dwayne@translate.org.za>
6823
0303182665d5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3496
diff changeset
4 " Last Change: 2015 Jun 07
1621
82b5078be2dd updated for version 7.2a
vimboss
parents: 347
diff changeset
5 " Contributors: Dwayne Bailey (Most advanced syntax highlighting)
82b5078be2dd updated for version 7.2a
vimboss
parents: 347
diff changeset
6 " Leonardo Fontenelle (Spell checking)
2587
d0049ff5969e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
7 " Nam SungHyun <namsh@kldp.org> (Original maintainer)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 " For version 5.x: Clear all syntax items
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 " For version 6.x: Quit when a syntax file was already loaded
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 if version < 600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 syntax clear
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 elseif exists("b:current_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 endif
3496
d1e4abe8342c Fixed compatible mode in most runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2587
diff changeset
16 let s:keepcpo= &cpo
d1e4abe8342c Fixed compatible mode in most runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2587
diff changeset
17 set cpo&vim
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18
347
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
19 syn sync minlines=10
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
20
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
21 " Identifiers
1621
82b5078be2dd updated for version 7.2a
vimboss
parents: 347
diff changeset
22 syn match poStatementMsgCTxt "^msgctxt"
347
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
23 syn match poStatementMsgidplural "^msgid_plural" contained
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
24 syn match poPluralCaseN "[0-9]" contained
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
25 syn match poStatementMsgstr "^msgstr\(\[[0-9]\]\)" contains=poPluralCaseN
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
26
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
27 " Simple HTML and XML highlighting
1621
82b5078be2dd updated for version 7.2a
vimboss
parents: 347
diff changeset
28 syn match poHtml "<\_[^<>]\+>" contains=poHtmlTranslatables,poLineBreak
347
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
29 syn match poHtmlNot +"<[^<]\+>"+ms=s+1,me=e-1
1621
82b5078be2dd updated for version 7.2a
vimboss
parents: 347
diff changeset
30 syn region poHtmlTranslatables start=+\(abbr\|alt\|content\|summary\|standby\|title\)=\\"+ms=e-1 end=+\\"+ contained contains=@Spell
82b5078be2dd updated for version 7.2a
vimboss
parents: 347
diff changeset
31 syn match poLineBreak +"\n"+ contained
347
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
32
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
33 " Translation blocks
1621
82b5078be2dd updated for version 7.2a
vimboss
parents: 347
diff changeset
34 syn region poMsgCTxt matchgroup=poStatementMsgCTxt start=+^msgctxt "+rs=e-1 matchgroup=poStringCTxt end=+^msgid "+me=s-1 contains=poStringCTxt
347
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
35 syn region poMsgID matchgroup=poStatementMsgid start=+^msgid "+rs=e-1 matchgroup=poStringID end=+^msgstr\(\|\[[\]0\[]\]\) "+me=s-1 contains=poStringID,poStatementMsgidplural,poStatementMsgid
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
36 syn region poMsgSTR matchgroup=poStatementMsgstr start=+^msgstr\(\|\[[\]0\[]\]\) "+rs=e-1 matchgroup=poStringSTR end=+\n\n+me=s-1 contains=poStringSTR,poStatementMsgstr
1621
82b5078be2dd updated for version 7.2a
vimboss
parents: 347
diff changeset
37 syn region poStringCTxt start=+"+ skip=+\\\\\|\\"+ end=+"+
347
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
38 syn region poStringID start=+"+ skip=+\\\\\|\\"+ end=+"+ contained
1621
82b5078be2dd updated for version 7.2a
vimboss
parents: 347
diff changeset
39 \ contains=poSpecial,poFormat,poCommentKDE,poPluralKDE,poKDEdesktopFile,poHtml,poAcceleratorId,poHtmlNot,poVariable
347
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
40 syn region poStringSTR start=+"+ skip=+\\\\\|\\"+ end=+"+ contained
1621
82b5078be2dd updated for version 7.2a
vimboss
parents: 347
diff changeset
41 \ contains=@Spell,poSpecial,poFormat,poHeaderItem,poCommentKDEError,poHeaderUndefined,poPluralKDEError,poMsguniqError,poKDEdesktopFile,poHtml,poAcceleratorStr,poHtmlNot,poVariable
347
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
42
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
43 " Header and Copyright
2587
d0049ff5969e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
44 syn match poHeaderItem "\(Project-Id-Version\|Report-Msgid-Bugs-To\|POT-Creation-Date\|PO-Revision-Date\|Last-Translator\|Language-Team\|Language\|MIME-Version\|Content-Type\|Content-Transfer-Encoding\|Plural-Forms\|X-Generator\): " contained
1621
82b5078be2dd updated for version 7.2a
vimboss
parents: 347
diff changeset
45 syn match poHeaderUndefined "\(PACKAGE VERSION\|YEAR-MO-DA HO:MI+ZONE\|FULL NAME <EMAIL@ADDRESS>\|LANGUAGE <LL@li.org>\|CHARSET\|ENCODING\|INTEGER\|EXPRESSION\)" contained
347
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
46 syn match poCopyrightUnset "SOME DESCRIPTIVE TITLE\|FIRST AUTHOR <EMAIL@ADDRESS>, YEAR\|Copyright (C) YEAR Free Software Foundation, Inc\|YEAR THE PACKAGE\'S COPYRIGHT HOLDER\|PACKAGE" contained
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
47
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
48 " Translation comment block including: translator comment, automatic coments, flags and locations
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
49 syn match poComment "^#.*$"
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
50 syn keyword poFlagFuzzy fuzzy contained
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
51 syn match poCommentTranslator "^# .*$" contains=poCopyrightUnset
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
52 syn match poCommentAutomatic "^#\..*$"
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
53 syn match poCommentSources "^#:.*$"
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
54 syn match poCommentFlags "^#,.*$" contains=poFlagFuzzy
6823
0303182665d5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3496
diff changeset
55 syn match poDiffOld '\(^#| "[^{]*+}\|{+[^}]*+}\|{+[^}]*\|"$\)' contained
0303182665d5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3496
diff changeset
56 syn match poDiffNew '\(^#| "[^{]*-}\|{-[^}]*-}\|{-[^}]*\|"$\)' contained
0303182665d5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3496
diff changeset
57 syn match poCommentDiff "^#|.*$" contains=poDiffOld,poDiffNew
347
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
58
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
59 " Translations (also includes header fields as they appear in a translation msgstr)
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
60 syn region poCommentKDE start=+"_: +ms=s+1 end="\\n" end="\"\n^msgstr"me=s-1 contained
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
61 syn region poCommentKDEError start=+"\(\|\s\+\)_:+ms=s+1 end="\\n" end=+"\n\n+me=s-1 contained
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
62 syn match poPluralKDE +"_n: +ms=s+1 contained
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
63 syn region poPluralKDEError start=+"\(\|\s\+\)_n:+ms=s+1 end="\"\n\n"me=s-1 contained
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 syn match poSpecial contained "\\\(x\x\+\|\o\{1,3}\|.\|$\)"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 syn match poFormat "%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlL]\|ll\)\=\([diuoxXfeEgGcCsSpn]\|\[\^\=.[^]]*\]\)" contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 syn match poFormat "%%" contained
347
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
67
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
68 " msguniq and msgcat conflicts
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
69 syn region poMsguniqError matchgroup=poMsguniqErrorMarkers start="#-#-#-#-#" end='#\("\n"\|\)-\("\n"\|\)#\("\n"\|\)-\("\n"\|\)#\("\n"\|\)-\("\n"\|\)#\("\n"\|\)-\("\n"\|\)#\("\n"\|\)\\n' contained
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
70
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
71 " Obsolete messages
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
72 syn match poObsolete "^#\~.*$"
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
73
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
74 " KDE Name= handling
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
75 syn match poKDEdesktopFile "\"\(Name\|Comment\|GenericName\|Description\|Keywords\|About\)="ms=s+1,me=e-1
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
76
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
77 " Accelerator keys - this messes up if the preceding or following char is a multibyte unicode char
1621
82b5078be2dd updated for version 7.2a
vimboss
parents: 347
diff changeset
78 syn match poAcceleratorId contained "[^&_~][&_~]\(\a\|\d\)[^:]"ms=s+1,me=e-1
82b5078be2dd updated for version 7.2a
vimboss
parents: 347
diff changeset
79 syn match poAcceleratorStr contained "[^&_~][&_~]\(\a\|\d\)[^:]"ms=s+1,me=e-1 contains=@Spell
347
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
80
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
81 " Variables simple
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
82 syn match poVariable contained "%\d"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 " Define the default highlighting.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 " For version 5.7 and earlier: only when not done already
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 " For version 5.8 and later: only when an item doesn't have highlighting yet
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 if version >= 508 || !exists("did_po_syn_inits")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 if version < 508
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 let did_po_syn_inits = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90 command -nargs=+ HiLink hi link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92 command -nargs=+ HiLink hi def link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94
347
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
95 HiLink poCommentSources PreProc
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
96 HiLink poComment Comment
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
97 HiLink poCommentAutomatic Comment
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
98 HiLink poCommentTranslator Comment
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
99 HiLink poCommentFlags Special
6823
0303182665d5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3496
diff changeset
100 HiLink poCommentDiff Comment
347
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
101 HiLink poCopyrightUnset Todo
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
102 HiLink poFlagFuzzy Todo
6823
0303182665d5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3496
diff changeset
103 HiLink poDiffOld Todo
0303182665d5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3496
diff changeset
104 HiLink poDiffNew Special
347
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
105 HiLink poObsolete Comment
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
106
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
107 HiLink poStatementMsgid Statement
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
108 HiLink poStatementMsgstr Statement
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
109 HiLink poStatementMsgidplural Statement
1621
82b5078be2dd updated for version 7.2a
vimboss
parents: 347
diff changeset
110 HiLink poStatementMsgCTxt Statement
347
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
111 HiLink poPluralCaseN Constant
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
112
1621
82b5078be2dd updated for version 7.2a
vimboss
parents: 347
diff changeset
113 HiLink poStringCTxt Comment
347
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
114 HiLink poStringID String
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
115 HiLink poStringSTR String
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
116 HiLink poCommentKDE Comment
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
117 HiLink poCommentKDEError Error
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
118 HiLink poPluralKDE Comment
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
119 HiLink poPluralKDEError Error
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
120 HiLink poHeaderItem Identifier
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
121 HiLink poHeaderUndefined Todo
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
122 HiLink poKDEdesktopFile Identifier
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
123
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
124 HiLink poHtml Identifier
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
125 HiLink poHtmlNot String
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
126 HiLink poHtmlTranslatables String
1621
82b5078be2dd updated for version 7.2a
vimboss
parents: 347
diff changeset
127 HiLink poLineBreak String
347
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
128
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
129 HiLink poFormat poSpecial
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
130 HiLink poSpecial Special
1621
82b5078be2dd updated for version 7.2a
vimboss
parents: 347
diff changeset
131 HiLink poAcceleratorId Special
82b5078be2dd updated for version 7.2a
vimboss
parents: 347
diff changeset
132 HiLink poAcceleratorStr Special
82b5078be2dd updated for version 7.2a
vimboss
parents: 347
diff changeset
133 HiLink poVariable Special
347
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
134
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
135 HiLink poMsguniqError Special
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
136 HiLink poMsguniqErrorMarkers Comment
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
137
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
138 delcommand HiLink
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
139 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
140
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
141 let b:current_syntax = "po"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
142
3496
d1e4abe8342c Fixed compatible mode in most runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2587
diff changeset
143 let &cpo = s:keepcpo
d1e4abe8342c Fixed compatible mode in most runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2587
diff changeset
144 unlet s:keepcpo
d1e4abe8342c Fixed compatible mode in most runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2587
diff changeset
145
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
146 " vim:set ts=8 sts=2 sw=2 noet: