From d3cffec5f4f78e3d6302b52b03c0598715eef206 Mon Sep 17 00:00:00 2001 From: mattn Date: Fri, 19 Feb 2010 16:01:13 +0900 Subject: [PATCH] fixed problem that moving cursor with expanding. --- zencoding.vim | 12 +++++++----- zencoding.vim.vimup | 4 +++- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/zencoding.vim b/zencoding.vim index fe8e407..4e2b9a3 100644 --- a/zencoding.vim +++ b/zencoding.vim @@ -2,7 +2,7 @@ " File: zencoding.vim " Author: Yasuhiro Matsumoto " Last Change: 19-Feb-2010. -" Version: 0.1 +" Version: 0.2 " 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/ @@ -67,7 +67,7 @@ " script type: plugin if &cp || (exists('g:loaded_zencoding_vim') && g:loaded_zencoding_vim) - finish + "finish endif let g:loaded_zencoding_vim = 1 @@ -740,7 +740,7 @@ let s:zen_settings = { \ 'optg': 'optgroup>option' \ }, \ 'empty_elements': 'area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed,keygen,command', -\ 'block_elements': 'address,applet,blockquote,button,center,dd,del,dir,div,dl,dt,fieldset,form,frameset,hr,iframe,ins,isindex,li,link,map,menu,noframes,noscript,object,ol,p,pre,script,table,tbody,td,tfoot,th,thead,tr,ul,h1,h2,h3,h4,h5,h6,style', +\ 'block_elements': 'address,applet,blockquote,button,center,dd,del,dir,div,dl,dt,fieldset,form,frameset,hr,iframe,ins,isindex,link,map,menu,noframes,noscript,object,ol,p,pre,script,table,tbody,td,tfoot,th,thead,tr,ul,h1,h2,h3,h4,h5,h6,style', \ 'inline_elements': 'a,abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var', \ }, \ 'xsl': { @@ -905,7 +905,7 @@ function! s:zen_toString(...) if stridx(','.s:zen_settings[type]['empty_elements'].',', ','.current['name'].',') != -1 let str .= " />\n" else - 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\n" else let str .= ">\n" @@ -945,7 +945,7 @@ function! s:zen_expand() let size = len(line) - len(part) let indent = repeat(s:zen_settings['indentation'], size) let expand = indent . substitute(expand, "\n", "\n" . indent, 'g') - silent! put! =expand + call setline(line('.'), split(expand, '\n')) return '' endif return '|' @@ -995,5 +995,7 @@ endif "echo ZenExpand('tm>if>div.message', '') "echo ZenExpand('@i', 'css') "echo ZenExpand('req', 'perl') +"echo ZenExpand('html:4t>div#wrapper>div#header+div#contents+div#footer', '') +"echo ZenExpand('a[href=http://www.google.com/].foo#hoge', '') " vim:set et: diff --git a/zencoding.vim.vimup b/zencoding.vim.vimup index 41d3f38..e9e0543 100644 --- a/zencoding.vim.vimup +++ b/zencoding.vim.vimup @@ -2,7 +2,7 @@ script_name: ZenCoding.vim script_id: '2981' script_type: utility script_package: zencoding.vim -script_version: '0.1' +script_version: '0.2' required_vim_version: '7.2' summary: vim plugins for HTML and CSS hi-speed coding. @@ -67,6 +67,8 @@ install_details: | copy zencoding.vim to your plugin directory. versions: +- '0.2': | + This is an upgrade for ZenCoding.vim: fixed problem that moving cursor with expanding. - '0.1': | Initial upload