annotate runtime/syntax/gitattributes.vim @ 31798:5948cc887603 v9.0.1231

patch 9.0.1231: completion of :runtime does not handle {where} argument Commit: https://github.com/vim/vim/commit/3770f4c9cde7b5fcd10b6fa2e665cd0b69450fb2 Author: zeertzjq <zeertzjq@outlook.com> Date: Sun Jan 22 18:38:51 2023 +0000 patch 9.0.1231: completion of :runtime does not handle {where} argument Problem: Completion of :runtime does not handle {where} argument. Solution: Parse the {where} argument. (closes https://github.com/vim/vim/issues/11863)
author Bram Moolenaar <Bram@vim.org>
date Sun, 22 Jan 2023 19:45:04 +0100
parents fee9eccee266
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
30202
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
1 " Vim syntax file
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
2 " Language: git attributes
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
3 " Maintainer: ObserverOfTime <chronobserver@disroot.org>
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
4 " Filenames: .gitattributes, *.git/info/attributes
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
5 " Last Change: 2022 Sep 09
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
6
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
7 if exists('b:current_syntax')
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
8 finish
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
9 endif
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
10
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
11 let s:cpo_save = &cpoptions
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
12 set cpoptions&vim
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
13
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
14 " Comment
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
15 syn keyword gitattributesTodo contained TODO FIXME XXX
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
16 syn match gitattributesComment /^\s*#.*/ contains=gitattributesTodo
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
17
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
18 " Pattern
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
19 syn match gitattributesPattern /^\s*#\@!\(".\+"\|\S\+\)/ skipwhite
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
20 \ nextgroup=gitattributesAttrPrefixed,gitattributesAttrAssigned skipwhite
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
21 \ contains=gitattributesGlob,gitattributesRange,gitattributesSeparator
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
22 syn match gitattributesGlob /\\\@1<![?*]/ contained
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
23 syn match gitattributesRange /\\\@1<!\[.\{-}\]/ contained
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
24 syn match gitattributesSeparator '/' contained
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
25
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
26 " Attribute
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
27 syn match gitattributesAttrPrefixed /[!-]\?[A-Za-z0-9_.][-A-Za-z0-9_.]*/
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
28 \ transparent contained skipwhite
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
29 \ nextgroup=gitattributesAttrPrefixed,gitattributesAttrAssigned
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
30 \ contains=gitattributesPrefix,gitattributesName
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
31 syn match gitattributesAttrAssigned /[A-Za-z0-9_.][-A-Za-z0-9_.]*=\S\+/
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
32 \ transparent contained skipwhite
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
33 \ nextgroup=gitattributesAttrPrefixed,gitattributesAttrAssigned
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
34 \ contains=gitattributesName,gitattributesAssign,gitattributesBoolean,gitattributesString
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
35 syn match gitattributesName /[A-Za-z0-9_.][-A-Za-z0-9_.]*/
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
36 \ contained nextgroup=gitattributesAssign
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
37 syn match gitattributesPrefix /[!-]/ contained
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
38 \ nextgroup=gitAttributesName
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
39 syn match gitattributesAssign '=' contained
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
40 \ nextgroup=gitattributesBoolean,gitattributesString
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
41 syn match gitattributesString /=\@1<=\S\+/ contained
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
42 syn keyword gitattributesBoolean true false contained
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
43
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
44 " Macro
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
45 syn match gitattributesMacro /^\s*\[attr\]\s*\S\+/
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
46 \ nextgroup=gitattributesAttribute skipwhite
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
47
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
48 hi def link gitattributesAssign Operator
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
49 hi def link gitattributesBoolean Boolean
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
50 hi def link gitattributesComment Comment
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
51 hi def link gitattributesGlob Special
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
52 hi def link gitattributesMacro Define
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
53 hi def link gitattributesName Identifier
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
54 hi def link gitattributesPrefix SpecialChar
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
55 hi def link gitattributesRange Special
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
56 hi def link gitattributesSeparator Delimiter
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
57 hi def link gitattributesString String
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
58 hi def link gitattributesTodo Todo
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
59
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
60 let b:current_syntax = 'gitattributes'
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
61
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
62 let &cpoptions = s:cpo_save
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
63 unlet s:cpo_save