mirror of
https://github.com/Raimondi/delimitMate.git
synced 2025-12-06 12:44:27 +08:00
Fix :DelimitMateTest.
This commit is contained in:
@@ -582,16 +582,8 @@ endfunction " }}}
|
||||
|
||||
" Tools: {{{
|
||||
function! delimitMate#TestMappings() "{{{
|
||||
if &modified
|
||||
echohl WarningMsg
|
||||
let answer = input("Modified buffer, type \"yes\" to write and proceed "
|
||||
\ . "with test: ") !~ '\c^yes$'
|
||||
echohl NONE
|
||||
if answer != '\c^yes$'
|
||||
return
|
||||
endif
|
||||
write
|
||||
endif
|
||||
echom 1
|
||||
%d
|
||||
let options = sort(keys(delimitMate#OptionsList()))
|
||||
let optoutput = ['delimitMate Report', '==================', '',
|
||||
\ '* Options: ( ) default, (g) global, (b) buffer','']
|
||||
@@ -604,8 +596,8 @@ function! delimitMate#TestMappings() "{{{
|
||||
|
||||
" Check if mappings were set. {{{
|
||||
let imaps = s:g('right_delims')
|
||||
let imaps = imaps + ( s:g('autoclose') ? s:g('left_delims') : [] )
|
||||
let imaps = imaps +
|
||||
let imaps += ( s:g('autoclose') ? s:g('left_delims') : [] )
|
||||
let imaps +=
|
||||
\ s:g('quotes_list') +
|
||||
\ s:g('apostrophes_list') +
|
||||
\ ['<BS>', '<S-BS>', '<Del>', '<S-Tab>', '<Esc>'] +
|
||||
@@ -620,13 +612,8 @@ function! delimitMate#TestMappings() "{{{
|
||||
\ '<C-ScrollWheelLeft>'] +
|
||||
\ ['<ScrollWheelRight>', '<S-ScrollWheelRight>',
|
||||
\ '<C-ScrollWheelRight>']
|
||||
let imaps = imaps + ( s:g('expand_cr') ? ['<CR>'] : [] )
|
||||
let imaps = imaps + ( s:g('expand_space') ? ['<Space>'] : [] )
|
||||
|
||||
let vmaps =
|
||||
\ s:g('right_delims') +
|
||||
\ s:g('left_delims') +
|
||||
\ s:g('quotes_list')
|
||||
let imaps += ( s:g('expand_cr') ? ['<CR>'] : [] )
|
||||
let imaps += ( s:g('expand_space') ? ['<Space>'] : [] )
|
||||
|
||||
let imappings = []
|
||||
for map in imaps
|
||||
@@ -635,7 +622,7 @@ function! delimitMate#TestMappings() "{{{
|
||||
let map = '<Bar>'
|
||||
endif
|
||||
redir => output | execute "verbose imap ".map | redir END
|
||||
let imappings = imappings + split(output, '\n')
|
||||
let imappings += split(output, '\n')
|
||||
endfor
|
||||
|
||||
unlet! output
|
||||
@@ -728,6 +715,7 @@ function! delimitMate#TestMappings() "{{{
|
||||
call append(line('$'), split(setoptions,"\n")
|
||||
\ + ['--------------------'])
|
||||
setlocal nowrap
|
||||
call feedkeys("\<Esc>\<Esc>", 'n')
|
||||
endfunction "}}}
|
||||
|
||||
function! delimitMate#OptionsList() "{{{
|
||||
|
||||
Reference in New Issue
Block a user