mirror of
https://github.com/Raimondi/delimitMate.git
synced 2025-12-07 21:24:51 +08:00
Fix issues with quotes.
This commit is contained in:
@@ -133,15 +133,19 @@ function! delimitMate#WriteBefore(str) "{{{
|
|||||||
endfunction " }}}
|
endfunction " }}}
|
||||||
|
|
||||||
function! delimitMate#WriteAfter(str) "{{{
|
function! delimitMate#WriteAfter(str) "{{{
|
||||||
let len = len(a:str)
|
let len = 1 "len(a:str)
|
||||||
let line = getline('.')
|
let line = split(getline('.'), '\zs')
|
||||||
let col = delimitMate#CursorIdx()
|
let col = delimitMate#CursorIdx() - 1
|
||||||
if (col) < 0
|
if (col + 1) < 0
|
||||||
call setline('.',a:str.line)
|
let line = insert(line, a:str)
|
||||||
|
elseif col('.') == col('$')
|
||||||
|
let line = add(line, a:str)
|
||||||
else
|
else
|
||||||
let line = line[:(col)].a:str.line[(col+len):]
|
let line1 = line[:(col)]
|
||||||
call setline('.',line)
|
let line2 = line[(col+len):]
|
||||||
|
let line = line1 + [a:str] + line2
|
||||||
endif
|
endif
|
||||||
|
call setline('.', join(line, ''))
|
||||||
return ''
|
return ''
|
||||||
endfunction " }}}
|
endfunction " }}}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user