comparison runtime/autoload/csscomplete.vim @ 534:c6296b0ad9ea v7.0151

updated for version 7.0151
author vimboss
date Thu, 29 Sep 2005 18:26:07 +0000
parents 7052f11a3dc9
children b13dbb7b797c
comparison
equal deleted inserted replaced
533:c8b6b7e1005d 534:c6296b0ad9ea
1 " Vim completion script 1 " Vim completion script
2 " Language: CSS 2.1 2 " Language: CSS 2.1
3 " Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl ) 3 " Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
4 " Last Change: 2005 Sep 23 4 " Last Change: 2005 Sep 27
5 5
6 function! csscomplete#CompleteCSS(findstart, base) 6 function! csscomplete#CompleteCSS(findstart, base)
7 if a:findstart 7 if a:findstart
8 " We need whole line to proper checking 8 " We need whole line to proper checking
9 return 0 9 return 0
302 elseif prop == 'word-spacing' 302 elseif prop == 'word-spacing'
303 let values = ["normal"] 303 let values = ["normal"]
304 elseif prop == 'z-index' 304 elseif prop == 'z-index'
305 let values = ["auto"] 305 let values = ["auto"]
306 else 306 else
307 return [] 307 " If no property match it is possible we are outside of {} and
308 " trying to complete pseudo-(class|element)
309 let element = tolower(matchstr(line, '\zs[a-zA-Z1-6]*\ze:[^:[:space:]]\{-}$'))
310 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.','
311 let values = ["first-child", "link", "visited", "hover", "active", "focus", "lang", "first-line", "first-letter", "before", "after"]
312 else
313 return []
314 endif
308 endif 315 endif
309 316
310 " Complete values 317 " Complete values
311 let valbase = matchstr(line, '.\{-}\ze[a-zA-Z0-9#,.(_-]*$') 318 let valbase = matchstr(line, '.\{-}\ze[a-zA-Z0-9#,.(_-]*$')
312 let entered_value = matchstr(line, '.\{-}\zs[a-zA-Z0-9#,.(_-]*$') 319 let entered_value = matchstr(line, '.\{-}\zs[a-zA-Z0-9#,.(_-]*$')