From be9b9e35cd6940c4275004c81366fa7f41027e6c Mon Sep 17 00:00:00 2001 From: mattn Date: Fri, 19 Feb 2010 17:15:05 +0900 Subject: [PATCH] recover rest part in line. --- zencoding.vim | 9 +++++---- zencoding.vim.vimup | 4 +++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/zencoding.vim b/zencoding.vim index 6db5669..ef3aa77 100644 --- a/zencoding.vim +++ b/zencoding.vim @@ -2,7 +2,7 @@ " File: zencoding.vim " Author: Yasuhiro Matsumoto " Last Change: 19-Feb-2010. -" Version: 0.4 +" Version: 0.5 " 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/ @@ -932,8 +932,9 @@ function! s:zen_toString(...) endfunction function! s:zen_expand() - let line = getline('.')[:col('.')] - let part = matchstr(line, '\(\S*\)$') + let line = getline('.')[:col('.')-1] + let part = matchstr(line, '^.*\(\S*\)$') + let rest = getline('.')[col('.'):] let type = &ft let items = s:zen_parseIntoTree(part, type)['child'] let expand = len(items) ? s:zen_toString(items[0], type) : '' @@ -948,7 +949,7 @@ function! s:zen_expand() silent! exec "normal! ".repeat("x", len(part)) let size = len(line) - len(part) let indent = repeat(s:zen_settings['indentation'], size) - let expand = indent . substitute(expand, "\n", "\n" . indent, 'g') + let expand = indent . substitute(expand, "\n", "\n" . indent, 'g') . rest let oldautoindent = &autoindent let lines = split(expand, '\n') call setline(line('.'), lines[0]) diff --git a/zencoding.vim.vimup b/zencoding.vim.vimup index cc05740..3d52270 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.4' +script_version: '0.5' required_vim_version: '7.0' 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.5': | + This is an upgrade for ZenCoding.vim: recover rest part in line. - '0.4': | This is an upgrade for ZenCoding.vim: fixed cursor position. fixed ${lang} replacement. - '0.3': |