mirror of
https://github.com/mattn/emmet-vim.git
synced 2025-12-07 11:14:26 +08:00
Expands $# as content. close #116
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
"=============================================================================
|
"=============================================================================
|
||||||
" zencoding.vim
|
" zencoding.vim
|
||||||
" Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
|
" Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
|
||||||
" Last Change: 26-Mar-2013.
|
" Last Change: 09-Apr-2013.
|
||||||
|
|
||||||
let s:save_cpo = &cpo
|
let s:save_cpo = &cpo
|
||||||
set cpo&vim
|
set cpo&vim
|
||||||
@@ -172,7 +172,7 @@ function! zencoding#toString(...)
|
|||||||
let inner = zencoding#lang#{rtype}#toString(s:zen_settings, current, type, inline, filters, itemno, indent)
|
let inner = zencoding#lang#{rtype}#toString(s:zen_settings, current, type, inline, filters, itemno, indent)
|
||||||
endif
|
endif
|
||||||
if current.multiplier > 1
|
if current.multiplier > 1
|
||||||
let inner = substitute(inner, '\$#', '$line'.(itemno+1).'$', 'g')
|
let inner = substitute(inner, '\("\zs$#\ze"\|\s\zs\$#"\|"\$#\ze\s\)', '$line'.(itemno+1).'$', 'g')
|
||||||
endif
|
endif
|
||||||
let str .= inner
|
let str .= inner
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ function! zencoding#lang#haml#toString(settings, current, type, inline, filters,
|
|||||||
let text = substitute(text, '\%(\\\)\@\<!\(\$\+\)\([^{#]\|$\)', '\=printf("%0".len(submatch(1))."d", itemno+1).submatch(2)', 'g')
|
let text = substitute(text, '\%(\\\)\@\<!\(\$\+\)\([^{#]\|$\)', '\=printf("%0".len(submatch(1))."d", itemno+1).submatch(2)', 'g')
|
||||||
let text = substitute(text, '\${nr}', "\n", 'g')
|
let text = substitute(text, '\${nr}', "\n", 'g')
|
||||||
let text = substitute(text, '\\\$', '$', 'g')
|
let text = substitute(text, '\\\$', '$', 'g')
|
||||||
|
let str = substitute(str, '\$#', text, 'g')
|
||||||
endif
|
endif
|
||||||
let lines = split(text, "\n")
|
let lines = split(text, "\n")
|
||||||
if len(lines) == 1
|
if len(lines) == 1
|
||||||
|
|||||||
@@ -351,6 +351,7 @@ function! zencoding#lang#html#toString(settings, current, type, inline, filters,
|
|||||||
let text = substitute(text, '\%(\\\)\@\<!\(\$\+\)\([^{#]\|$\)', '\=printf("%0".len(submatch(1))."d", itemno+1).submatch(2)', 'g')
|
let text = substitute(text, '\%(\\\)\@\<!\(\$\+\)\([^{#]\|$\)', '\=printf("%0".len(submatch(1))."d", itemno+1).submatch(2)', 'g')
|
||||||
let text = substitute(text, '\${nr}', "\n", 'g')
|
let text = substitute(text, '\${nr}', "\n", 'g')
|
||||||
let text = substitute(text, '\\\$', '$', 'g')
|
let text = substitute(text, '\\\$', '$', 'g')
|
||||||
|
let str = substitute(str, '\("\zs$#\ze"\|\s\zs\$#"\|"\$#\ze\s\)', text, 'g')
|
||||||
endif
|
endif
|
||||||
let str .= text
|
let str .= text
|
||||||
let nc = len(current.child)
|
let nc = len(current.child)
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ function! zencoding#lang#slim#toString(settings, current, type, inline, filters,
|
|||||||
let text = substitute(text, '\%(\\\)\@\<!\(\$\+\)\([^{#]\|$\)', '\=printf("%0".len(submatch(1))."d", itemno+1).submatch(2)', 'g')
|
let text = substitute(text, '\%(\\\)\@\<!\(\$\+\)\([^{#]\|$\)', '\=printf("%0".len(submatch(1))."d", itemno+1).submatch(2)', 'g')
|
||||||
let text = substitute(text, '\${nr}', "\n", 'g')
|
let text = substitute(text, '\${nr}', "\n", 'g')
|
||||||
let text = substitute(text, '\\\$', '$', 'g')
|
let text = substitute(text, '\\\$', '$', 'g')
|
||||||
|
let str = substitute(str, '\$#', text, 'g')
|
||||||
endif
|
endif
|
||||||
for line in split(text, "\n")
|
for line in split(text, "\n")
|
||||||
let str .= indent . "| " . line . "\n"
|
let str .= indent . "| " . line . "\n"
|
||||||
|
|||||||
Reference in New Issue
Block a user