mirror of
https://github.com/mattn/emmet-vim.git
synced 2025-12-07 19:24:27 +08:00
@@ -1,7 +1,7 @@
|
|||||||
"=============================================================================
|
"=============================================================================
|
||||||
" emmet.vim
|
" emmet.vim
|
||||||
" Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
|
" Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
|
||||||
" Last Change: 06-Aug-2013.
|
" Last Change: 08-Aug-2013.
|
||||||
|
|
||||||
let s:save_cpo = &cpo
|
let s:save_cpo = &cpo
|
||||||
set cpo&vim
|
set cpo&vim
|
||||||
@@ -199,7 +199,11 @@ function! emmet#toString(...)
|
|||||||
let text = current.value[1:-2]
|
let text = current.value[1:-2]
|
||||||
if dollar_expr
|
if dollar_expr
|
||||||
" TODO: regexp engine specified
|
" TODO: regexp engine specified
|
||||||
|
if exists('®expengine')
|
||||||
let text = substitute(text, '\%#=1\%(\\\)\@\<!\(\$\+\)\([^{#]\|$\)', '\=printf("%0".len(submatch(1))."d", max([itemno, group_itemno])+1).submatch(2)', 'g')
|
let text = substitute(text, '\%#=1\%(\\\)\@\<!\(\$\+\)\([^{#]\|$\)', '\=printf("%0".len(submatch(1))."d", max([itemno, group_itemno])+1).submatch(2)', 'g')
|
||||||
|
else
|
||||||
|
let text = substitute(text, '\%(\\\)\@\<!\(\$\+\)\([^{#]\|$\)', '\=printf("%0".len(submatch(1))."d", max([itemno, group_itemno])+1).submatch(2)', 'g')
|
||||||
|
endif
|
||||||
let text = substitute(text, '\${nr}', "\n", 'g')
|
let text = substitute(text, '\${nr}', "\n", 'g')
|
||||||
let text = substitute(text, '\\\$', '$', 'g')
|
let text = substitute(text, '\\\$', '$', 'g')
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -333,7 +333,11 @@ function! emmet#lang#html#toString(settings, current, type, inline, filters, ite
|
|||||||
let text = current.value[1:-2]
|
let text = current.value[1:-2]
|
||||||
if dollar_expr
|
if dollar_expr
|
||||||
" TODO: regexp engine specified
|
" TODO: regexp engine specified
|
||||||
|
if exists('®expengine')
|
||||||
let text = substitute(text, '\%#=1\%(\\\)\@\<!\(\$\+\)\([^{#]\|$\)', '\=printf("%0".len(submatch(1))."d", itemno+1).submatch(2)', 'g')
|
let text = substitute(text, '\%#=1\%(\\\)\@\<!\(\$\+\)\([^{#]\|$\)', '\=printf("%0".len(submatch(1))."d", itemno+1).submatch(2)', 'g')
|
||||||
|
else
|
||||||
|
let text = substitute(text, '\%(\\\)\@\<!\(\$\+\)\([^{#]\|$\)', '\=printf("%0".len(submatch(1))."d", itemno+1).submatch(2)', 'g')
|
||||||
|
endif
|
||||||
let text = substitute(text, '\${nr}', "\n", 'g')
|
let text = substitute(text, '\${nr}', "\n", 'g')
|
||||||
let text = substitute(text, '\\\$', '$', 'g')
|
let text = substitute(text, '\\\$', '$', 'g')
|
||||||
endif
|
endif
|
||||||
@@ -349,7 +353,11 @@ function! emmet#lang#html#toString(settings, current, type, inline, filters, ite
|
|||||||
if dollar_expr
|
if dollar_expr
|
||||||
while val =~ '\$\([^#{]\|$\)'
|
while val =~ '\$\([^#{]\|$\)'
|
||||||
" TODO: regexp engine specified
|
" TODO: regexp engine specified
|
||||||
|
if exists('®expengine')
|
||||||
let val = substitute(val, '\%#=1\(\$\+\)\([^{#]\|$\)', '\=printf("%0".len(submatch(1))."d", itemno+1).submatch(2)', 'g')
|
let val = substitute(val, '\%#=1\(\$\+\)\([^{#]\|$\)', '\=printf("%0".len(submatch(1))."d", itemno+1).submatch(2)', 'g')
|
||||||
|
else
|
||||||
|
let val = substitute(val, '\(\$\+\)\([^{#]\|$\)', '\=printf("%0".len(submatch(1))."d", itemno+1).submatch(2)', 'g')
|
||||||
|
endif
|
||||||
endwhile
|
endwhile
|
||||||
let attr = substitute(attr, '\$$', itemno+1, '')
|
let attr = substitute(attr, '\$$', itemno+1, '')
|
||||||
endif
|
endif
|
||||||
@@ -369,7 +377,11 @@ function! emmet#lang#html#toString(settings, current, type, inline, filters, ite
|
|||||||
let text = current.value[1:-2]
|
let text = current.value[1:-2]
|
||||||
if dollar_expr
|
if dollar_expr
|
||||||
" TODO: regexp engine specified
|
" TODO: regexp engine specified
|
||||||
|
if exists('®expengine')
|
||||||
let text = substitute(text, '\%#=1\%(\\\)\@\<!\(\$\+\)\([^{#]\|$\)', '\=printf("%0".len(submatch(1))."d", itemno+1).submatch(2)', 'g')
|
let text = substitute(text, '\%#=1\%(\\\)\@\<!\(\$\+\)\([^{#]\|$\)', '\=printf("%0".len(submatch(1))."d", itemno+1).submatch(2)', 'g')
|
||||||
|
else
|
||||||
|
let text = substitute(text, '\%(\\\)\@\<!\(\$\+\)\([^{#]\|$\)', '\=printf("%0".len(submatch(1))."d", itemno+1).submatch(2)', 'g')
|
||||||
|
endif
|
||||||
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')
|
let str = substitute(str, '\("\zs$#\ze"\|\s\zs\$#"\|"\$#\ze\s\)', text, 'g')
|
||||||
|
|||||||
Reference in New Issue
Block a user