mirror of
https://github.com/mattn/emmet-vim.git
synced 2025-12-06 10:44:24 +08:00
recover rest part in line.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
" File: zencoding.vim
|
||||
" Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
|
||||
" 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])
|
||||
|
||||
@@ -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': |
|
||||
|
||||
Reference in New Issue
Block a user