forked from VimPlug/emmet-vim
fixed ${nr}. and fixed multi-line text for haml & slim.
This commit is contained in:
@@ -35,7 +35,8 @@ function! zencoding#lang#haml#toString(settings, current, type, inline, filters,
|
||||
let str .= '.' . substitute(val, ' ', '.', 'g')
|
||||
else
|
||||
if len(tmp) > 0 | let tmp .= ',' | endif
|
||||
let tmp .= ' :' . attr . ' => "' . val . '"'
|
||||
let val = substitute(val, '\${cursor}', '', '')
|
||||
let tmp .= ' :' . attr . ' => "' . val . '${cursor}' . '"'
|
||||
endif
|
||||
endfor
|
||||
if len(tmp)
|
||||
@@ -52,10 +53,13 @@ function! zencoding#lang#haml#toString(settings, current, type, inline, filters,
|
||||
let text = substitute(text, '\${nr}', "\n", 'g')
|
||||
let text = substitute(text, '\\\$', '$', 'g')
|
||||
let lines = split(text, "\n")
|
||||
let str .= " " . lines[0]
|
||||
for line in lines[1:]
|
||||
let str .= " |\n" . line
|
||||
endfor
|
||||
if len(lines) == 1
|
||||
let str .= " " . text
|
||||
else
|
||||
for line in lines
|
||||
let str .= "\n" . indent . line . " |"
|
||||
endfor
|
||||
endif
|
||||
endif
|
||||
if len(current.child) == 1 && len(current.child[0].name) == 0
|
||||
let text = current.child[0].value[1:-2]
|
||||
@@ -63,17 +67,20 @@ function! zencoding#lang#haml#toString(settings, current, type, inline, filters,
|
||||
let text = substitute(text, '\${nr}', "\n", 'g')
|
||||
let text = substitute(text, '\\\$', '$', 'g')
|
||||
let lines = split(text, "\n")
|
||||
let str .= " " . lines[0]
|
||||
for line in lines[1:]
|
||||
let str .= " |\n" . line
|
||||
endfor
|
||||
if len(lines) == 1
|
||||
let str .= " " . text
|
||||
else
|
||||
for line in lines
|
||||
let str .= "\n" . indent . line . " |"
|
||||
endfor
|
||||
endif
|
||||
elseif len(current.child) > 0
|
||||
for child in current.child
|
||||
let inner .= zencoding#toString(child, type, inline, filters, itemno)
|
||||
endfor
|
||||
let inner = substitute(inner, "\n", "\n ", 'g')
|
||||
let inner = substitute(inner, "\n $", "", 'g')
|
||||
let str .= "\n " . inner
|
||||
let inner = substitute(inner, "\n", "\n" . indent, 'g')
|
||||
let inner = substitute(inner, "\n" . indent . "$", "", 'g')
|
||||
let str .= "\n" . indent . inner
|
||||
endif
|
||||
else
|
||||
let str = current.value[1:-2]
|
||||
|
||||
Reference in New Issue
Block a user