mirror of
https://github.com/Raimondi/delimitMate.git
synced 2025-12-07 21:24:51 +08:00
Fix tests, BS in expansions and close #105.
This commit is contained in:
@@ -143,7 +143,7 @@ function! delimitMate#WriteAfter(str) "{{{
|
|||||||
let len = 1 "len(a:str)
|
let len = 1 "len(a:str)
|
||||||
let line = split(getline('.'), '\zs')
|
let line = split(getline('.'), '\zs')
|
||||||
let col = delimitMate#CursorIdx() - 1
|
let col = delimitMate#CursorIdx() - 1
|
||||||
if (col + 1) < 0
|
if (col + 1) < 0 || col('.') == 1
|
||||||
let line = insert(line, a:str)
|
let line = insert(line, a:str)
|
||||||
elseif col('.') == col('$')
|
elseif col('.') == col('$')
|
||||||
let line = add(line, a:str)
|
let line = add(line, a:str)
|
||||||
|
|||||||
@@ -338,7 +338,7 @@ endfunction "}}}
|
|||||||
|
|
||||||
function! s:ExtraMappings() "{{{
|
function! s:ExtraMappings() "{{{
|
||||||
" If pair is empty, delete both delimiters:
|
" If pair is empty, delete both delimiters:
|
||||||
inoremap <silent><expr> <Plug>delimitMateBS delimitMate#WithinEmptyPair() ? "\<C-R>=delimitMate#BS()\<CR>" : "\<BS>"
|
inoremap <silent> <Plug>delimitMateBS <C-R>=delimitMate#BS()<CR>
|
||||||
if !hasmapto('<Plug>delimitMateBS','i') && maparg('<BS>'. 'i') == ''
|
if !hasmapto('<Plug>delimitMateBS','i') && maparg('<BS>'. 'i') == ''
|
||||||
silent! imap <unique> <buffer> <BS> <Plug>delimitMateBS
|
silent! imap <unique> <buffer> <BS> <Plug>delimitMateBS
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -36,3 +36,5 @@ set cpo=ces$
|
|||||||
" 'x" " 'x'"
|
" 'x" " 'x'"
|
||||||
# Make sure we jump over a quote on the right. #89.
|
# Make sure we jump over a quote on the right. #89.
|
||||||
"('test'x" "('test'x)"
|
"('test'x" "('test'x)"
|
||||||
|
# Duplicate whole line when inserting quote at bol #105
|
||||||
|
"}\<Home>'" "''}"
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ $(document).ready(function() {
|
|||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
# Issue #95
|
# Issue #95
|
||||||
new
|
new
|
||||||
|
let b:delimitMate_jump_expansion = 1
|
||||||
|
DelimitMateReload
|
||||||
exec "normal i(\<CR>test)x"
|
exec "normal i(\<CR>test)x"
|
||||||
================================================================================
|
================================================================================
|
||||||
(
|
(
|
||||||
@@ -43,10 +45,10 @@ sub foo {
|
|||||||
}
|
}
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
%d
|
%d
|
||||||
call setline(1, "\"{bracketed}")
|
call setline(1, '"{bracketed}')
|
||||||
normal A"x
|
normal A"x
|
||||||
================================================================================
|
================================================================================
|
||||||
"{bracketed""x
|
"{bracketed}"x"
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
# Syntax folding enabled by autocmd breaks expansion. But ti can't be tested
|
# Syntax folding enabled by autocmd breaks expansion. But ti can't be tested
|
||||||
# with :normal
|
# with :normal
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
# Issue #95
|
# Issue #95
|
||||||
new
|
new
|
||||||
|
let b:delimitMate_jump_expansion = 1
|
||||||
|
DelimitMateReload
|
||||||
exec "normal i( test)x"
|
exec "normal i( test)x"
|
||||||
================================================================================
|
================================================================================
|
||||||
( test )x
|
( test )x
|
||||||
|
|||||||
Reference in New Issue
Block a user