fix snippets for haml & slim.

This commit is contained in:
mattn
2012-06-11 19:15:45 +09:00
parent 5011ea1dc6
commit d19b2b4fcd
6 changed files with 109 additions and 24 deletions

View File

@@ -75,6 +75,11 @@ function! zencoding#lang#haml#toString(settings, current, type, inline, filters,
let inner = substitute(inner, "\n $", "", 'g')
let str .= "\n " . inner
endif
else
let str = current.value[1:-2]
let str = substitute(str, '\%(\\\)\@\<!\(\$\+\)\([^{#]\|$\)', '\=printf("%0".len(submatch(1))."d", itemno+1).submatch(2)', 'g')
let str = substitute(str, '\${nr}', "\n", 'g')
let str = substitute(str, '\\\$', '$', 'g')
endif
let str .= "\n"
return str
@@ -101,6 +106,9 @@ function! zencoding#lang#haml#imageSize()
call setline('.', substitute(matchstr(line, '^\s*') . haml, "\n", "", "g"))
endfunction
function! zencoding#lang#haml#encodeImage()
endfunction
function! zencoding#lang#haml#parseTag(tag)
let current = { 'name': '', 'attr': {}, 'child': [], 'snippet': '', 'multiplier': 1, 'parent': {}, 'value': '', 'pos': 0 }
let mx = '%\([a-zA-Z][a-zA-Z0-9]*\)\s*\%({\(.*\)}\)'