asottile / babi

a text editor
MIT License
396 stars 46 forks source link

replace all does not account for line change #349

Closed SilenZcience closed 3 weeks ago

SilenZcience commented 2 months ago

The search and replace functionality does not account for line change when replacing all occurences.

Example: Write a simple file with the following content:

A_A_

and have the cursor on the last position. When replacing every A with XXX (or anything of length 3 or greater) the following change will be made:

XXX_A_

The expected bahavior would be to have the following result:

XXX_XXX_
asottile commented 2 months ago

should be pretty easy to fix if you'd like to send a patch