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