fixed indent.

This commit is contained in:
mattn
2010-02-21 01:09:59 +09:00
parent 4ad297b80d
commit 0158596184
2 changed files with 12 additions and 9 deletions

View File

@@ -2,7 +2,7 @@
" File: zencoding.vim " File: zencoding.vim
" Author: Yasuhiro Matsumoto <mattn.jp@gmail.com> " Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
" Last Change: 21-Feb-2010. " Last Change: 21-Feb-2010.
" Version: 0.10 " Version: 0.11
" WebPage: http://github.com/mattn/zencoding-vim " WebPage: http://github.com/mattn/zencoding-vim
" Description: vim plugins for HTML and CSS hi-speed coding. " Description: vim plugins for HTML and CSS hi-speed coding.
" SeeAlso: http://code.google.com/p/zen-coding/ " SeeAlso: http://code.google.com/p/zen-coding/
@@ -66,7 +66,7 @@
" script type: plugin " script type: plugin
if &cp || (exists('g:loaded_zencoding_vim') && g:loaded_zencoding_vim) if &cp || (exists('g:loaded_zencoding_vim') && g:loaded_zencoding_vim)
finish "finish
endif endif
let g:loaded_zencoding_vim = 1 let g:loaded_zencoding_vim = 1
@@ -886,7 +886,7 @@ function! s:zen_parseIntoTree(abbr, type)
endif endif
call add(parent['child'], current) call add(parent['child'], current)
let last = current let last = current
if 1 if 0
echo "str=".str echo "str=".str
echo "tag_name=".tag_name echo "tag_name=".tag_name
echo "operator=".operator echo "operator=".operator
@@ -942,10 +942,10 @@ function! s:zen_toString(...)
if stridx(','.s:zen_settings[type]['block_elements'].',', ','.current['name'].',') != -1 && len(current['child']) if stridx(','.s:zen_settings[type]['block_elements'].',', ','.current['name'].',') != -1 && len(current['child'])
let str .= ">\n" . inner . "|</" . current['name'] . ">\n" let str .= ">\n" . inner . "|</" . current['name'] . ">\n"
else else
let str .= ">" . inner . "|</" . current['name'] . ">" let str .= ">" . inner . "|</" . current['name'] . ">\n"
if current['multiplier'] > 1 || current['brother'] "if current['multiplier'] > 1 " || current['brother']
let str .= "\n" " let str .= "\n"
endif "endif
endif endif
endif endif
endif endif
@@ -973,7 +973,7 @@ endfunction
function! s:zen_expand(word) function! s:zen_expand(word)
let line = getline('.')[:col('.')-2] let line = getline('.')[:col('.')-2]
let part = matchstr(line, a:word ? '\(\w\+\)$' : '\(\S*\)$') let part = matchstr(line, a:word ? '\(\w\+\)$' : '\(\S.*\)$')
let rest = getline('.')[col('.')-1:] let rest = getline('.')[col('.')-1:]
let type = &ft let type = &ft
let items = s:zen_parseIntoTree(part, type)['child'] let items = s:zen_parseIntoTree(part, type)['child']
@@ -989,7 +989,7 @@ function! s:zen_expand(word)
let expand .= '|' let expand .= '|'
endif endif
let expand = substitute(expand, '${lang}', s:zen_settings['lang'], 'g') let expand = substitute(expand, '${lang}', s:zen_settings['lang'], 'g')
if line[:-len(part)-1] =~ '^\s*$' if line[:-len(part)-1] =~ '^\s\+$'
let size = len(line) - len(part) let size = len(line) - len(part)
let indent = repeat(s:zen_settings['indentation'], size) let indent = repeat(s:zen_settings['indentation'], size)
else else
@@ -1066,5 +1066,6 @@ endif
"echo ZenExpand('a*2{foo}a', '') "echo ZenExpand('a*2{foo}a', '')
"echo ZenExpand('a{foo}*2>b', '') "echo ZenExpand('a{foo}*2>b', '')
"echo ZenExpand('a*2{foo}>b', '') "echo ZenExpand('a*2{foo}>b', '')
"echo ZenExpand(' table>tr>td.name+td*3', '')
" vim:set et: " vim:set et:

View File

@@ -67,6 +67,8 @@ install_details: |
copy zencoding.vim to your plugin directory. copy zencoding.vim to your plugin directory.
versions: versions:
- '0.11': |
This is an upgrade for ZenCoding.vim: fixed indent.
- '0.10': | - '0.10': |
This is an upgrade for ZenCoding.vim: fixed behavior of '+' operator This is an upgrade for ZenCoding.vim: fixed behavior of '+' operator
- '0.9': | - '0.9': |