Mercurial > vim
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 |
rev | line source |
---|---|
7 | 1 " Vim syntax file |
2 " Language: po (gettext) | |
347 | 3 " Maintainer: Dwayne Bailey <dwayne@translate.org.za> |
6823 | 4 " Last Change: 2015 Jun 07 |
1621 | 5 " Contributors: Dwayne Bailey (Most advanced syntax highlighting) |
6 " Leonardo Fontenelle (Spell checking) | |
2587 | 7 " Nam SungHyun <namsh@kldp.org> (Original maintainer) |
7 | 8 |
9 " For version 5.x: Clear all syntax items | |
10 " For version 6.x: Quit when a syntax file was already loaded | |
11 if version < 600 | |
12 syntax clear | |
13 elseif exists("b:current_syntax") | |
14 finish | |
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 | 18 |
347 | 19 syn sync minlines=10 |
20 | |
21 " Identifiers | |
1621 | 22 syn match poStatementMsgCTxt "^msgctxt" |
347 | 23 syn match poStatementMsgidplural "^msgid_plural" contained |
24 syn match poPluralCaseN "[0-9]" contained | |
25 syn match poStatementMsgstr "^msgstr\(\[[0-9]\]\)" contains=poPluralCaseN | |
26 | |
27 " Simple HTML and XML highlighting | |
1621 | 28 syn match poHtml "<\_[^<>]\+>" contains=poHtmlTranslatables,poLineBreak |
347 | 29 syn match poHtmlNot +"<[^<]\+>"+ms=s+1,me=e-1 |
1621 | 30 syn region poHtmlTranslatables start=+\(abbr\|alt\|content\|summary\|standby\|title\)=\\"+ms=e-1 end=+\\"+ contained contains=@Spell |
31 syn match poLineBreak +"\n"+ contained | |
347 | 32 |
33 " Translation blocks | |
1621 | 34 syn region poMsgCTxt matchgroup=poStatementMsgCTxt start=+^msgctxt "+rs=e-1 matchgroup=poStringCTxt end=+^msgid "+me=s-1 contains=poStringCTxt |
347 | 35 syn region poMsgID matchgroup=poStatementMsgid start=+^msgid "+rs=e-1 matchgroup=poStringID end=+^msgstr\(\|\[[\]0\[]\]\) "+me=s-1 contains=poStringID,poStatementMsgidplural,poStatementMsgid |
36 syn region poMsgSTR matchgroup=poStatementMsgstr start=+^msgstr\(\|\[[\]0\[]\]\) "+rs=e-1 matchgroup=poStringSTR end=+\n\n+me=s-1 contains=poStringSTR,poStatementMsgstr | |
1621 | 37 syn region poStringCTxt start=+"+ skip=+\\\\\|\\"+ end=+"+ |
347 | 38 syn region poStringID start=+"+ skip=+\\\\\|\\"+ end=+"+ contained |
1621 | 39 \ contains=poSpecial,poFormat,poCommentKDE,poPluralKDE,poKDEdesktopFile,poHtml,poAcceleratorId,poHtmlNot,poVariable |
347 | 40 syn region poStringSTR start=+"+ skip=+\\\\\|\\"+ end=+"+ contained |
1621 | 41 \ contains=@Spell,poSpecial,poFormat,poHeaderItem,poCommentKDEError,poHeaderUndefined,poPluralKDEError,poMsguniqError,poKDEdesktopFile,poHtml,poAcceleratorStr,poHtmlNot,poVariable |
347 | 42 |
43 " Header and Copyright | |
2587 | 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 | 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 | 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 |
47 | |
48 " Translation comment block including: translator comment, automatic coments, flags and locations | |
49 syn match poComment "^#.*$" | |
50 syn keyword poFlagFuzzy fuzzy contained | |
51 syn match poCommentTranslator "^# .*$" contains=poCopyrightUnset | |
52 syn match poCommentAutomatic "^#\..*$" | |
53 syn match poCommentSources "^#:.*$" | |
54 syn match poCommentFlags "^#,.*$" contains=poFlagFuzzy | |
6823 | 55 syn match poDiffOld '\(^#| "[^{]*+}\|{+[^}]*+}\|{+[^}]*\|"$\)' contained |
56 syn match poDiffNew '\(^#| "[^{]*-}\|{-[^}]*-}\|{-[^}]*\|"$\)' contained | |
57 syn match poCommentDiff "^#|.*$" contains=poDiffOld,poDiffNew | |
347 | 58 |
59 " Translations (also includes header fields as they appear in a translation msgstr) | |
60 syn region poCommentKDE start=+"_: +ms=s+1 end="\\n" end="\"\n^msgstr"me=s-1 contained | |
61 syn region poCommentKDEError start=+"\(\|\s\+\)_:+ms=s+1 end="\\n" end=+"\n\n+me=s-1 contained | |
62 syn match poPluralKDE +"_n: +ms=s+1 contained | |
63 syn region poPluralKDEError start=+"\(\|\s\+\)_n:+ms=s+1 end="\"\n\n"me=s-1 contained | |
7 | 64 syn match poSpecial contained "\\\(x\x\+\|\o\{1,3}\|.\|$\)" |
65 syn match poFormat "%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlL]\|ll\)\=\([diuoxXfeEgGcCsSpn]\|\[\^\=.[^]]*\]\)" contained | |
66 syn match poFormat "%%" contained | |
347 | 67 |
68 " msguniq and msgcat conflicts | |
69 syn region poMsguniqError matchgroup=poMsguniqErrorMarkers start="#-#-#-#-#" end='#\("\n"\|\)-\("\n"\|\)#\("\n"\|\)-\("\n"\|\)#\("\n"\|\)-\("\n"\|\)#\("\n"\|\)-\("\n"\|\)#\("\n"\|\)\\n' contained | |
70 | |
71 " Obsolete messages | |
72 syn match poObsolete "^#\~.*$" | |
73 | |
74 " KDE Name= handling | |
75 syn match poKDEdesktopFile "\"\(Name\|Comment\|GenericName\|Description\|Keywords\|About\)="ms=s+1,me=e-1 | |
76 | |
77 " Accelerator keys - this messes up if the preceding or following char is a multibyte unicode char | |
1621 | 78 syn match poAcceleratorId contained "[^&_~][&_~]\(\a\|\d\)[^:]"ms=s+1,me=e-1 |
79 syn match poAcceleratorStr contained "[^&_~][&_~]\(\a\|\d\)[^:]"ms=s+1,me=e-1 contains=@Spell | |
347 | 80 |
81 " Variables simple | |
82 syn match poVariable contained "%\d" | |
7 | 83 |
84 " Define the default highlighting. | |
85 " For version 5.7 and earlier: only when not done already | |
86 " For version 5.8 and later: only when an item doesn't have highlighting yet | |
87 if version >= 508 || !exists("did_po_syn_inits") | |
88 if version < 508 | |
89 let did_po_syn_inits = 1 | |
90 command -nargs=+ HiLink hi link <args> | |
91 else | |
92 command -nargs=+ HiLink hi def link <args> | |
93 endif | |
94 | |
347 | 95 HiLink poCommentSources PreProc |
96 HiLink poComment Comment | |
97 HiLink poCommentAutomatic Comment | |
98 HiLink poCommentTranslator Comment | |
99 HiLink poCommentFlags Special | |
6823 | 100 HiLink poCommentDiff Comment |
347 | 101 HiLink poCopyrightUnset Todo |
102 HiLink poFlagFuzzy Todo | |
6823 | 103 HiLink poDiffOld Todo |
104 HiLink poDiffNew Special | |
347 | 105 HiLink poObsolete Comment |
106 | |
107 HiLink poStatementMsgid Statement | |
108 HiLink poStatementMsgstr Statement | |
109 HiLink poStatementMsgidplural Statement | |
1621 | 110 HiLink poStatementMsgCTxt Statement |
347 | 111 HiLink poPluralCaseN Constant |
112 | |
1621 | 113 HiLink poStringCTxt Comment |
347 | 114 HiLink poStringID String |
115 HiLink poStringSTR String | |
116 HiLink poCommentKDE Comment | |
117 HiLink poCommentKDEError Error | |
118 HiLink poPluralKDE Comment | |
119 HiLink poPluralKDEError Error | |
120 HiLink poHeaderItem Identifier | |
121 HiLink poHeaderUndefined Todo | |
122 HiLink poKDEdesktopFile Identifier | |
123 | |
124 HiLink poHtml Identifier | |
125 HiLink poHtmlNot String | |
126 HiLink poHtmlTranslatables String | |
1621 | 127 HiLink poLineBreak String |
347 | 128 |
129 HiLink poFormat poSpecial | |
130 HiLink poSpecial Special | |
1621 | 131 HiLink poAcceleratorId Special |
132 HiLink poAcceleratorStr Special | |
133 HiLink poVariable Special | |
347 | 134 |
135 HiLink poMsguniqError Special | |
136 HiLink poMsguniqErrorMarkers Comment | |
7 | 137 |
138 delcommand HiLink | |
139 endif | |
140 | |
141 let b:current_syntax = "po" | |
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 | 146 " vim:set ts=8 sts=2 sw=2 noet: |