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

View File

@@ -347,7 +347,7 @@ function! s:ExtraMappings() "{{{
silent! imap <unique> <buffer> <Space> <Plug>delimitMateSpace silent! imap <unique> <buffer> <Space> <Plug>delimitMateSpace
endif endif
" Jump over any delimiter: " 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') == '' if s:g('tab2exit') && !hasmapto('<Plug>delimitMateS-Tab', 'i') && maparg('<S-Tab>', 'i') == ''
silent! imap <unique> <buffer> <S-Tab> <Plug>delimitMateS-Tab silent! imap <unique> <buffer> <S-Tab> <Plug>delimitMateS-Tab
endif endif