ms-jpq / sad

CLI search and replace | Space Age seD
MIT License
1.68k stars 22 forks source link

Isolate multiple instances of replaced text on single line? #324

Closed acepukas closed 3 weeks ago

acepukas commented 3 weeks ago

Just discovered this tool and it's great. One thing I notice though is that multiple instances of the same text to be replaced on a single line are treated the same. For example, if I have the command

fd -t f | sad 'apples' 'bananas'

and a file contains

apples, apples everywhere...

that is treated as one replacement item and not two separate items.

Is there some way for them to be treated as separate items with flags passed to either fzf or sad? Something I missed maybe? I looked over the sad README.md and didn't find anything there.

acepukas commented 3 weeks ago

Oops, I misunderstood sad I think. I see that the replacements are file wide. Pretend this issue never existed.