Skip to content

Commit

Permalink
feat: (309) Implement csf/dsf
Browse files Browse the repository at this point in the history
Ported: tpope#309
  • Loading branch information
halostatue committed Aug 8, 2024
1 parent 64d17ce commit 9884073
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion import/surround.vim
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,8 @@ export def DoSurround(value: string = null_string, new_value: string = null_stri
execute 'normal! l'
endif
execute "normal! \<Plug>(surround-d)t" .. char
elseif char ==# 'f'
execute "normal! \<Plug>(surround-d)i(" .. char
else
execute "normal! \<Plug>(surround-d)" .. strcount .. 'i' .. char
endif
Expand Down Expand Up @@ -548,7 +550,14 @@ export def DoSurround(value: string = null_string, new_value: string = null_stri
else
# One character backwards
search('\m.', 'bW')
execute "normal! \<Plug>(surround-d)a" .. char

if char ==# 'f'
execute "normal! \<Plug>(surround-d)a(" .. char
execute 'normal! b\<Plug>(surround-d)w'
original = getreg('"')
else
execute "normal! \<Plug>(surround-d)a" .. char
endif
endif

var removed = getreg('"')
Expand Down

0 comments on commit 9884073

Please sign in to comment.