annotate runtime/autoload/csscomplete.vim @ 830:927afe5f3c9d

updated for version 7.0d05
author vimboss
date Sat, 15 Apr 2006 20:16:09 +0000
parents 249173daa651
children 8cd729851562
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
531
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
1 " Vim completion script
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
2 " Language: CSS 2.1
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
3 " Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
553
249173daa651 updated for version 7.0157
vimboss
parents: 548
diff changeset
4 " Last Change: 2005 Oct 12
531
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
5
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
6 function! csscomplete#CompleteCSS(findstart, base)
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
7 if a:findstart
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
8 " We need whole line to proper checking
548
f43150a669dc updated for version 7.0155
vimboss
parents: 539
diff changeset
9 let line = getline('.')
f43150a669dc updated for version 7.0155
vimboss
parents: 539
diff changeset
10 let start = col('.') - 1
f43150a669dc updated for version 7.0155
vimboss
parents: 539
diff changeset
11 let compl_begin = col('.') - 2
f43150a669dc updated for version 7.0155
vimboss
parents: 539
diff changeset
12 while start >= 0 && line[start - 1] =~ '\(\k\|-\)'
f43150a669dc updated for version 7.0155
vimboss
parents: 539
diff changeset
13 let start -= 1
f43150a669dc updated for version 7.0155
vimboss
parents: 539
diff changeset
14 endwhile
f43150a669dc updated for version 7.0155
vimboss
parents: 539
diff changeset
15 let b:compl_context = getline('.')[0:compl_begin]
f43150a669dc updated for version 7.0155
vimboss
parents: 539
diff changeset
16 return start
531
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
17 else
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
18 " There are few chars important for context:
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
19 " ^ ; : { } /* */
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
20 " Where ^ is start of line and /* */ are comment borders
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
21 " Depending on their relative position to cursor we will now what should
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
22 " be completed.
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
23 " 1. if nearest are ^ or { or ; current word is property
548
f43150a669dc updated for version 7.0155
vimboss
parents: 539
diff changeset
24 " 2. if : it is value (with exception of pseudo things)
531
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
25 " 3. if } we are outside of css definitions
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
26 " 4. for comments ignoring is be the easiest but assume they are the same
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
27 " as 1.
532
7052f11a3dc9 updated for version 7.0150
vimboss
parents: 531
diff changeset
28 " 5. if @ complete at-rule
7052f11a3dc9 updated for version 7.0150
vimboss
parents: 531
diff changeset
29 " 6. if ! complete important
553
249173daa651 updated for version 7.0157
vimboss
parents: 548
diff changeset
30 if exists("b:compl_context")
249173daa651 updated for version 7.0157
vimboss
parents: 548
diff changeset
31 let line = b:compl_context
249173daa651 updated for version 7.0157
vimboss
parents: 548
diff changeset
32 unlet! b:compl_context
249173daa651 updated for version 7.0157
vimboss
parents: 548
diff changeset
33 else
249173daa651 updated for version 7.0157
vimboss
parents: 548
diff changeset
34 let line = a:base
249173daa651 updated for version 7.0157
vimboss
parents: 548
diff changeset
35 endif
548
f43150a669dc updated for version 7.0155
vimboss
parents: 539
diff changeset
36
531
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
37 let res = []
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
38 let res2 = []
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
39 let borders = {}
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
40
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
41 " We need the last occurrence of char so reverse line
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
42 let revline = join(reverse(split(line, '.\zs')), '')
532
7052f11a3dc9 updated for version 7.0150
vimboss
parents: 531
diff changeset
43
531
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
44 let openbrace = stridx(revline, '{')
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
45 let closebrace = stridx(revline, '}')
532
7052f11a3dc9 updated for version 7.0150
vimboss
parents: 531
diff changeset
46 let colon = stridx(revline, ':')
7052f11a3dc9 updated for version 7.0150
vimboss
parents: 531
diff changeset
47 let semicolon = stridx(revline, ';')
7052f11a3dc9 updated for version 7.0150
vimboss
parents: 531
diff changeset
48 let opencomm = stridx(revline, '*/') " Line was reversed
7052f11a3dc9 updated for version 7.0150
vimboss
parents: 531
diff changeset
49 let closecomm = stridx(revline, '/*') " Line was reversed
7052f11a3dc9 updated for version 7.0150
vimboss
parents: 531
diff changeset
50 let style = stridx(revline, '=\s*elyts') " Line was reversed
7052f11a3dc9 updated for version 7.0150
vimboss
parents: 531
diff changeset
51 let atrule = stridx(revline, '@')
7052f11a3dc9 updated for version 7.0150
vimboss
parents: 531
diff changeset
52 let exclam = stridx(revline, '!')
531
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
53
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
54 if openbrace > -1
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
55 let borders[openbrace] = "openbrace"
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
56 endif
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
57 if closebrace > -1
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
58 let borders[closebrace] = "closebrace"
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
59 endif
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
60 if colon > -1
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
61 let borders[colon] = "colon"
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
62 endif
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
63 if semicolon > -1
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
64 let borders[semicolon] = "semicolon"
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
65 endif
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
66 if opencomm > -1
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
67 let borders[opencomm] = "opencomm"
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
68 endif
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
69 if closecomm > -1
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
70 let borders[closecomm] = "closecomm"
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
71 endif
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
72 if style > -1
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
73 let borders[style] = "style"
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
74 endif
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
75 if atrule > -1
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
76 let borders[atrule] = "atrule"
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
77 endif
532
7052f11a3dc9 updated for version 7.0150
vimboss
parents: 531
diff changeset
78 if exclam > -1
7052f11a3dc9 updated for version 7.0150
vimboss
parents: 531
diff changeset
79 let borders[exclam] = "exclam"
7052f11a3dc9 updated for version 7.0150
vimboss
parents: 531
diff changeset
80 endif
531
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
81
548
f43150a669dc updated for version 7.0155
vimboss
parents: 539
diff changeset
82
531
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
83 if len(borders) == 0 || borders[min(keys(borders))] =~ '^\(openbrace\|semicolon\|opencomm\|closecomm\|style\)$'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
84 " Complete properties
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
85
548
f43150a669dc updated for version 7.0155
vimboss
parents: 539
diff changeset
86 let values = split("azimuth background background-attachment background-color background-image background-position background-repeat border bottom border-collapse border-color border-spacing border-style border-top border-right border-bottom border-left border-top-color border-right-color border-bottom-color border-left-color border-top-style border-right-style border-bottom-style border-left-style border-top-width border-right-width border-bottom-width border-left-width border-width caption-side clear clip color content counter-increment counter-reset cue cue-after cue-before cursor display direction elevation empty-cells float font font-family font-size font-style font-variant font-weight height left letter-spacing line-height list-style list-style-image list-style-position list-style-type margin margin-right margin-left margin-top margin-bottom max-height max-width min-height min-width orphans outline outline-color outline-style outline-width overflow padding padding-top padding-right padding-bottom padding-left page-break-after page-break-before page-break-inside pause pause-after pause-before pitch pitch-range play-during position quotes right richness speak speak-header speak-numeral speak-punctuation speech-rate stress table-layout text-align text-decoration text-indent text-transform top unicode-bidi vertical-align visibility voice-family volume white-space width widows word-spacing z-index")
531
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
87
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
88 let entered_property = matchstr(line, '.\{-}\zs[a-zA-Z-]*$')
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
89
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
90 for m in values
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
91 if m =~? '^'.entered_property
548
f43150a669dc updated for version 7.0155
vimboss
parents: 539
diff changeset
92 call add(res, m . ':')
531
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
93 elseif m =~? entered_property
548
f43150a669dc updated for version 7.0155
vimboss
parents: 539
diff changeset
94 call add(res2, m . ':')
531
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
95 endif
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
96 endfor
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
97
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
98 return res + res2
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
99
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
100 elseif borders[min(keys(borders))] == 'colon'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
101 " Get name of property
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
102 let prop = tolower(matchstr(line, '\zs[a-zA-Z-]*\ze\s*:[^:]\{-}$'))
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
103
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
104 if prop == 'azimuth'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
105 let values = ["left-side", "far-left", "left", "center-left", "center", "center-right", "right", "far-right", "right-side", "behind", "leftwards", "rightwards"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
106 elseif prop == 'background-attachment'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
107 let values = ["scroll", "fixed"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
108 elseif prop == 'background-color'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
109 let values = ["transparent", "rgb(", "#"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
110 elseif prop == 'background-image'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
111 let values = ["url(", "none"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
112 elseif prop == 'background-position'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
113 let vals = matchstr(line, '.*:\s*\zs.*')
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
114 if vals =~ '^\([a-zA-Z]\+\)\?$'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
115 let values = ["top", "center", "bottom"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
116 elseif vals =~ '^[a-zA-Z]\+\s\+\([a-zA-Z]\+\)\?$'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
117 let values = ["left", "center", "right"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
118 else
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
119 return []
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
120 endif
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
121 elseif prop == 'background-repeat'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
122 let values = ["repeat", "repeat-x", "repeat-y", "no-repeat"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
123 elseif prop == 'background'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
124 let values = ["url(", "scroll", "fixed", "transparent", "rgb(", "#", "none", "top", "center", "bottom" , "left", "right", "repeat", "repeat-x", "repeat-y", "no-repeat"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
125 elseif prop == 'border-collapse'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
126 let values = ["collapse", "separate"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
127 elseif prop == 'border-color'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
128 let values = ["rgb(", "#", "transparent"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
129 elseif prop == 'border-spacing'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
130 return []
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
131 elseif prop == 'border-style'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
132 let values = ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
133 elseif prop =~ 'border-\(top\|right\|bottom\|left\)$'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
134 let vals = matchstr(line, '.*:\s*\zs.*')
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
135 if vals =~ '^\([a-zA-Z0-9.]\+\)\?$'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
136 let values = ["thin", "thick", "medium"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
137 elseif vals =~ '^[a-zA-Z0-9.]\+\s\+\([a-zA-Z]\+\)\?$'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
138 let values = ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
139 elseif vals =~ '^[a-zA-Z0-9.]\+\s\+[a-zA-Z]\+\s\+\([a-zA-Z(]\+\)\?$'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
140 let values = ["rgb(", "#", "transparent"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
141 else
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
142 return []
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
143 endif
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
144 elseif prop =~ 'border-\(top\|right\|bottom\|left\)-color'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
145 let values = ["rgb(", "#", "transparent"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
146 elseif prop =~ 'border-\(top\|right\|bottom\|left\)-style'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
147 let values = ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
148 elseif prop =~ 'border-\(top\|right\|bottom\|left\)-width'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
149 let values = ["thin", "thick", "medium"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
150 elseif prop == 'border-width'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
151 let values = ["thin", "thick", "medium"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
152 elseif prop == 'border'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
153 let vals = matchstr(line, '.*:\s*\zs.*')
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
154 if vals =~ '^\([a-zA-Z0-9.]\+\)\?$'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
155 let values = ["thin", "thick", "medium"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
156 elseif vals =~ '^[a-zA-Z0-9.]\+\s\+\([a-zA-Z]\+\)\?$'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
157 let values = ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
158 elseif vals =~ '^[a-zA-Z0-9.]\+\s\+[a-zA-Z]\+\s\+\([a-zA-Z(]\+\)\?$'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
159 let values = ["rgb(", "#", "transparent"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
160 else
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
161 return []
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
162 endif
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
163 elseif prop == 'bottom'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
164 let values = ["auto"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
165 elseif prop == 'caption-side'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
166 let values = ["top", "bottom"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
167 elseif prop == 'clear'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
168 let values = ["none", "left", "right", "both"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
169 elseif prop == 'clip'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
170 let values = ["auto", "rect("]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
171 elseif prop == 'color'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
172 let values = ["rgb(", "#"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
173 elseif prop == 'content'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
174 let values = ["normal", "attr(", "open-quote", "close-quote", "no-open-quote", "no-close-quote"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
175 elseif prop =~ 'counter-\(increment\|reset\)$'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
176 let values = ["none"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
177 elseif prop =~ '^\(cue-after\|cue-before\|cue\)$'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
178 let values = ["url(", "none"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
179 elseif prop == 'cursor'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
180 let values = ["url(", "auto", "crosshair", "default", "pointer", "move", "e-resize", "ne-resize", "nw-resize", "n-resize", "se-resize", "sw-resize", "s-resize", "w-resize", "text", "wait", "help", "progress"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
181 elseif prop == 'direction'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
182 let values = ["ltr", "rtl"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
183 elseif prop == 'display'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
184 let values = ["inline", "block", "list-item", "run-in", "inline-block", "table", "inline-table", "table-row-group", "table-header-group", "table-footer-group", "table-row", "table-column-group", "table-column", "table-cell", "table-caption", "none"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
185 elseif prop == 'elevation'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
186 let values = ["below", "level", "above", "higher", "lower"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
187 elseif prop == 'empty-cells'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
188 let values = ["show", "hide"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
189 elseif prop == 'float'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
190 let values = ["left", "right", "none"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
191 elseif prop == 'font-family'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
192 let values = ["sans-serif", "serif", "monospace", "cursive", "fantasy"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
193 elseif prop == 'font-size'
539
b13dbb7b797c updated for version 7.0153
vimboss
parents: 534
diff changeset
194 let values = ["xx-small", "x-small", "small", "medium", "large", "x-large", "xx-large", "larger", "smaller"]
531
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
195 elseif prop == 'font-style'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
196 let values = ["normal", "italic", "oblique"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
197 elseif prop == 'font-variant'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
198 let values = ["normal", "small-caps"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
199 elseif prop == 'font-weight'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
200 let values = ["normal", "bold", "bolder", "lighter", "100", "200", "300", "400", "500", "600", "700", "800", "900"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
201 elseif prop == 'font'
539
b13dbb7b797c updated for version 7.0153
vimboss
parents: 534
diff changeset
202 let values = ["normal", "italic", "oblique", "small-caps", "bold", "bolder", "lighter", "100", "200", "300", "400", "500", "600", "700", "800", "900", "xx-small", "x-small", "small", "medium", "large", "x-large", "xx-large", "larger", "smaller", "sans-serif", "serif", "monospace", "cursive", "fantasy", "caption", "icon", "menu", "message-box", "small-caption", "status-bar"]
531
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
203 elseif prop =~ '^\(height\|width\)$'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
204 let values = ["auto"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
205 elseif prop =~ '^\(left\|rigth\)$'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
206 let values = ["auto"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
207 elseif prop == 'letter-spacing'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
208 let values = ["normal"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
209 elseif prop == 'line-height'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
210 let values = ["normal"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
211 elseif prop == 'list-style-image'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
212 let values = ["url(", "none"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
213 elseif prop == 'list-style-position'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
214 let values = ["inside", "outside"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
215 elseif prop == 'list-style-type'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
216 let values = ["disc", "circle", "square", "decimal", "decimal-leading-zero", "lower-roman", "upper-roman", "lower-latin", "upper-latin", "none"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
217 elseif prop == 'list-style'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
218 return []
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
219 elseif prop == 'margin'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
220 let values = ["auto"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
221 elseif prop =~ 'margin-\(right\|left\|top\|bottom\)$'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
222 let values = ["auto"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
223 elseif prop == 'max-height'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
224 let values = ["auto"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
225 elseif prop == 'max-width'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
226 let values = ["none"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
227 elseif prop == 'min-height'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
228 let values = ["none"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
229 elseif prop == 'min-width'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
230 let values = ["none"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
231 elseif prop == 'orphans'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
232 return []
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
233 elseif prop == 'outline-color'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
234 let values = ["rgb(", "#"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
235 elseif prop == 'outline-style'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
236 let values = ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
237 elseif prop == 'outline-width'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
238 let values = ["thin", "thick", "medium"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
239 elseif prop == 'outline'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
240 let vals = matchstr(line, '.*:\s*\zs.*')
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
241 if vals =~ '^\([a-zA-Z0-9,()#]\+\)\?$'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
242 let values = ["rgb(", "#"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
243 elseif vals =~ '^[a-zA-Z0-9,()#]\+\s\+\([a-zA-Z]\+\)\?$'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
244 let values = ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
245 elseif vals =~ '^[a-zA-Z0-9,()#]\+\s\+[a-zA-Z]\+\s\+\([a-zA-Z(]\+\)\?$'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
246 let values = ["thin", "thick", "medium"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
247 else
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
248 return []
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
249 endif
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
250 elseif prop == 'overflow'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
251 let values = ["visible", "hidden", "scroll", "auto"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
252 elseif prop == 'padding'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
253 return []
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
254 elseif prop =~ 'padding-\(top\|right\|bottom\|left\)$'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
255 return []
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
256 elseif prop =~ 'page-break-\(after\|before\)$'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
257 let values = ["auto", "always", "avoid", "left", "right"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
258 elseif prop == 'page-break-inside'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
259 let values = ["auto", "avoid"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
260 elseif prop =~ 'pause-\(after\|before\)$'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
261 return []
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
262 elseif prop == 'pause'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
263 return []
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
264 elseif prop == 'pitch-range'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
265 return []
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
266 elseif prop == 'pitch'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
267 let values = ["x-low", "low", "medium", "high", "x-high"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
268 elseif prop == 'play-during'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
269 let values = ["url(", "mix", "repeat", "auto", "none"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
270 elseif prop == 'position'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
271 let values = ["static", "relative", "absolute", "fixed"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
272 elseif prop == 'quotes'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
273 let values = ["none"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
274 elseif prop == 'richness'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
275 return []
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
276 elseif prop == 'speak-header'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
277 let values = ["once", "always"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
278 elseif prop == 'speak-numeral'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
279 let values = ["digits", "continuous"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
280 elseif prop == 'speak-punctuation'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
281 let values = ["code", "none"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
282 elseif prop == 'speak'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
283 let values = ["normal", "none", "spell-out"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
284 elseif prop == 'speech-rate'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
285 let values = ["x-slow", "slow", "medium", "fast", "x-fast", "faster", "slower"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
286 elseif prop == 'stress'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
287 return []
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
288 elseif prop == 'table-layout'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
289 let values = ["auto", "fixed"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
290 elseif prop == 'text-align'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
291 let values = ["left", "right", "center", "justify"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
292 elseif prop == 'text-decoration'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
293 let values = ["none", "underline", "overline", "line-through", "blink"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
294 elseif prop == 'text-indent'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
295 return []
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
296 elseif prop == 'text-transform'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
297 let values = ["capitalize", "uppercase", "lowercase", "none"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
298 elseif prop == 'top'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
299 let values = ["auto"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
300 elseif prop == 'unicode-bidi'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
301 let values = ["normal", "embed", "bidi-override"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
302 elseif prop == 'vertical-align'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
303 let values = ["baseline", "sub", "super", "top", "text-top", "middle", "bottom", "text-bottom"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
304 elseif prop == 'visibility'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
305 let values = ["visible", "hidden", "collapse"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
306 elseif prop == 'voice-family'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
307 return []
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
308 elseif prop == 'volume'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
309 let values = ["silent", "x-soft", "soft", "medium", "loud", "x-loud"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
310 elseif prop == 'white-space'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
311 let values = ["normal", "pre", "nowrap", "pre-wrap", "pre-line"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
312 elseif prop == 'widows'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
313 return []
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
314 elseif prop == 'word-spacing'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
315 let values = ["normal"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
316 elseif prop == 'z-index'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
317 let values = ["auto"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
318 else
534
c6296b0ad9ea updated for version 7.0151
vimboss
parents: 532
diff changeset
319 " If no property match it is possible we are outside of {} and
c6296b0ad9ea updated for version 7.0151
vimboss
parents: 532
diff changeset
320 " trying to complete pseudo-(class|element)
c6296b0ad9ea updated for version 7.0151
vimboss
parents: 532
diff changeset
321 let element = tolower(matchstr(line, '\zs[a-zA-Z1-6]*\ze:[^:[:space:]]\{-}$'))
c6296b0ad9ea updated for version 7.0151
vimboss
parents: 532
diff changeset
322 if ",a,abbr,acronym,address,area,b,base,bdo,big,blockquote,body,br,button,caption,cite,code,col,colgroup,dd,del,dfn,div,dl,dt,em,fieldset,form,head,h1,h2,h3,h4,h5,h6,hr,html,i,img,input,ins,kbd,label,legend,li,link,map,meta,noscript,object,ol,optgroup,option,p,param,pre,q,samp,script,select,small,span,strong,style,sub,sup,table,tbody,td,textarea,tfoot,th,thead,title,tr,tt,ul,var," =~ ','.element.','
c6296b0ad9ea updated for version 7.0151
vimboss
parents: 532
diff changeset
323 let values = ["first-child", "link", "visited", "hover", "active", "focus", "lang", "first-line", "first-letter", "before", "after"]
c6296b0ad9ea updated for version 7.0151
vimboss
parents: 532
diff changeset
324 else
c6296b0ad9ea updated for version 7.0151
vimboss
parents: 532
diff changeset
325 return []
c6296b0ad9ea updated for version 7.0151
vimboss
parents: 532
diff changeset
326 endif
531
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
327 endif
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
328
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
329 " Complete values
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
330 let entered_value = matchstr(line, '.\{-}\zs[a-zA-Z0-9#,.(_-]*$')
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
331
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
332 for m in values
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
333 if m =~? '^'.entered_value
548
f43150a669dc updated for version 7.0155
vimboss
parents: 539
diff changeset
334 call add(res, m)
531
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
335 elseif m =~? entered_value
548
f43150a669dc updated for version 7.0155
vimboss
parents: 539
diff changeset
336 call add(res2, m)
531
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
337 endif
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
338 endfor
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
339
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
340 return res + res2
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
341
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
342 elseif borders[min(keys(borders))] == 'closebrace'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
343
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
344 return []
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
345
532
7052f11a3dc9 updated for version 7.0150
vimboss
parents: 531
diff changeset
346 elseif borders[min(keys(borders))] == 'exclam'
7052f11a3dc9 updated for version 7.0150
vimboss
parents: 531
diff changeset
347
7052f11a3dc9 updated for version 7.0150
vimboss
parents: 531
diff changeset
348 " Complete values
7052f11a3dc9 updated for version 7.0150
vimboss
parents: 531
diff changeset
349 let entered_imp = matchstr(line, '.\{-}!\s*\zs[a-zA-Z ]*$')
7052f11a3dc9 updated for version 7.0150
vimboss
parents: 531
diff changeset
350
7052f11a3dc9 updated for version 7.0150
vimboss
parents: 531
diff changeset
351 let values = ["important"]
7052f11a3dc9 updated for version 7.0150
vimboss
parents: 531
diff changeset
352
7052f11a3dc9 updated for version 7.0150
vimboss
parents: 531
diff changeset
353 for m in values
7052f11a3dc9 updated for version 7.0150
vimboss
parents: 531
diff changeset
354 if m =~? '^'.entered_imp
548
f43150a669dc updated for version 7.0155
vimboss
parents: 539
diff changeset
355 call add(res, m)
532
7052f11a3dc9 updated for version 7.0150
vimboss
parents: 531
diff changeset
356 endif
7052f11a3dc9 updated for version 7.0150
vimboss
parents: 531
diff changeset
357 endfor
7052f11a3dc9 updated for version 7.0150
vimboss
parents: 531
diff changeset
358
7052f11a3dc9 updated for version 7.0150
vimboss
parents: 531
diff changeset
359 return res
7052f11a3dc9 updated for version 7.0150
vimboss
parents: 531
diff changeset
360
531
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
361 elseif borders[min(keys(borders))] == 'atrule'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
362
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
363 let afterat = matchstr(line, '.*@\zs.*')
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
364
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
365 if afterat =~ '\s'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
366
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
367 let atrulename = matchstr(line, '.*@\zs[a-zA-Z-]\+\ze')
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
368
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
369 if atrulename == 'media'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
370 let values = ["screen", "tty", "tv", "projection", "handheld", "print", "braille", "aural", "all"]
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
371
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
372 let atruleafterbase = matchstr(line, '.*@media\s\+\ze.*$')
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
373 let entered_atruleafter = matchstr(line, '.*@media\s\+\zs.*$')
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
374
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
375 elseif atrulename == 'import'
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
376 let atruleafterbase = matchstr(line, '.*@import\s\+\ze.*$')
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
377 let entered_atruleafter = matchstr(line, '.*@import\s\+\zs.*$')
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
378
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
379 if entered_atruleafter =~ "^[\"']"
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
380 let filestart = matchstr(entered_atruleafter, '^.\zs.*')
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
381 let files = split(glob(filestart.'*'), '\n')
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
382 let values = map(copy(files), '"\"".v:val')
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
383
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
384 elseif entered_atruleafter =~ "^url("
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
385 let filestart = matchstr(entered_atruleafter, "^url([\"']\\?\\zs.*")
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
386 let files = split(glob(filestart.'*'), '\n')
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
387 let values = map(copy(files), '"url(".v:val')
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
388
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
389 else
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
390 let values = ['"', 'url(']
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
391
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
392 endif
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
393
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
394 else
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
395 return []
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
396
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
397 endif
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
398
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
399 for m in values
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
400 if m =~? '^'.entered_atruleafter
548
f43150a669dc updated for version 7.0155
vimboss
parents: 539
diff changeset
401 call add(res, m)
531
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
402 elseif m =~? entered_atruleafter
548
f43150a669dc updated for version 7.0155
vimboss
parents: 539
diff changeset
403 call add(res2, m)
531
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
404 endif
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
405 endfor
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
406
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
407 return res + res2
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
408
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
409 endif
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
410
532
7052f11a3dc9 updated for version 7.0150
vimboss
parents: 531
diff changeset
411 let values = ["charset", "page", "media", "import", "font-face"]
531
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
412
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
413 let entered_atrule = matchstr(line, '.*@\zs[a-zA-Z-]*$')
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
414
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
415 for m in values
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
416 if m =~? '^'.entered_atrule
548
f43150a669dc updated for version 7.0155
vimboss
parents: 539
diff changeset
417 call add(res, m .' ')
531
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
418 elseif m =~? entered_atrule
548
f43150a669dc updated for version 7.0155
vimboss
parents: 539
diff changeset
419 call add(res2, m .' ')
531
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
420 endif
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
421 endfor
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
422
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
423 return res + res2
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
424
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
425 endif
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
426
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
427 return []
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
428
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
429 endif
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
430 endfunction