mirror of
https://github.com/Raimondi/delimitMate.git
synced 2025-12-06 12:44:27 +08:00
Fix <S-Tab> mapping. Close #132.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user