Skip to content

Commit c7595d2

Browse files
committed
Fix bug while called from htmlcomplete.vim
1 parent b965f99 commit c7595d2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

autoload/csscomplete.vim

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ function! csscomplete#CompleteCSS(findstart, base)
2020
while start >= 0 && line[start - 1] =~ '\%(\k\|-\)'
2121
let start -= 1
2222
endwhile
23-
let b:after = line[compl_begin :]
2423
let b:compl_context = line[0:compl_begin]
2524
return start
2625
endif
@@ -38,11 +37,14 @@ function! csscomplete#CompleteCSS(findstart, base)
3837
" 5. if @ complete at-rule
3938
" 6. if ! complete important
4039
if exists("b:compl_context")
40+
let line = getline('.')
41+
let compl_begin = col('.') - 2
42+
let after = line[compl_begin:]
4143
let line = b:compl_context
42-
let after = b:after
4344
unlet! b:compl_context
4445
else
4546
let line = a:base
47+
let after = ''
4648
endif
4749

4850
let res = []

0 commit comments

Comments
 (0)