forked from VimPlug/emmet-vim
find autoload/zencoding/lang/xxx.vim
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
function! zencoding#lang#css#findTokens(str)
|
||||
echo "fooooooooo"
|
||||
echo getchar()
|
||||
return substitute(a:str, '^.*[;{]\s*', '', '')
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -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 == ''
|
||||
|
||||
Reference in New Issue
Block a user