1
1
" Vim completion script
2
2
" Language: HTML and XHTML
3
3
" Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
4
- " Last Change: 2006 Apr 24
4
+ " Last Change: 2006 Apr 30
5
5
6
6
function ! htmlcomplete#CompleteTags (findstart, base)
7
7
if a: findstart
@@ -23,7 +23,7 @@ function! htmlcomplete#CompleteTags(findstart, base)
23
23
" Handling of <style> tag {{{
24
24
let stylestart = searchpair (' <style\>' , ' ' , ' <\/style\>' , " bnW" )
25
25
let styleend = searchpair (' <style\>' , ' ' , ' <\/style\>' , " nW" )
26
- if stylestart != 0 && styleend != 0
26
+ if stylestart != 0 && styleend != 0
27
27
if stylestart <= curline && styleend >= curline
28
28
let start = col (' .' ) - 1
29
29
let b: csscompl = 1
@@ -36,7 +36,7 @@ function! htmlcomplete#CompleteTags(findstart, base)
36
36
" Handling of <script> tag {{{
37
37
let scriptstart = searchpair (' <script\>' , ' ' , ' <\/script\>' , " bnW" )
38
38
let scriptend = searchpair (' <script\>' , ' ' , ' <\/script\>' , " nW" )
39
- if scriptstart != 0 && scriptend != 0
39
+ if scriptstart != 0 && scriptend != 0
40
40
if scriptstart <= curline && scriptend >= curline
41
41
let start = col (' .' ) - 1
42
42
let b: jscompl = 1
@@ -109,7 +109,7 @@ function! htmlcomplete#CompleteTags(findstart, base)
109
109
endwhile
110
110
endif
111
111
" If b:compl_context begins with <? we are inside of PHP code. It
112
- " wasn't closed so PHP completion passed it to HTML
112
+ " wasn't closed so PHP completion passed it to HTML
113
113
if &filetype = ~? ' php' && b: compl_context = ~ ' ^<?'
114
114
let b: phpcompl = 1
115
115
let start = col (' .' ) - 1
@@ -200,7 +200,7 @@ function! htmlcomplete#CompleteTags(findstart, base)
200
200
201
201
" If context contains > it means we are already outside of tag and we
202
202
" should abandon action
203
- " If context contains white space it is attribute.
203
+ " If context contains white space it is attribute.
204
204
" It can be also value of attribute.
205
205
" We have to get first word to offer proper completions
206
206
if context == ' '
@@ -353,7 +353,7 @@ function! htmlcomplete#CompleteTags(findstart, base)
353
353
let filelines = getline (1 , line (' $' ))
354
354
" 2. Find lines with possible id
355
355
let used_id_lines = filter (filelines, ' v:val =~ "id\\s*=\\s*[\"'' ][a-zA-Z0-9_-]\\+"' )
356
- " 3a. Join all filtered lines
356
+ " 3a. Join all filtered lines
357
357
let id_string = join (used_id_lines, ' ' )
358
358
" 3b. And split them to be sure each id is in separate item
359
359
let id_list = split (id_string, ' id\s*=\s*' )
@@ -432,7 +432,7 @@ function! htmlcomplete#CompleteTags(findstart, base)
432
432
return javascriptcomplete#CompleteJS (0 , js_context)
433
433
434
434
endif
435
-
435
+
436
436
" }}}
437
437
let stripbase = matchstr (context, " .*\\ (on[a-zA-Z]*\\ |style\\ |class\\ )\\ s*=\\ s*[\" ']\\ zs.*" )
438
438
" Now we have context stripped from all chars up to style/class.
@@ -508,7 +508,7 @@ function! htmlcomplete#CompleteTags(findstart, base)
508
508
call htmlcomplete#LoadData ()
509
509
endif
510
510
" }}}
511
-
511
+
512
512
if has_key (b: html_omni , tag )
513
513
let attrs = keys (b: html_omni [tag ][1 ])
514
514
else
@@ -600,7 +600,7 @@ function! htmlcomplete#CompleteTags(findstart, base)
600
600
endif
601
601
endif
602
602
" }}}
603
-
603
+
604
604
if exists (" uppercase_tag" ) && uppercase_tag == 1
605
605
let context = tolower (context)
606
606
endif
0 commit comments