robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
fb6f27e86f
master
1" Vim completion script 2" Language: CSS 3" Based on MDN CSS Reference at 2016 Jan <https://developer.mozilla.org/en-US/docs/Web/CSS/Reference> 4" plus CSS Speech Module <http://www.w3.org/TR/css3-speech/> 5" Maintainer: Kao, Wei-Ko(othree) ( othree AT gmail DOT com ) 6" Original Author: Mikolaj Machowski ( mikmach AT wp DOT pl ) 7" Last Change: 2021 Sep 21 8 9let s: values = split ( "all additive-symbols align-content align-items align-self animation animation-delay animation-direction animation-duration animation-fill-mode animation-iteration-count animation-name animation-play-state animation-timing-function backface-visibility background background-attachment background-blend-mode background-clip background-color background-image background-origin background-position background-repeat background-size block-size border border-block-end border-block-end-color border-block-end-style border-block-end-width border-block-start border-block-start-color border-block-start-style border-block-start-width border-bottom border-bottom-color border-bottom-left-radius border-bottom-right-radius border-bottom-style border-bottom-width border-collapse border-color border-image border-image-outset border-image-repeat border-image-slice border-image-source border-image-width border-inline-end border-inline-end-color border-inline-end-style border-inline-end-width border-inline-start border-inline-start-color border-inline-start-style border-inline-start-width border-left border-left-color border-left-style border-left-width border-radius border-right border-right-color border-right-style border-right-width border-spacing border-style border-top border-top-color border-top-left-radius border-top-right-radius border-top-style border-top-width border-width bottom box-decoration-break box-shadow box-sizing break-after break-before break-inside caption-side clear clip clip-path color columns column-count column-fill column-gap column-rule column-rule-color column-rule-style column-rule-width column-span column-width content counter-increment counter-reset cue cue-before cue-after cursor direction display empty-cells fallback filter flex flex-basis flex-direction flex-flow flex-grow flex-shrink flex-wrap float font font-family font-feature-settings font-kerning font-language-override font-size font-size-adjust font-stretch font-style font-synthesis font-variant font-variant-alternates font-variant-caps font-variant-east-asian font-variant-ligatures font-variant-numeric font-variant-position font-weight grid grid-area grid-auto-columns grid-auto-flow grid-auto-position grid-auto-rows grid-column grid-column-start grid-column-end grid-row grid-row-start grid-row-end grid-template grid-template-areas grid-template-rows grid-template-columns height hyphens image-rendering image-resolution image-orientation ime-mode inline-size isolation justify-content left letter-spacing line-break line-height list-style list-style-image list-style-position list-style-type margin margin-block-end margin-block-start margin-bottom margin-inline-end margin-inline-start margin-left margin-right margin-top marks mask mask-type max-block-size max-height max-inline-size max-width max-zoom min-block-size min-height min-inline-size min-width min-zoom mix-blend-mode negative object-fit object-position offset-block-end offset-block-start offset-inline-end offset-inline-start opacity order orientation orphans outline outline-color outline-offset outline-style outline-width overflow overflow-wrap overflow-x overflow-y pad padding padding-block-end padding-block-start padding-bottom padding-inline-end padding-inline-start padding-left padding-right padding-top page-break-after page-break-before page-break-inside pause-before pause-after pause perspective perspective-origin pointer-events position prefix quotes range resize rest rest-before rest-after right ruby-align ruby-merge ruby-position scroll-behavior scroll-snap-coordinate scroll-snap-destination scroll-snap-points-x scroll-snap-points-y scroll-snap-type scroll-snap-type-x scroll-snap-type-y shape-image-threshold shape-margin shape-outside speak speak-as suffix symbols system table-layout tab-size text-align text-align-last text-combine-upright text-decoration text-decoration-color text-decoration-line text-emphasis text-emphasis-color text-emphasis-position text-emphasis-style text-indent text-orientation text-overflow text-rendering text-shadow text-transform text-underline-position top touch-action transform transform-box transform-origin transform-style transition transition-delay transition-duration transition-property transition-timing-function unicode-bidi unicode-range user-zoom vertical-align visibility voice-balance voice-duration voice-family voice-pitch voice-rate voice-range voice-stress voice-volume white-space widows width will-change word-break word-spacing word-wrap writing-mode z-index zoom" ) 10 11 12function ! csscomplete#CompleteCSS ( findstart , base ) 13 14if a: findstart 15" We need whole line to proper checking 16let line = getline ( '.' ) 17let start = col ( '.' ) - 1 18let compl_begin = col ( '.' ) - 2 19while start >= 0 && line [ start - 1 ] =~ '\%(\k\|-\)' 20let start -= 1 21endwhile 22let b: compl_context = line [ 0 : compl_begin ] 23return start 24endif 25 26" There are few chars important for context: 27" ^ ; : { } /* */ 28" Where ^ is start of line and /* */ are comment borders 29" Depending on their relative position to cursor we will know what should 30" be completed. 31" 1. if nearest are ^ or { or ; current word is property 32" 2. if : it is value (with exception of pseudo things) 33" 3. if } we are outside of css definitions 34" 4. for comments ignoring is be the easiest but assume they are the same 35" as 1. 36" 5. if @ complete at-rule 37" 6. if ! complete important 38if exists ( "b:compl_context" ) 39let line = getline ( '.' ) 40let compl_begin = col ( '.' ) - 2 41let b: after = line [ compl_begin :] 42let line = b: compl_context 43unlet ! b: compl_context 44else 45let line = a: base 46let b: after = '' 47endif 48 49let res = [] 50let res2 = [] 51let borders = {} 52 53" Check last occurrence of sequence 54 55let openbrace = strridx ( line , '{' ) 56let closebrace = strridx ( line , '}' ) 57let colon = strridx ( line , ':' ) 58let semicolon = strridx ( line , ';' ) 59let opencomm = strridx ( line , '/*' ) 60let closecomm = strridx ( line , '*/' ) 61let style = strridx ( line , 'style\s*=' ) 62let atrule = strridx ( line , '@' ) 63let exclam = strridx ( line , '!' ) 64 65if openbrace > -1 66let borders [ openbrace ] = "openbrace" 67endif 68if closebrace > -1 69let borders [ closebrace ] = "closebrace" 70endif 71if colon > -1 72let borders [ colon ] = "colon" 73endif 74if semicolon > -1 75let borders [ semicolon ] = "semicolon" 76endif 77if opencomm > -1 78let borders [ opencomm ] = "opencomm" 79endif 80if closecomm > -1 81let borders [ closecomm ] = "closecomm" 82endif 83if style > -1 84let borders [ style ] = "style" 85endif 86if atrule > -1 87let borders [ atrule ] = "atrule" 88endif 89if exclam > -1 90let borders [ exclam ] = "exclam" 91endif 92 93 94if len ( borders ) == 0 || borders [ max ( keys ( borders ))] =~ '^\%(openbrace\|semicolon\|opencomm\|closecomm\|style\)$' 95" Complete properties 96 97 98let entered_property = matchstr ( line , '.\{-}\zs[a-zA-Z-]*$' ) 99 100for m in s: values 101if m =~? '^' . entered_property 102call add ( res , m . ':' ) 103elseif m =~? entered_property 104call add ( res2 , m . ':' ) 105endif 106endfor 107 108return res + res2 109 110elseif borders [ max ( keys ( borders ))] == 'colon' 111" Get name of property 112let prop = tolower ( matchstr ( line , '\zs[a-zA-Z-]*\ze\s*:[^:]\{-}$' )) 113 114let wide_keywords = [ "initial" , "inherit" , "unset" ] 115let color_values = [ "transparent" , "rgb(" , "rgba(" , "hsl(" , "hsla(" , "#" ] 116let border_style_values = [ "none" , "hidden" , "dotted" , "dashed" , "solid" , "double" , "groove" , "ridge" , "inset" , "outset" ] 117let border_width_values = [ "thin" , "thick" , "medium" ] 118let list_style_type_values = [ "decimal" , "decimal-leading-zero" , "arabic-indic" , "armenian" , "upper-armenian" , "lower-armenian" , "bengali" , "cambodian" , "khmer" , "cjk-decimal" , "devanagari" , "georgian" , "gujarati" , "gurmukhi" , "hebrew" , "kannada" , "lao" , "malayalam" , "mongolian" , "myanmar" , "oriya" , "persian" , "lower-roman" , "upper-roman" , "tamil" , "telugu" , "thai" , "tibetan" , "lower-alpha" , "lower-latin" , "upper-alpha" , "upper-latin" , "cjk-earthly-branch" , "cjk-heavenly-stem" , "lower-greek" , "hiragana" , "hiragana-iroha" , "katakana" , "katakana-iroha" , "disc" , "circle" , "square" , "disclosure-open" , "disclosure-closed" ] 119let timing_functions = [ "cubic-bezier(" , "steps(" , "linear" , "ease" , "ease-in" , "ease-in-out" , "ease-out" , "step-start" , "step-end" ] 120 121if prop == 'all' 122let values = [] 123elseif prop == 'additive-symbols' 124let values = [] 125elseif prop == 'align-content' 126let values = [ "flex-start" , "flex-end" , "center" , "space-between" , "space-around" , "stretch" ] 127elseif prop == 'align-items' 128let values = [ "flex-start" , "flex-end" , "center" , "baseline" , "stretch" ] 129elseif prop == 'align-self' 130let values = [ "auto" , "flex-start" , "flex-end" , "center" , "baseline" , "stretch" ] 131elseif prop == 'animation' 132let values = timing_functions + [ "normal" , "reverse" , "alternate" , "alternate-reverse" ] + [ "none" , "forwards" , "backwards" , "both" ] + [ "running" , "paused" ] 133elseif prop == 'animation-delay' 134let values = [] 135elseif prop == 'animation-direction' 136let values = [ "normal" , "reverse" , "alternate" , "alternate-reverse" ] 137elseif prop == 'animation-duration' 138let values = [] 139elseif prop == 'animation-fill-mode' 140let values = [ "none" , "forwards" , "backwards" , "both" ] 141elseif prop == 'animation-iteration-count' 142let values = [] 143elseif prop == 'animation-name' 144let values = [] 145elseif prop == 'animation-play-state' 146let values = [ "running" , "paused" ] 147elseif prop == 'animation-timing-function' 148let values = timing_functions 149elseif prop == 'background-attachment' 150let values = [ "scroll" , "fixed" ] 151elseif prop == 'background-color' 152let values = color_values 153elseif prop == 'background-image' 154let values = [ "url(" , "none" ] 155elseif prop == 'background-position' 156let vals = matchstr ( line , '.*:\s*\zs.*' ) 157if vals =~ '^\%([a-zA-Z]\+\)\?$' 158let values = [ "top" , "center" , "bottom" ] 159elseif vals =~ '^[a-zA-Z]\+\s\+\%([a-zA-Z]\+\)\?$' 160let values = [ "left" , "center" , "right" ] 161else 162return [] 163endif 164elseif prop == 'background-repeat' 165let values = [ "repeat" , "repeat-x" , "repeat-y" , "no-repeat" ] 166elseif prop == 'background-size' 167let values = [ "auto" , "contain" , "cover" ] 168elseif prop == 'background' 169let values = [ "scroll" , "fixed" ] + color_values + [ "url(" , "none" ] + [ "top" , "center" , "bottom" , "left" , "right" ] + [ "repeat" , "repeat-x" , "repeat-y" , "no-repeat" ] + [ "auto" , "contain" , "cover" ] 170elseif prop =~ 'border\%(-top\|-right\|-bottom\|-left\|-block-start\|-block-end\)\?$' 171let vals = matchstr ( line , '.*:\s*\zs.*' ) 172if vals =~ '^\%([a-zA-Z0-9.]\+\)\?$' 173let values = border_width_values 174elseif vals =~ '^[a-zA-Z0-9.]\+\s\+\%([a-zA-Z]\+\)\?$' 175let values = border_style_values 176elseif vals =~ '^[a-zA-Z0-9.]\+\s\+[a-zA-Z]\+\s\+\%([a-zA-Z(]\+\)\?$' 177let values = color_values 178else 179return [] 180endif 181elseif prop =~ 'border-\%(top\|right\|bottom\|left\|block-start\|block-end\)-color' 182let values = color_values 183elseif prop =~ 'border-\%(top\|right\|bottom\|left\|block-start\|block-end\)-style' 184let values = border_style_values 185elseif prop =~ 'border-\%(top\|right\|bottom\|left\|block-start\|block-end\)-width' 186let values = border_width_values 187elseif prop == 'border-color' 188let values = color_values 189elseif prop == 'border-style' 190let values = border_style_values 191elseif prop == 'border-width' 192let values = border_width_values 193elseif prop == 'bottom' 194let values = [ "auto" ] 195elseif prop == 'box-decoration-break' 196let values = [ "slice" , "clone" ] 197elseif prop == 'box-shadow' 198let values = [ "inset" ] 199elseif prop == 'box-sizing' 200let values = [ "border-box" , "content-box" ] 201elseif prop =~ 'break-\%(before\|after\)' 202let values = [ "auto" , "always" , "avoid" , "left" , "right" , "page" , "column" , "region" , "recto" , "verso" , "avoid-page" , "avoid-column" , "avoid-region" ] 203elseif prop == 'break-inside' 204let values = [ "auto" , "avoid" , "avoid-page" , "avoid-column" , "avoid-region" ] 205elseif prop == 'caption-side' 206let values = [ "top" , "bottom" ] 207elseif prop == 'clear' 208let values = [ "none" , "left" , "right" , "both" ] 209elseif prop == 'clip' 210let values = [ "auto" , "rect(" ] 211elseif prop == 'clip-path' 212let values = [ "fill-box" , "stroke-box" , "view-box" , "none" ] 213elseif prop == 'color' 214let values = color_values 215elseif prop == 'columns' 216let values = [] 217elseif prop == 'column-count' 218let values = [ 'auto' ] 219elseif prop == 'column-fill' 220let values = [ 'auto' , 'balance' ] 221elseif prop == 'column-rule-color' 222let values = color_values 223elseif prop == 'column-rule-style' 224let values = border_style_values 225elseif prop == 'column-rule-width' 226let values = border_width_values 227elseif prop == 'column-rule' 228let vals = matchstr ( line , '.*:\s*\zs.*' ) 229if vals =~ '^\%([a-zA-Z0-9.]\+\)\?$' 230let values = border_width_values 231elseif vals =~ '^[a-zA-Z0-9.]\+\s\+\%([a-zA-Z]\+\)\?$' 232let values = border_style_values 233elseif vals =~ '^[a-zA-Z0-9.]\+\s\+[a-zA-Z]\+\s\+\%([a-zA-Z(]\+\)\?$' 234let values = color_values 235else 236return [] 237endif 238elseif prop == 'column-span' 239let values = [ "none" , "all" ] 240elseif prop == 'column-width' 241let values = [ "auto" ] 242elseif prop == 'content' 243let values = [ "normal" , "attr(" , "open-quote" , "close-quote" , "no-open-quote" , "no-close-quote" ] 244elseif prop =~ 'counter-\%(increment\|reset\)$' 245let values = [ "none" ] 246elseif prop =~ 'cue\%(-after\|-before\)\=$' 247let values = [ "url(" ] 248elseif prop == 'cursor' 249let 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" ] 250elseif prop == 'direction' 251let values = [ "ltr" , "rtl" ] 252elseif prop == 'display' 253let values = [ "inline" , "block" , "list-item" , "inline-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" , "flex" , "inline-flex" , "grid" , "inline-grid" , "ruby" , "ruby-base" , "ruby-text" , "ruby-base-container" , "ruby-text-container" , "contents" ] 254elseif prop == 'elevation' 255let values = [ "below" , "level" , "above" , "higher" , "lower" ] 256elseif prop == 'empty-cells' 257let values = [ "show" , "hide" ] 258elseif prop == 'fallback' 259let values = list_style_type_values 260elseif prop == 'filter' 261let values = [ "blur(" , "brightness(" , "contrast(" , "drop-shadow(" , "grayscale(" , "hue-rotate(" , "invert(" , "opacity(" , "sepia(" , "saturate(" ] 262elseif prop == 'flex-basis' 263let values = [ "auto" , "content" ] 264elseif prop == 'flex-flow' 265let values = [ "row" , "row-reverse" , "column" , "column-reverse" , "nowrap" , "wrap" , "wrap-reverse" ] 266elseif prop == 'flex-grow' 267let values = [] 268elseif prop == 'flex-shrink' 269let values = [] 270elseif prop == 'flex-wrap' 271let values = [ "nowrap" , "wrap" , "wrap-reverse" ] 272elseif prop == 'flex' 273let values = [ "nowrap" , "wrap" , "wrap-reverse" ] + [ "row" , "row-reverse" , "column" , "column-reverse" , "nowrap" , "wrap" , "wrap-reverse" ] + [ "auto" , "content" ] 274elseif prop == 'float' 275let values = [ "left" , "right" , "none" ] 276elseif prop == 'font-family' 277let values = [ "sans-serif" , "serif" , "monospace" , "cursive" , "fantasy" ] 278elseif prop == 'font-feature-settings' 279let values = [ "normal" , '"aalt"' , '"abvf"' , '"abvm"' , '"abvs"' , '"afrc"' , '"akhn"' , '"blwf"' , '"blwm"' , '"blws"' , '"calt"' , '"case"' , '"ccmp"' , '"cfar"' , '"cjct"' , '"clig"' , '"cpct"' , '"cpsp"' , '"cswh"' , '"curs"' , '"cv' , '"c2pc"' , '"c2sc"' , '"dist"' , '"dlig"' , '"dnom"' , '"dtls"' , '"expt"' , '"falt"' , '"fin2"' , '"fin3"' , '"fina"' , '"flac"' , '"frac"' , '"fwid"' , '"half"' , '"haln"' , '"halt"' , '"hist"' , '"hkna"' , '"hlig"' , '"hngl"' , '"hojo"' , '"hwid"' , '"init"' , '"isol"' , '"ital"' , '"jalt"' , '"jp78"' , '"jp83"' , '"jp90"' , '"jp04"' , '"kern"' , '"lfbd"' , '"liga"' , '"ljmo"' , '"lnum"' , '"locl"' , '"ltra"' , '"ltrm"' , '"mark"' , '"med2"' , '"medi"' , '"mgrk"' , '"mkmk"' , '"mset"' , '"nalt"' , '"nlck"' , '"nukt"' , '"numr"' , '"onum"' , '"opbd"' , '"ordn"' , '"ornm"' , '"palt"' , '"pcap"' , '"pkna"' , '"pnum"' , '"pref"' , '"pres"' , '"pstf"' , '"psts"' , '"pwid"' , '"qwid"' , '"rand"' , '"rclt"' , '"rkrf"' , '"rlig"' , '"rphf"' , '"rtbd"' , '"rtla"' , '"rtlm"' , '"ruby"' , '"salt"' , '"sinf"' , '"size"' , '"smcp"' , '"smpl"' , '"ss01"' , '"ss02"' , '"ss03"' , '"ss04"' , '"ss05"' , '"ss06"' , '"ss07"' , '"ss08"' , '"ss09"' , '"ss10"' , '"ss11"' , '"ss12"' , '"ss13"' , '"ss14"' , '"ss15"' , '"ss16"' , '"ss17"' , '"ss18"' , '"ss19"' , '"ss20"' , '"ssty"' , '"stch"' , '"subs"' , '"sups"' , '"swsh"' , '"titl"' , '"tjmo"' , '"tnam"' , '"tnum"' , '"trad"' , '"twid"' , '"unic"' , '"valt"' , '"vatu"' , '"vert"' , '"vhal"' , '"vjmo"' , '"vkna"' , '"vkrn"' , '"vpal"' , '"vrt2"' , '"zero"' ] 280elseif prop == 'font-kerning' 281let values = [ "auto" , "normal" , "none" ] 282elseif prop == 'font-language-override' 283let values = [ "normal" ] 284elseif prop == 'font-size' 285let values = [ "xx-small" , "x-small" , "small" , "medium" , "large" , "x-large" , "xx-large" , "larger" , "smaller" ] 286elseif prop == 'font-size-adjust' 287let values = [] 288elseif prop == 'font-stretch' 289let values = [ "normal" , "ultra-condensed" , "extra-condensed" , "condensed" , "semi-condensed" , "semi-expanded" , "expanded" , "extra-expanded" , "ultra-expanded" ] 290elseif prop == 'font-style' 291let values = [ "normal" , "italic" , "oblique" ] 292elseif prop == 'font-synthesis' 293let values = [ "none" , "weight" , "style" ] 294elseif prop == 'font-variant-alternates' 295let values = [ "normal" , "historical-forms" , "stylistic(" , "styleset(" , "character-variant(" , "swash(" , "ornaments(" , "annotation(" ] 296elseif prop == 'font-variant-caps' 297let values = [ "normal" , "small-caps" , "all-small-caps" , "petite-caps" , "all-petite-caps" , "unicase" , "titling-caps" ] 298elseif prop == 'font-variant-asian' 299let values = [ "normal" , "ruby" , "jis78" , "jis83" , "jis90" , "jis04" , "simplified" , "traditional" ] 300elseif prop == 'font-variant-ligatures' 301let values = [ "normal" , "none" , "common-ligatures" , "no-common-ligatures" , "discretionary-ligatures" , "no-discretionary-ligatures" , "historical-ligatures" , "no-historical-ligatures" , "contextual" , "no-contextual" ] 302elseif prop == 'font-variant-numeric' 303let values = [ "normal" , "ordinal" , "slashed-zero" , "lining-nums" , "oldstyle-nums" , "proportional-nums" , "tabular-nums" , "diagonal-fractions" , "stacked-fractions" ] 304elseif prop == 'font-variant-position' 305let values = [ "normal" , "sub" , "super" ] 306elseif prop == 'font-variant' 307let values = [ "normal" , "historical-forms" , "stylistic(" , "styleset(" , "character-variant(" , "swash(" , "ornaments(" , "annotation(" ] + [ "small-caps" , "all-small-caps" , "petite-caps" , "all-petite-caps" , "unicase" , "titling-caps" ] + [ "ruby" , "jis78" , "jis83" , "jis90" , "jis04" , "simplified" , "traditional" ] + [ "none" , "common-ligatures" , "no-common-ligatures" , "discretionary-ligatures" , "no-discretionary-ligatures" , "historical-ligatures" , "no-historical-ligatures" , "contextual" , "no-contextual" ] + [ "ordinal" , "slashed-zero" , "lining-nums" , "oldstyle-nums" , "proportional-nums" , "tabular-nums" , "diagonal-fractions" , "stacked-fractions" ] + [ "sub" , "super" ] 308elseif prop == 'font-weight' 309let values = [ "normal" , "bold" , "bolder" , "lighter" , "100" , "200" , "300" , "400" , "500" , "600" , "700" , "800" , "900" ] 310elseif prop == 'font' 311let 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" ] 312elseif prop =~ '^\%(height\|width\)$' 313let values = [ "auto" , "border-box" , "content-box" , "max-content" , "min-content" , "available" , "fit-content" ] 314elseif prop =~ '^\%(left\|right\)$' 315let values = [ "auto" ] 316elseif prop == 'image-rendering' 317let values = [ "auto" , "crisp-edges" , "pixelated" ] 318elseif prop == 'image-orientation' 319let values = [ "from-image" , "flip" ] 320elseif prop == 'ime-mode' 321let values = [ "auto" , "normal" , "active" , "inactive" , "disabled" ] 322elseif prop == 'inline-size' 323let values = [ "auto" , "border-box" , "content-box" , "max-content" , "min-content" , "available" , "fit-content" ] 324elseif prop == 'isolation' 325let values = [ "auto" , "isolate" ] 326elseif prop == 'justify-content' 327let values = [ "flex-start" , "flex-end" , "center" , "space-between" , "space-around" ] 328elseif prop == 'letter-spacing' 329let values = [ "normal" ] 330elseif prop == 'line-break' 331let values = [ "auto" , "loose" , "normal" , "strict" ] 332elseif prop == 'line-height' 333let values = [ "normal" ] 334elseif prop == 'list-style-image' 335let values = [ "url(" , "none" ] 336elseif prop == 'list-style-position' 337let values = [ "inside" , "outside" ] 338elseif prop == 'list-style-type' 339let values = list_style_type_values 340elseif prop == 'list-style' 341let values = list_style_type_values + [ "inside" , "outside" ] + [ "url(" , "none" ] 342elseif prop == 'margin' 343let values = [ "auto" ] 344elseif prop =~ 'margin-\%(right\|left\|top\|bottom\|block-start\|block-end\|inline-start\|inline-end\)$' 345let values = [ "auto" ] 346elseif prop == 'marks' 347let values = [ "crop" , "cross" , "none" ] 348elseif prop == 'mask' 349let values = [ "url(" ] 350elseif prop == 'mask-type' 351let values = [ "luminance" , "alpha" ] 352elseif prop == '\%(max\|min\)-\%(block\|inline\)-size' 353let values = [ "auto" , "border-box" , "content-box" , "max-content" , "min-content" , "available" , "fit-content" ] 354elseif prop == '\%(max\|min\)-\%(height\|width\)' 355let values = [ "auto" , "border-box" , "content-box" , "max-content" , "min-content" , "available" , "fit-content" ] 356elseif prop == '\%(max\|min\)-zoom' 357let values = [ "auto" ] 358elseif prop == 'mix-blend-mode' 359let values = [ "normal" , "multiply" , "screen" , "overlay" , "darken" , "lighten" , "color-dodge" , "color-burn" , "hard-light" , "soft-light" , "difference" , "exclusion" , "hue" , "saturation" , "color" , "luminosity" ] 360elseif prop == 'opacity' 361let values = [] 362elseif prop == 'orientation' 363let values = [ "auto" , "portrait" , "landscape" ] 364elseif prop == 'orphans' 365let values = [] 366elseif prop == 'outline-offset' 367let values = [] 368elseif prop == 'outline-color' 369let values = color_values 370elseif prop == 'outline-style' 371let values = [ "none" , "hidden" , "dotted" , "dashed" , "solid" , "double" , "groove" , "ridge" , "inset" , "outset" ] 372elseif prop == 'outline-width' 373let values = [ "thin" , "thick" , "medium" ] 374elseif prop == 'outline' 375let vals = matchstr ( line , '.*:\s*\zs.*' ) 376if vals =~ '^\%([a-zA-Z0-9,()#]\+\)\?$' 377let values = color_values 378elseif vals =~ '^[a-zA-Z0-9,()#]\+\s\+\%([a-zA-Z]\+\)\?$' 379let values = [ "none" , "hidden" , "dotted" , "dashed" , "solid" , "double" , "groove" , "ridge" , "inset" , "outset" ] 380elseif vals =~ '^[a-zA-Z0-9,()#]\+\s\+[a-zA-Z]\+\s\+\%([a-zA-Z(]\+\)\?$' 381let values = [ "thin" , "thick" , "medium" ] 382else 383return [] 384endif 385elseif prop == 'overflow-wrap' 386let values = [ "normal" , "break-word" ] 387elseif prop =~ 'overflow\%(-x\|-y\)\=' 388let values = [ "visible" , "hidden" , "scroll" , "auto" ] 389elseif prop == 'pad' 390let values = [] 391elseif prop == 'padding' 392let values = [] 393elseif prop =~ 'padding-\%(top\|right\|bottom\|left\|inline-start\|inline-end\|block-start\|block-end\)$' 394let values = [] 395elseif prop =~ 'page-break-\%(after\|before\)$' 396let values = [ "auto" , "always" , "avoid" , "left" , "right" , "recto" , "verso" ] 397elseif prop == 'page-break-inside' 398let values = [ "auto" , "avoid" ] 399elseif prop =~ 'pause\%(-after\|-before\)\=$' 400let values = [ "none" , "x-weak" , "weak" , "medium" , "strong" , "x-strong" ] 401elseif prop == 'perspective' 402let values = [ "none" ] 403elseif prop == 'perspective-origin' 404let values = [ "top" , "bottom" , "left" , "center" , " right" ] 405elseif prop == 'pointer-events' 406let values = [ "auto" , "none" , "visiblePainted" , "visibleFill" , "visibleStroke" , "visible" , "painted" , "fill" , "stroke" , "all" ] 407elseif prop == 'position' 408let values = [ "static" , "relative" , "absolute" , "fixed" , "sticky" ] 409elseif prop == 'prefix' 410let values = [] 411elseif prop == 'quotes' 412let values = [ "none" ] 413elseif prop == 'range' 414let values = [ "auto" , "infinite" ] 415elseif prop == 'resize' 416let values = [ "none" , "both" , "horizontal" , "vertical" ] 417elseif prop =~ 'rest\%(-after\|-before\)\=$' 418let values = [ "none" , "x-weak" , "weak" , "medium" , "strong" , "x-strong" ] 419elseif prop == 'ruby-align' 420let values = [ "start" , "center" , "space-between" , "space-around" ] 421elseif prop == 'ruby-merge' 422let values = [ "separate" , "collapse" , "auto" ] 423elseif prop == 'ruby-position' 424let values = [ "over" , "under" , "inter-character" ] 425elseif prop == 'scroll-behavior' 426let values = [ "auto" , "smooth" ] 427elseif prop == 'scroll-snap-coordinate' 428let values = [ "none" ] 429elseif prop == 'scroll-snap-destination' 430return [] 431elseif prop == 'scroll-snap-points-\%(x\|y\)$' 432let values = [ "none" , "repeat(" ] 433elseif prop == 'scroll-snap-type\%(-x\|-y\)\=$' 434let values = [ "none" , "mandatory" , "proximity" ] 435elseif prop == 'shape-image-threshold' 436let values = [] 437elseif prop == 'shape-margin' 438let values = [] 439elseif prop == 'shape-outside' 440let values = [ "margin-box" , "border-box" , "padding-box" , "content-box" , 'inset(' , 'circle(' , 'ellipse(' , 'polygon(' , 'url(' ] 441elseif prop == 'speak' 442let values = [ "auto" , "none" , "normal" ] 443elseif prop == 'speak-as' 444let values = [ "auto" , "normal" , "spell-out" , "digits" ] 445elseif prop == 'src' 446let values = [ "url(" ] 447elseif prop == 'suffix' 448let values = [] 449elseif prop == 'symbols' 450let values = [] 451elseif prop == 'system' 452let vals = matchstr ( line , '.*:\s*\zs.*' ) 453if vals =~ '^extends' 454let values = list_style_type_values 455else 456let values = [ "cyclic" , "numeric" , "alphabetic" , "symbolic" , "additive" , "fixed" , "extends" ] 457endif 458elseif prop == 'table-layout' 459let values = [ "auto" , "fixed" ] 460elseif prop == 'tab-size' 461let values = [] 462elseif prop == 'text-align' 463let values = [ "start" , "end" , "left" , "right" , "center" , "justify" , "match-parent" ] 464elseif prop == 'text-align-last' 465let values = [ "auto" , "start" , "end" , "left" , "right" , "center" , "justify" ] 466elseif prop == 'text-combine-upright' 467let values = [ "none" , "all" , "digits" ] 468elseif prop == 'text-decoration-line' 469let values = [ "none" , "underline" , "overline" , "line-through" , "blink" ] 470elseif prop == 'text-decoration-color' 471let values = color_values 472elseif prop == 'text-decoration-style' 473let values = [ "solid" , "double" , "dotted" , "dashed" , "wavy" ] 474elseif prop == 'text-decoration' 475let values = [ "none" , "underline" , "overline" , "line-through" , "blink" ] + [ "solid" , "double" , "dotted" , "dashed" , "wavy" ] + color_values 476elseif prop == 'text-emphasis-color' 477let values = color_values 478elseif prop == 'text-emphasis-position' 479let values = [ "over" , "under" , "left" , "right" ] 480elseif prop == 'text-emphasis-style' 481let values = [ "none" , "filled" , "open" , "dot" , "circle" , "double-circle" , "triangle" , "sesame" ] 482elseif prop == 'text-emphasis' 483let values = color_values + [ "over" , "under" , "left" , "right" ] + [ "none" , "filled" , "open" , "dot" , "circle" , "double-circle" , "triangle" , "sesame" ] 484elseif prop == 'text-indent' 485let values = [ "hanging" , "each-line" ] 486elseif prop == 'text-orientation' 487let values = [ "mixed" , "upright" , "sideways" , "sideways-right" , "use-glyph-orientation" ] 488elseif prop == 'text-overflow' 489let values = [ "clip" , "ellipsis" ] 490elseif prop == 'text-rendering' 491let values = [ "auto" , "optimizeSpeed" , "optimizeLegibility" , "geometricPrecision" ] 492elseif prop == 'text-shadow' 493let values = color_values 494elseif prop == 'text-transform' 495let values = [ "capitalize" , "uppercase" , "lowercase" , "full-width" , "none" ] 496elseif prop == 'text-underline-position' 497let values = [ "auto" , "under" , "left" , "right" ] 498elseif prop == 'touch-action' 499let values = [ "auto" , "none" , "pan-x" , "pan-y" , "manipulation" , "pan-left" , "pan-right" , "pan-top" , "pan-down" ] 500elseif prop == 'transform' 501let values = [ "matrix(" , "translate(" , "translateX(" , "translateY(" , "scale(" , "scaleX(" , "scaleY(" , "rotate(" , "skew(" , "skewX(" , "skewY(" , "matrix3d(" , "translate3d(" , "translateZ(" , "scale3d(" , "scaleZ(" , "rotate3d(" , "rotateX(" , "rotateY(" , "rotateZ(" , "perspective(" ] 502elseif prop == 'transform-box' 503let values = [ "border-box" , "fill-box" , "view-box" ] 504elseif prop == 'transform-origin' 505let values = [ "left" , "center" , "right" , "top" , "bottom" ] 506elseif prop == 'transform-style' 507let values = [ "flat" , "preserve-3d" ] 508elseif prop == 'top' 509let values = [ "auto" ] 510elseif prop == 'transition-property' 511let values = [ "all" , "none" ] + s: values 512elseif prop == 'transition-duration' 513let values = [] 514elseif prop == 'transition-delay' 515let values = [] 516elseif prop == 'transition-timing-function' 517let values = timing_functions 518elseif prop == 'transition' 519let values = [ "all" , "none" ] + s: values + timing_functions 520elseif prop == 'unicode-bidi' 521let values = [ "normal" , "embed" , "isolate" , "bidi-override" , "isolate-override" , "plaintext" ] 522elseif prop == 'unicode-range' 523let values = [ "U+" ] 524elseif prop == 'user-zoom' 525let values = [ "zoom" , "fixed" ] 526elseif prop == 'vertical-align' 527let values = [ "baseline" , "sub" , "super" , "top" , "text-top" , "middle" , "bottom" , "text-bottom" ] 528elseif prop == 'visibility' 529let values = [ "visible" , "hidden" , "collapse" ] 530elseif prop == 'voice-volume' 531let values = [ "silent" , "x-soft" , "soft" , "medium" , "loud" , "x-loud" ] 532elseif prop == 'voice-balance' 533let values = [ "left" , "center" , "right" , "leftwards" , "rightwards" ] 534elseif prop == 'voice-family' 535let values = [] 536elseif prop == 'voice-rate' 537let values = [ "normal" , "x-slow" , "slow" , "medium" , "fast" , "x-fast" ] 538elseif prop == 'voice-pitch' 539let values = [ "absolute" , "x-low" , "low" , "medium" , "high" , "x-high" ] 540elseif prop == 'voice-range' 541let values = [ "absolute" , "x-low" , "low" , "medium" , "high" , "x-high" ] 542elseif prop == 'voice-stress' 543let values = [ "normal" , "strong" , "moderate" , "none" , "reduced " ] 544elseif prop == 'voice-duration' 545let values = [ "auto" ] 546elseif prop == 'white-space' 547let values = [ "normal" , "pre" , "nowrap" , "pre-wrap" , "pre-line" ] 548elseif prop == 'widows' 549let values = [] 550elseif prop == 'will-change' 551let values = [ "auto" , "scroll-position" , "contents" ] + s: values 552elseif prop == 'word-break' 553let values = [ "normal" , "break-all" , "keep-all" ] 554elseif prop == 'word-spacing' 555let values = [ "normal" ] 556elseif prop == 'word-wrap' 557let values = [ "normal" , "break-word" ] 558elseif prop == 'writing-mode' 559let values = [ "horizontal-tb" , "vertical-rl" , "vertical-lr" , "sideways-rl" , "sideways-lr" ] 560elseif prop == 'z-index' 561let values = [ "auto" ] 562elseif prop == 'zoom' 563let values = [ "auto" ] 564else 565" If no property match it is possible we are outside of {} and 566" trying to complete pseudo-(class|element) 567let element = tolower ( matchstr ( line , '\zs[a-zA-Z1-6]*\ze:[^:[:space:]]\{-}$' )) 568if stridx ( 'a,abbr,address,area,article,aside,audio,b,base,bdi,bdo,bgsound,blockquote,body,br,button,canvas,caption,center,cite,code,col,colgroup,command,content,data,datalist,dd,del,details,dfn,dialog,div,dl,dt,element,em,embed,fieldset,figcaption,figure,font,footer,form,frame,frameset,head,header,hgroup,hr,html,i,iframe,image,img,input,ins,isindex,kbd,keygen,label,legend,li,link,main,map,mark,menu,menuitem,meta,meter,nav,nobr,noframes,noscript,object,ol,optgroup,option,output,p,param,picture,pre,progress,q,rp,rt,rtc,ruby,s,samp,script,section,select,shadow,small,source,span,strong,style,sub,summary,sup,table,tbody,td,template,textarea,tfoot,th,thead,time,title,tr,track,u,ul,var,video,wbr' , ',' . element . ',' ) > -1 569let values = [ "active" , "any" , "checked" , "default" , "dir(" , "disabled" , "empty" , "enabled" , "first" , "first-child" , "first-of-type" , "fullscreen" , "focus" , "hover" , "indeterminate" , "in-range" , "invalid" , "lang(" , "last-child" , "last-of-type" , "left" , "link" , "not(" , "nth-child(" , "nth-last-child(" , "nth-last-of-type(" , "nth-of-type(" , "only-child" , "only-of-type" , "optional" , "out-of-range" , "read-only" , "read-write" , "required" , "right" , "root" , "scope" , "target" , "valid" , "visited" , "first-line" , "first-letter" , "before" , "after" , "selection" , "backdrop" ] 570else 571return [] 572endif 573endif 574 575let values = wide_keywords + values 576" Complete values 577let entered_value = matchstr ( line , '.\{-}\zs[a-zA-Z0-9#,.(_-]*$' ) 578 579for m in values 580if m =~? '^' . entered_value 581call add ( res , m ) 582elseif m =~? entered_value 583call add ( res2 , m ) 584endif 585endfor 586 587return res + res2 588 589elseif borders [ max ( keys ( borders ))] == 'closebrace' 590 591return [] 592 593elseif borders [ max ( keys ( borders ))] == 'exclam' 594 595" Complete values 596let entered_imp = matchstr ( line , '.\{-}!\s*\zs[a-zA-Z ]*$' ) 597 598let values = [ "important" ] 599 600for m in values 601if m =~? '^' . entered_imp 602call add ( res , m ) 603endif 604endfor 605 606return res 607 608elseif borders [ max ( keys ( borders ))] == 'atrule' 609 610let afterat = matchstr ( line , '.*@\zs.*' ) 611 612if afterat =~ '\s' 613 614let atrulename = matchstr ( line , '.*@\zs[a-zA-Z-]\+\ze' ) 615 616if atrulename == 'media' 617let entered_atruleafter = matchstr ( line , '.*@media\s\+\zs.*$' ) 618 619if entered_atruleafter =~ "([^)]*$" 620let entered_atruleafter = matchstr ( entered_atruleafter , '(\s*\zs[^)]*$' ) 621let values = [ "max-width" , "min-width" , "width" , "max-height" , "min-height" , "height" , "max-aspect-ration" , "min-aspect-ration" , "aspect-ratio" , "orientation" , "max-resolution" , "min-resolution" , "resolution" , "scan" , "grid" , "update-frequency" , "overflow-block" , "overflow-inline" , "max-color" , "min-color" , "color" , "max-color-index" , "min-color-index" , "color-index" , "monochrome" , "inverted-colors" , "pointer" , "hover" , "any-pointer" , "any-hover" , "light-level" , "scripting" ] 622else 623let values = [ "screen" , "print" , "speech" , "all" , "not" , "and" , "(" ] 624endif 625 626elseif atrulename == 'supports' 627let entered_atruleafter = matchstr ( line , '.*@supports\s\+\zs.*$' ) 628 629if entered_atruleafter =~ "([^)]*$" 630let entered_atruleafter = matchstr ( entered_atruleafter , '(\s*\zs.*$' ) 631let values = s: values 632else 633let values = [ "(" ] 634endif 635 636elseif atrulename == 'charset' 637let entered_atruleafter = matchstr ( line , '.*@charset\s\+\zs.*$' ) 638let values = [ 639 \'"UTF-8";' , '"ANSI_X3.4-1968";' , '"ISO_8859-1:1987";' , '"ISO_8859-2:1987";' , '"ISO_8859-3:1988";' , '"ISO_8859-4:1988";' , '"ISO_8859-5:1988";' , 640 \'"ISO_8859-6:1987";' , '"ISO_8859-7:1987";' , '"ISO_8859-8:1988";' , '"ISO_8859-9:1989";' , '"ISO-8859-10";' , '"ISO_6937-2-add";' , '"JIS_X0201";' , 641 \'"JIS_Encoding";' , '"Shift_JIS";' , '"Extended_UNIX_Code_Packed_Format_for_Japanese";' , '"Extended_UNIX_Code_Fixed_Width_for_Japanese";' , 642 \'"BS_4730";' , '"SEN_850200_C";' , '"IT";' , '"ES";' , '"DIN_66003";' , '"NS_4551-1";' , '"NF_Z_62-010";' , '"ISO-10646-UTF-1";' , '"ISO_646.basic:1983";' , 643 \'"INVARIANT";' , '"ISO_646.irv:1983";' , '"NATS-SEFI";' , '"NATS-SEFI-ADD";' , '"NATS-DANO";' , '"NATS-DANO-ADD";' , '"SEN_850200_B";' , '"KS_C_5601-1987";' , 644 \'"ISO-2022-KR";' , '"EUC-KR";' , '"ISO-2022-JP";' , '"ISO-2022-JP-2";' , '"JIS_C6220-1969-jp";' , '"JIS_C6220-1969-ro";' , '"PT";' , '"greek7-old";' , 645 \'"latin-greek";' , '"NF_Z_62-010_(1973)";' , '"Latin-greek-1";' , '"ISO_5427";' , '"JIS_C6226-1978";' , '"BS_viewdata";' , '"INIS";' , '"INIS-8";' , 646 \'"INIS-cyrillic";' , '"ISO_5427:1981";' , '"ISO_5428:1980";' , '"GB_1988-80";' , '"GB_2312-80";' , '"NS_4551-2";' , '"videotex-suppl";' , '"PT2";' , 647 \'"ES2";' , '"MSZ_7795.3";' , '"JIS_C6226-1983";' , '"greek7";' , '"ASMO_449";' , '"iso-ir-90";' , '"JIS_C6229-1984-a";' , '"JIS_C6229-1984-b";' , 648 \'"JIS_C6229-1984-b-add";' , '"JIS_C6229-1984-hand";' , '"JIS_C6229-1984-hand-add";' , '"JIS_C6229-1984-kana";' , '"ISO_2033-1983";' , 649 \'"ANSI_X3.110-1983";' , '"T.61-7bit";' , '"T.61-8bit";' , '"ECMA-cyrillic";' , '"CSA_Z243.4-1985-1";' , '"CSA_Z243.4-1985-2";' , '"CSA_Z243.4-1985-gr";' , 650 \'"ISO_8859-6-E";' , '"ISO_8859-6-I";' , '"T.101-G2";' , '"ISO_8859-8-E";' , '"ISO_8859-8-I";' , '"CSN_369103";' , '"JUS_I.B1.002";' , '"IEC_P27-1";' , 651 \'"JUS_I.B1.003-serb";' , '"JUS_I.B1.003-mac";' , '"greek-ccitt";' , '"NC_NC00-10:81";' , '"ISO_6937-2-25";' , '"GOST_19768-74";' , '"ISO_8859-supp";' , 652 \'"ISO_10367-box";' , '"latin-lap";' , '"JIS_X0212-1990";' , '"DS_2089";' , '"us-dk";' , '"dk-us";' , '"KSC5636";' , '"UNICODE-1-1-UTF-7";' , '"ISO-2022-CN";' , 653 \'"ISO-2022-CN-EXT";' , '"ISO-8859-13";' , '"ISO-8859-14";' , '"ISO-8859-15";' , '"ISO-8859-16";' , '"GBK";' , '"GB18030";' , '"OSD_EBCDIC_DF04_15";' , 654 \'"OSD_EBCDIC_DF03_IRV";' , '"OSD_EBCDIC_DF04_1";' , '"ISO-11548-1";' , '"KZ-1048";' , '"ISO-10646-UCS-2";' , '"ISO-10646-UCS-4";' , '"ISO-10646-UCS-Basic";' , 655 \'"ISO-10646-Unicode-Latin1";' , '"ISO-10646-J-1";' , '"ISO-Unicode-IBM-1261";' , '"ISO-Unicode-IBM-1268";' , '"ISO-Unicode-IBM-1276";' , 656 \'"ISO-Unicode-IBM-1264";' , '"ISO-Unicode-IBM-1265";' , '"UNICODE-1-1";' , '"SCSU";' , '"UTF-7";' , '"UTF-16BE";' , '"UTF-16LE";' , '"UTF-16";' , '"CESU-8";' , 657 \'"UTF-32";' , '"UTF-32BE";' , '"UTF-32LE";' , '"BOCU-1";' , '"ISO-8859-1-Windows-3.0-Latin-1";' , '"ISO-8859-1-Windows-3.1-Latin-1";' , 658 \'"ISO-8859-2-Windows-Latin-2";' , '"ISO-8859-9-Windows-Latin-5";' , '"hp-roman8";' , '"Adobe-Standard-Encoding";' , '"Ventura-US";' , 659 \'"Ventura-International";' , '"DEC-MCS";' , '"IBM850";' , '"PC8-Danish-Norwegian";' , '"IBM862";' , '"PC8-Turkish";' , '"IBM-Symbols";' , '"IBM-Thai";' , 660 \'"HP-Legal";' , '"HP-Pi-font";' , '"HP-Math8";' , '"Adobe-Symbol-Encoding";' , '"HP-DeskTop";' , '"Ventura-Math";' , '"Microsoft-Publishing";' , 661 \'"Windows-31J";' , '"GB2312";' , '"Big5";' , '"macintosh";' , '"IBM037";' , '"IBM038";' , '"IBM273";' , '"IBM274";' , '"IBM275";' , '"IBM277";' , '"IBM278";' , 662 \'"IBM280";' , '"IBM281";' , '"IBM284";' , '"IBM285";' , '"IBM290";' , '"IBM297";' , '"IBM420";' , '"IBM423";' , '"IBM424";' , '"IBM437";' , '"IBM500";' , '"IBM851";' , 663 \'"IBM852";' , '"IBM855";' , '"IBM857";' , '"IBM860";' , '"IBM861";' , '"IBM863";' , '"IBM864";' , '"IBM865";' , '"IBM868";' , '"IBM869";' , '"IBM870";' , '"IBM871";' , 664 \'"IBM880";' , '"IBM891";' , '"IBM903";' , '"IBM904";' , '"IBM905";' , '"IBM918";' , '"IBM1026";' , '"EBCDIC-AT-DE";' , '"EBCDIC-AT-DE-A";' , '"EBCDIC-CA-FR";' , 665 \'"EBCDIC-DK-NO";' , '"EBCDIC-DK-NO-A";' , '"EBCDIC-FI-SE";' , '"EBCDIC-FI-SE-A";' , '"EBCDIC-FR";' , '"EBCDIC-IT";' , '"EBCDIC-PT";' , '"EBCDIC-ES";' , 666 \'"EBCDIC-ES-A";' , '"EBCDIC-ES-S";' , '"EBCDIC-UK";' , '"EBCDIC-US";' , '"UNKNOWN-8BIT";' , '"MNEMONIC";' , '"MNEM";' , '"VISCII";' , '"VIQR";' , '"KOI8-R";' , 667 \'"HZ-GB-2312";' , '"IBM866";' , '"IBM775";' , '"KOI8-U";' , '"IBM00858";' , '"IBM00924";' , '"IBM01140";' , '"IBM01141";' , '"IBM01142";' , '"IBM01143";' , 668 \'"IBM01144";' , '"IBM01145";' , '"IBM01146";' , '"IBM01147";' , '"IBM01148";' , '"IBM01149";' , '"Big5-HKSCS";' , '"IBM1047";' , '"PTCP154";' , '"Amiga-1251";' , 669 \'"KOI7-switched";' , '"BRF";' , '"TSCII";' , '"windows-1250";' , '"windows-1251";' , '"windows-1252";' , '"windows-1253";' , '"windows-1254";' , '"windows-1255";' , 670 \'"windows-1256";' , '"windows-1257";' , '"windows-1258";' , '"TIS-620";' ] 671 672elseif atrulename == 'namespace' 673let entered_atruleafter = matchstr ( line , '.*@namespace\s\+\zs.*$' ) 674let values = [ "url(" ] 675 676elseif atrulename == 'document' 677let entered_atruleafter = matchstr ( line , '.*@document\s\+\zs.*$' ) 678let values = [ "url(" , "url-prefix(" , "domain(" , "regexp(" ] 679 680elseif atrulename == 'import' 681let entered_atruleafter = matchstr ( line , '.*@import\s\+\zs.*$' ) 682 683if entered_atruleafter =~ "^[\"']" 684let filestart = matchstr ( entered_atruleafter , '^.\zs.*' ) 685let files = split ( glob ( filestart . '*' ), '\n' ) 686let values = map ( copy ( files ), '"\"".v:val' ) 687 688elseif entered_atruleafter =~ "^url(" 689let filestart = matchstr ( entered_atruleafter , "^url([\"']\\?\\zs.*" ) 690let files = split ( glob ( filestart . '*' ), '\n' ) 691let values = map ( copy ( files ), '"url(".v:val' ) 692 693else 694let values = [ '"' , 'url(' ] 695 696endif 697 698else 699return [] 700 701endif 702 703for m in values 704if m =~? '^' . entered_atruleafter 705if entered_atruleafter =~? '^"' && m =~? '^"' 706let m = m [ 1 :] 707endif 708if b: after =~? '"' && stridx ( m , '"' ) > -1 709let m = m [ 0 : stridx ( m , '"' ) - 1 ] 710endif 711call add ( res , m ) 712elseif m =~? entered_atruleafter 713if m =~? '^"' 714let m = m [ 1 :] 715endif 716call add ( res2 , m ) 717endif 718endfor 719 720return res + res2 721 722endif 723 724let values = [ "charset" , "page" , "media" , "import" , "font-face" , "namespace" , "supports" , "keyframes" , "viewport" , "document" ] 725 726let entered_atrule = matchstr ( line , '.*@\zs[a-zA-Z-]*$' ) 727 728for m in values 729if m =~? '^' . entered_atrule 730call add ( res , m . ' ' ) 731elseif m =~? entered_atrule 732call add ( res2 , m . ' ' ) 733endif 734endfor 735 736return res + res2 737 738endif 739 740return [] 741 742endfunction