diff --git a/autoload/zencoding.vim b/autoload/zencoding.vim index 8e07ef4..1a4e4b9 100644 --- a/autoload/zencoding.vim +++ b/autoload/zencoding.vim @@ -50,7 +50,7 @@ endfunction function! zencoding#parseIntoTree(abbr, type) let abbr = a:abbr let type = a:type - let rtype = len(globpath(&rtp, 'autoload/zencoding/'.type.'.vim')) ? type : 'html' + let rtype = len(globpath(&rtp, 'autoload/zencoding/lang/'.type.'.vim')) ? type : 'html' return zencoding#lang#{rtype}#parseIntoTree(abbr, type) endfunction @@ -140,7 +140,7 @@ function! zencoding#toString(...) let use_pipe_for_cursor = zencoding#getResource(type, 'use_pipe_for_cursor', 1) while itemno < current.multiplier if len(current.name) - let rtype = len(globpath(&rtp, 'autoload/zencoding/'.type.'.vim')) ? type : 'html' + let rtype = len(globpath(&rtp, 'autoload/zencoding/lang/'.type.'.vim')) ? type : 'html' let inner = zencoding#lang#{rtype}#toString(s:zen_settings, current, type, inline, filters, itemno, indent) if current.multiplier > 1 let inner = substitute(inner, '\$#', '$line'.(itemno+1).'$', 'g') @@ -339,15 +339,8 @@ function! zencoding#expandAbbr(mode) range let part = matchstr(line, '\([a-zA-Z0-9:_\-\@|]\+\)$') else let part = matchstr(line, '\(\S.*\)$') - if zencoding#isExtends(type, "html") - while part =~ '<.\{-}>' - let part = substitute(part, '^.*<.\{-}>', '', '') - endwhile - let rtype = len(globpath(&rtp, 'autoload/zencoding/'.type.'.vim')) ? type : 'html' - let part = zencoding#lang#{rtype}#findTokens(part) - elseif zencoding#isExtends(type, "css") - let part = substitute(part, '^.*[;{]\s*', '', '') - endif + let rtype = len(globpath(&rtp, 'autoload/zencoding/lang/'.type.'.vim')) ? type : 'html' + let part = zencoding#lang#{rtype}#findTokens(part) endif let rest = getline('.')[len(line):] let str = part diff --git a/autoload/zencoding/lang/css.vim b/autoload/zencoding/lang/css.vim index 3f3f063..c4a4726 100644 --- a/autoload/zencoding/lang/css.vim +++ b/autoload/zencoding/lang/css.vim @@ -1,4 +1,6 @@ function! zencoding#lang#css#findTokens(str) + echo "fooooooooo" + echo getchar() return substitute(a:str, '^.*[;{]\s*', '', '') endfunction diff --git a/autoload/zencoding/lang/html.vim b/autoload/zencoding/lang/html.vim index 4ad94ff..490f29b 100644 --- a/autoload/zencoding/lang/html.vim +++ b/autoload/zencoding/lang/html.vim @@ -8,6 +8,9 @@ let s:mx = '\([+>]\|<\+\)\{-}\s*\((*\)\{-}\s*\([@#.]\{-}[a-zA-Z\!][a-zA-Z0-9:_\! function! zencoding#lang#html#findTokens(str) let str = a:str let [pos, last_pos] = [0, 0] + while str =~ '<.\{-}>' + let str = substitute(str, '^.*<.\{-}>', '', '') + endwhile while len(str) > 0 let token = matchstr(str, s:mx, pos) if token == ''