forked from VimPlug/emmet-vim
escape indent character if it's like '\t' (not "\t"). however, it won't beuseful for me.
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: 23-Jul-2012.
|
" Last Change: 24-Jul-2012.
|
||||||
|
|
||||||
let s:save_cpo = &cpo
|
let s:save_cpo = &cpo
|
||||||
set cpo&vim
|
set cpo&vim
|
||||||
@@ -322,6 +322,7 @@ function! zencoding#expandAbbr(mode, abbr) range
|
|||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
let expand = substitute(expand, '\$line\d*\$', '', 'g')
|
let expand = substitute(expand, '\$line\d*\$', '', 'g')
|
||||||
|
let expand = substitute(expand, '\$column\$', '', 'g')
|
||||||
let content = join(getline(a:firstline, a:lastline), "\n")
|
let content = join(getline(a:firstline, a:lastline), "\n")
|
||||||
if stridx(expand, '$#') < len(expand)-2
|
if stridx(expand, '$#') < len(expand)-2
|
||||||
let expand = substitute(expand, '^\(.*\)\$#\s*$', '\1', '')
|
let expand = substitute(expand, '^\(.*\)\$#\s*$', '\1', '')
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ function! zencoding#lang#css#parseIntoTree(abbr, type)
|
|||||||
let snippet = substitute(snippet, '|', '${cursor}', 'g')
|
let snippet = substitute(snippet, '|', '${cursor}', 'g')
|
||||||
endif
|
endif
|
||||||
let lines = split(snippet, "\n")
|
let lines = split(snippet, "\n")
|
||||||
call map(lines, 'substitute(v:val, "\\( \\|\\t\\)", indent, "g")')
|
call map(lines, 'substitute(v:val, "\\( \\|\\t\\)", escape(indent, "\\\\"), "g")')
|
||||||
let current.snippet = join(lines, "\n")
|
let current.snippet = join(lines, "\n")
|
||||||
let current.name = ''
|
let current.name = ''
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -88,8 +88,8 @@ function! zencoding#lang#haml#toString(settings, current, type, inline, filters,
|
|||||||
for child in current.child
|
for child in current.child
|
||||||
let inner .= zencoding#toString(child, type, inline, filters, itemno)
|
let inner .= zencoding#toString(child, type, inline, filters, itemno)
|
||||||
endfor
|
endfor
|
||||||
let inner = substitute(inner, "\n", "\n" . indent, 'g')
|
let inner = substitute(inner, "\n", "\n" . escape(indent, '\'), 'g')
|
||||||
let inner = substitute(inner, "\n" . indent . "$", "", 'g')
|
let inner = substitute(inner, "\n" . escape(indent, '\') . "$", "", 'g')
|
||||||
let str .= "\n" . indent . inner
|
let str .= "\n" . indent . inner
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ function! zencoding#lang#html#parseIntoTree(abbr, type)
|
|||||||
let snippet = substitute(snippet, '|', '${cursor}', 'g')
|
let snippet = substitute(snippet, '|', '${cursor}', 'g')
|
||||||
endif
|
endif
|
||||||
let lines = split(snippet, "\n")
|
let lines = split(snippet, "\n")
|
||||||
call map(lines, 'substitute(v:val, "\\( \\|\\t\\)", indent, "g")')
|
call map(lines, 'substitute(v:val, "\\( \\|\\t\\)", escape(indent, "\\\\"), "g")')
|
||||||
let current.snippet = join(lines, "\n")
|
let current.snippet = join(lines, "\n")
|
||||||
let current.name = ''
|
let current.name = ''
|
||||||
endif
|
endif
|
||||||
@@ -361,8 +361,8 @@ function! zencoding#lang#html#toString(settings, current, type, inline, filters,
|
|||||||
endif
|
endif
|
||||||
let inner = zencoding#toString(child, type, 0, filters, itemno)
|
let inner = zencoding#toString(child, type, 0, filters, itemno)
|
||||||
let inner = substitute(inner, "^\n", "", 'g')
|
let inner = substitute(inner, "^\n", "", 'g')
|
||||||
let inner = substitute(inner, "\n", "\n" . indent, 'g')
|
let inner = substitute(inner, "\n", "\n" . escape(indent, '\'), 'g')
|
||||||
let inner = substitute(inner, "\n" . indent . '$', '', 'g')
|
let inner = substitute(inner, "\n" . escape(indent, '\') . '$', '', 'g')
|
||||||
let str .= inner
|
let str .= inner
|
||||||
endfor
|
endfor
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -52,8 +52,8 @@ function! zencoding#lang#scss#toString(settings, current, type, inline, filters,
|
|||||||
for child in current.child
|
for child in current.child
|
||||||
let inner .= zencoding#toString(child, type, inline, filters, itemno)
|
let inner .= zencoding#toString(child, type, inline, filters, itemno)
|
||||||
endfor
|
endfor
|
||||||
let inner = substitute(inner, "\n", "\n" . indent, 'g')
|
let inner = substitute(inner, "\n", "\n" . escape(indent, '\'), 'g')
|
||||||
let inner = substitute(inner, "\n" . indent . "$", "", 'g')
|
let inner = substitute(inner, "\n" . escape(indent, '\') . "$", "", 'g')
|
||||||
let str .= indent . inner . "\n}\n"
|
let str .= indent . inner . "\n}\n"
|
||||||
else
|
else
|
||||||
return zencoding#lang#css#toString(settings, current, type, inline, filters, itemno, indent)
|
return zencoding#lang#css#toString(settings, current, type, inline, filters, itemno, indent)
|
||||||
|
|||||||
@@ -64,8 +64,8 @@ function! zencoding#lang#slim#toString(settings, current, type, inline, filters,
|
|||||||
for child in current.child
|
for child in current.child
|
||||||
let inner .= zencoding#toString(child, type, inline, filters, itemno)
|
let inner .= zencoding#toString(child, type, inline, filters, itemno)
|
||||||
endfor
|
endfor
|
||||||
let inner = substitute(inner, "\n", "\n" . indent, 'g')
|
let inner = substitute(inner, "\n", "\n" . escape(indent, '\'), 'g')
|
||||||
let inner = substitute(inner, "\n" . indent . "$", "", 'g')
|
let inner = substitute(inner, "\n" . escape(indent, '\') . "$", "", 'g')
|
||||||
let str .= "\n" . indent . inner
|
let str .= "\n" . indent . inner
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user