Merge pull request #107 from DanielleSucher/support-arbitrary-delimiters
Handle arbitrary delimiters with cs and ds
This commit is contained in:
commit
9bf527af3a
@ -379,6 +379,12 @@ function! s:dosurround(...) " {{{1
|
||||
let strcount = (scount == 1 ? "" : scount)
|
||||
if char == '/'
|
||||
exe 'norm! '.strcount.'[/d'.strcount.']/'
|
||||
elseif char =~# '[[:punct:]]' && char !~# '[][(){}<>]'
|
||||
exe 'norm! T'.char
|
||||
if getline('.')[col('.')-1] == char
|
||||
exe 'norm! l'
|
||||
endif
|
||||
exe 'norm! dt'.char
|
||||
else
|
||||
exe 'norm! d'.strcount.'i'.char
|
||||
endif
|
||||
@ -403,6 +409,9 @@ function! s:dosurround(...) " {{{1
|
||||
norm! "_x
|
||||
call setreg('"','/**/',"c")
|
||||
let keeper = substitute(substitute(keeper,'^/\*\s\=','',''),'\s\=\*$','','')
|
||||
elseif char =~# '[[:punct:]]' && char !~# '[][(){}<>]'
|
||||
exe 'norm! F'.char
|
||||
exe 'norm! df'.char
|
||||
else
|
||||
" One character backwards
|
||||
call search('.','bW')
|
||||
|
Loading…
Reference in New Issue
Block a user