indentation for each languages. replace $$$ as '111'.

This commit is contained in:
mattn
2010-02-22 12:15:33 +09:00
parent a28a0ed4e0
commit 3c318a2b8f
2 changed files with 11 additions and 4 deletions

View File

@@ -2,7 +2,7 @@
" File: zencoding.vim
" Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
" Last Change: 22-Feb-2010.
" Version: 0.13
" Version: 0.14
" WebPage: http://github.com/mattn/zencoding-vim
" Description: vim plugins for HTML and CSS hi-speed coding.
" SeeAlso: http://code.google.com/p/zen-coding/
@@ -927,15 +927,19 @@ function! s:zen_toString(...)
endif
if len(type) == 0 | let type = 'html' | endif
let indent = s:zen_settings['indentation']
if has_key(s:zen_settings[type], 'indentation')
let indent = s:zen_settings[type]['indentation']
else
let indent = s:zen_settings['indentation']
endif
let m = 0
let str = ''
while m < current['multiplier']
if len(current['name']) && type == 'html'
let str .= '<' . current['name']
for attr in keys(current['attr'])
if current['multiplier'] > 1 && current['attr'][attr] =~ '\$$'
let str .= ' ' . attr . '="' . current['attr'][attr][:-2] . (m+1) . '"'
if current['multiplier'] > 1 && current['attr'][attr] =~ '\$'
let str .= ' ' . attr . '="' . substitute(current['attr'][attr], '\$', m+1, 'g') . '"'
else
let str .= ' ' . attr . '="' . current['attr'][attr] . '"'
endif
@@ -1092,5 +1096,6 @@ endif
"echo ZenExpand('div#header + div#footer', '')
"echo ZenExpand('#header + div#footer', '')
"echo ZenExpand('#header > ul > li < p{Footer}', '')
"echo ZenExpand('a#foo$$$*3', '')
" vim:set et:

View File

@@ -67,6 +67,8 @@ install_details: |
copy zencoding.vim to your plugin directory.
versions:
- '0.14': |
This is an upgrade for ZenCoding.vim: indentation for each languages.
- '0.13': |
This is an upgrade for ZenCoding.vim: user key map.
- '0.12': |