Mercurial > vim
comparison runtime/autoload/csscomplete.vim @ 856:8cd729851562 v7.0g
updated for version 7.0g
author | vimboss |
---|---|
date | Sun, 30 Apr 2006 18:54:39 +0000 |
parents | 249173daa651 |
children | e63691e7c504 |
comparison
equal
deleted
inserted
replaced
855:d2a4f08396fe | 856:8cd729851562 |
---|---|
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 Oct 12 | 4 " Last Change: 2006 Apr 30 |
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 let line = getline('.') | 9 let line = getline('.') |
17 else | 17 else |
18 " There are few chars important for context: | 18 " There are few chars important for context: |
19 " ^ ; : { } /* */ | 19 " ^ ; : { } /* */ |
20 " Where ^ is start of line and /* */ are comment borders | 20 " Where ^ is start of line and /* */ are comment borders |
21 " Depending on their relative position to cursor we will now what should | 21 " Depending on their relative position to cursor we will now what should |
22 " be completed. | 22 " be completed. |
23 " 1. if nearest are ^ or { or ; current word is property | 23 " 1. if nearest are ^ or { or ; current word is property |
24 " 2. if : it is value (with exception of pseudo things) | 24 " 2. if : it is value (with exception of pseudo things) |
25 " 3. if } we are outside of css definitions | 25 " 3. if } we are outside of css definitions |
26 " 4. for comments ignoring is be the easiest but assume they are the same | 26 " 4. for comments ignoring is be the easiest but assume they are the same |
27 " as 1. | 27 " as 1. |
28 " 5. if @ complete at-rule | 28 " 5. if @ complete at-rule |
29 " 6. if ! complete important | 29 " 6. if ! complete important |
30 if exists("b:compl_context") | 30 if exists("b:compl_context") |
31 let line = b:compl_context | 31 let line = b:compl_context |
32 unlet! b:compl_context | 32 unlet! b:compl_context |
383 | 383 |
384 elseif entered_atruleafter =~ "^url(" | 384 elseif entered_atruleafter =~ "^url(" |
385 let filestart = matchstr(entered_atruleafter, "^url([\"']\\?\\zs.*") | 385 let filestart = matchstr(entered_atruleafter, "^url([\"']\\?\\zs.*") |
386 let files = split(glob(filestart.'*'), '\n') | 386 let files = split(glob(filestart.'*'), '\n') |
387 let values = map(copy(files), '"url(".v:val') | 387 let values = map(copy(files), '"url(".v:val') |
388 | 388 |
389 else | 389 else |
390 let values = ['"', 'url('] | 390 let values = ['"', 'url('] |
391 | 391 |
392 endif | 392 endif |
393 | 393 |