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

@@ -60,6 +60,11 @@ function! zencoding#lang#slim#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
if str !~ "\n$"
let str .= "\n"
@@ -88,6 +93,9 @@ function! zencoding#lang#slim#imageSize()
call setline('.', substitute(matchstr(line, '^\s*') . slim, "\n", "", "g"))
endfunction
function! zencoding#lang#slim#encodeImage()
endfunction
function! zencoding#lang#slim#parseTag(tag)
let current = { 'name': '', 'attr': {}, 'child': [], 'snippet': '', 'multiplier': 1, 'parent': {}, 'value': '', 'pos': 0 }
let mx = '\([a-zA-Z][a-zA-Z0-9]*\)\s\+\(.*\)'