mirror of
https://github.com/mattn/emmet-vim.git
synced 2025-12-08 11:34:46 +08:00
parenthesis for haml #216
This commit is contained in:
@@ -1671,6 +1671,7 @@ let s:emmet_settings = {
|
|||||||
\ ."\t%body\n"
|
\ ."\t%body\n"
|
||||||
\ ."\t\t${child}|\n",
|
\ ."\t\t${child}|\n",
|
||||||
\ },
|
\ },
|
||||||
|
\ 'parenthesis': '{}',
|
||||||
\ },
|
\ },
|
||||||
\ 'slim': {
|
\ 'slim': {
|
||||||
\ 'indentation': ' ',
|
\ 'indentation': ' ',
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ function! emmet#lang#haml#toString(settings, current, type, inline, filters, ite
|
|||||||
let itemno = a:itemno
|
let itemno = a:itemno
|
||||||
let indent = emmet#getIndentation(type)
|
let indent = emmet#getIndentation(type)
|
||||||
let dollar_expr = emmet#getResource(type, 'dollar_expr', 1)
|
let dollar_expr = emmet#getResource(type, 'dollar_expr', 1)
|
||||||
|
let parenthesis = emmet#getResource('haml', 'parenthesis', '()')
|
||||||
let str = ""
|
let str = ""
|
||||||
|
|
||||||
let comment_indent = ''
|
let comment_indent = ''
|
||||||
@@ -33,7 +34,7 @@ function! emmet#lang#haml#toString(settings, current, type, inline, filters, ite
|
|||||||
let Val = current.attr[attr]
|
let Val = current.attr[attr]
|
||||||
if type(Val) == 2 && Val == function('emmet#types#true')
|
if type(Val) == 2 && Val == function('emmet#types#true')
|
||||||
let tmp .= ' :' . attr . ' => true'
|
let tmp .= ' :' . attr . ' => true'
|
||||||
else
|
else
|
||||||
if dollar_expr
|
if dollar_expr
|
||||||
while Val =~ '\$\([^#{]\|$\)'
|
while Val =~ '\$\([^#{]\|$\)'
|
||||||
let Val = substitute(Val, '\(\$\+\)\([^{]\|$\)', '\=printf("%0".len(submatch(1))."d", itemno+1).submatch(2)', 'g')
|
let Val = substitute(Val, '\(\$\+\)\([^{]\|$\)', '\=printf("%0".len(submatch(1))."d", itemno+1).submatch(2)', 'g')
|
||||||
@@ -53,7 +54,7 @@ function! emmet#lang#haml#toString(settings, current, type, inline, filters, ite
|
|||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
if len(tmp)
|
if len(tmp)
|
||||||
let str .= '{' . tmp . ' }'
|
let str .= parenthesis[0] . tmp . ' '. parenthesis[1]
|
||||||
endif
|
endif
|
||||||
if stridx(','.settings.html.empty_elements.',', ','.current_name.',') != -1 && len(current.value) == 0
|
if stridx(','.settings.html.empty_elements.',', ','.current_name.',') != -1 && len(current.value) == 0
|
||||||
let str .= "/"
|
let str .= "/"
|
||||||
|
|||||||
Reference in New Issue
Block a user