Fix <S-Tab> mapping. Close #132.

This commit is contained in:
Israel Chauca Fuentes
2013-06-27 21:35:37 -04:00
parent d98d8c0a0d
commit 7caa6092b7
2 changed files with 4 additions and 6 deletions

View File

@@ -434,24 +434,22 @@ function! delimitMate#JumpOut(char) "{{{
endif
endfunction " }}}
function! delimitMate#JumpAny(key) " {{{
function! delimitMate#JumpAny(...) " {{{
if delimitMate#IsForbidden('')
return a:key
return ''
endif
if !delimitMate#ShouldJump()
return a:key
return ''
endif
" Let's get the character on the right.
let char = delimitMate#GetCharFromCursor(0)
if char == " "
" Space expansion.
"let char = char . getline('.')[col('.')] . delimitMate#Del()
return char . getline('.')[col('.')] . delimitMate#Del() .
\ delimitMate#Del()
"call delimitMate#RmBuffer(1)
elseif char == ""
" CR expansion.
"let char = "\<CR>" . getline(line('.') + 1)[0] . "\<Del>"
call delimitMate#FlushBuffer()
return "\<CR>" . getline(line('.') + 1)[0] . delimitMate#Del() . "\<Del>"
else

View File

@@ -347,7 +347,7 @@ function! s:ExtraMappings() "{{{
silent! imap <unique> <buffer> <Space> <Plug>delimitMateSpace
endif
" Jump over any delimiter:
inoremap <silent> <Plug>delimitMateS-Tab <C-R>=delimitMate#JumpAny("\<S-Tab>")<CR>
inoremap <silent> <Plug>delimitMateS-Tab <C-R>=delimitMate#JumpAny()<CR>
if s:g('tab2exit') && !hasmapto('<Plug>delimitMateS-Tab', 'i') && maparg('<S-Tab>', 'i') == ''
silent! imap <unique> <buffer> <S-Tab> <Plug>delimitMateS-Tab
endif