Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion plugin/surround.vim
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,8 @@ function! s:dosurround(...) " {{{1
exe 'norm! l'
endif
exe 'norm! dt'.char
elseif char == 'f'
exe 'norm! d'.strcount.'i('
else
exe 'norm! d'.strcount.'i'.char
endif
Expand Down Expand Up @@ -436,7 +438,14 @@ function! s:dosurround(...) " {{{1
else
" One character backwards
call search('\m.', 'bW')
exe "norm! da".char
if char == "f"
exe "norm! da("
exe "norm! bdw"
" will put the deleted function name into the unnamed reg
let original = getreg('"')
else
exe "norm! da".char
endif
endif
let removed = getreg('"')
let rem2 = substitute(removed,'\n.*','','')
Expand Down