diff --git a/runtime/autoload/htmlcomplete.vim b/runtime/autoload/htmlcomplete.vim
index 248426801e..733fff5215 100644
--- a/runtime/autoload/htmlcomplete.vim
+++ b/runtime/autoload/htmlcomplete.vim
@@ -1,7 +1,7 @@
" Vim completion script
" Language: HTML and XHTML
" Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
-" Last Change: 2006 Apr 20
+" Last Change: 2006 Apr 22
function! htmlcomplete#CompleteTags(findstart, base)
if a:findstart
@@ -10,7 +10,7 @@ function! htmlcomplete#CompleteTags(findstart, base)
let start = col('.') - 1
let curline = line('.')
let compl_begin = col('.') - 2
- while start >= 0 && line[start - 1] =~ '\(\k\|[:.-]\)'
+ while start >= 0 && line[start - 1] =~ '\(\k\|[!:.-]\)'
let start -= 1
endwhile
" Handling of entities {{{
@@ -94,12 +94,6 @@ function! htmlcomplete#CompleteTags(findstart, base)
break
endif
let i += 1
- " We reached first line and no tag approached
- " Prevents endless loop
- "if i > curline
- "let b:compl_context = ''
- "break
- "endif
endwhile
" Make sure we don't have counter
unlet! i
@@ -133,6 +127,8 @@ function! htmlcomplete#CompleteTags(findstart, base)
let res2 = []
" a:base is very short - we need context
let context = b:compl_context
+ let g:ab = a:base
+ let g:co = context
" Check if we should do CSS completion inside of