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