support of blockwize selection.

This commit is contained in:
mattn
2011-11-24 15:07:03 +09:00
parent e16879217d
commit ba5c040894

View File

@@ -687,9 +687,13 @@ function! zencoding#expandAbbr(mode) range
let leader .= (str =~ "\n" ? "{\n" : "{") . str . "}" let leader .= (str =~ "\n" ? "{\n" : "{") . str . "}"
let items = s:zen_parseIntoTree(leader, type).child let items = s:zen_parseIntoTree(leader, type).child
else else
let str .= getline(a:firstline) let save_regcont = @"
let items = s:zen_parseIntoTree(leader, type).child let save_regtype = getregtype('"')
let items[0].value = "{".str."}" silent! normal! gvygv
let str = @"
call setreg('"', save_regcont, save_regtype)
"let str .= getline(a:firstline)
let items = s:zen_parseIntoTree(leader . "{".str."}", type).child
endif endif
for item in items for item in items
let expand .= s:zen_toString(item, type, 0, filters) let expand .= s:zen_toString(item, type, 0, filters)
@@ -743,20 +747,25 @@ function! zencoding#expandAbbr(mode) range
" TODO: on windows, %z/%Z is 'Tokyo(Standard)' " TODO: on windows, %z/%Z is 'Tokyo(Standard)'
let expand = substitute(expand, '${datetime}', strftime("%Y-%m-%dT%H:%M:%S %z"), 'g') let expand = substitute(expand, '${datetime}', strftime("%Y-%m-%dT%H:%M:%S %z"), 'g')
endif endif
if line[:-len(part)-1] =~ '^\s\+$' if a:firstline == a:lastline
let indent = line[:-len(part)-1] let line = getline('.')
call setline(line('.'), line[0:col('.')].substitute(expand, '>\n\s*', '>', 'g').line[col('.'):])
else else
let indent = '' if line[:-len(part)-1] =~ '^\s\+$'
endif let indent = line[:-len(part)-1]
let expand = substitute(expand, '\n\s*$', '', 'g') else
let expand = line[:-len(part)-1] . substitute(expand, "\n", "\n" . indent, 'g') . rest let indent = ''
let lines = split(expand, '\n') endif
call setline(line('.'), lines[0]) let expand = substitute(expand, '\n\s*$', '', 'g')
if len(lines) > 1 let expand = line[:-len(part)-1] . substitute(expand, "\n", "\n" . indent, 'g') . rest
call append(line('.'), lines[1:]) let lines = split(expand, '\n')
call setline(line('.'), lines[0])
if len(lines) > 1
call append(line('.'), lines[1:])
endif
silent! exe "normal! ".len(part)."h"
endif endif
endif endif
silent! exe "normal! ".len(part)."h"
if search('\$cursor\$', 'e') if search('\$cursor\$', 'e')
let oldselection = &selection let oldselection = &selection
let &selection = 'inclusive' let &selection = 'inclusive'