pulsar-edit / pulsar

A Community-led Hyper-Hackable Text Editor
https://pulsar-edit.dev
Other
3.33k stars 140 forks source link

Fixed delete to beginning and end of line #1036

Open mauricioszabo opened 4 months ago

mauricioszabo commented 4 months ago

After https://github.com/pulsar-edit/pulsar/issues/810, delete to beginning and end of line are broken when soft-wrap is selected.

This PR fixes this behavior, but also changes the way "delete to end of line" works in original Atom - originally, it would delete to the end of the "visible line" - so, if one had the following code:

image

And hit "delete to the end of line", this would be the result:

image

Now, it deletes the whole line:

image

We might want to vote to check if that's the behavior we want

DeeDeeG commented 4 months ago

I would agree with doing a vote. For me, deleting to the end of the "visible line" or "visually apparent line" is intuitive.

There is only a difference if there is line wrapping activated, right? So, "only" affects those circumstances. And yet it is a common scenario, so still nice to get the user experience right.

I feel that leaning into the "code editor" role of Pulsar, you might say deleting to the end of the buffer row is more appropriate. Whereas leaning into the "general text editor for lay-people" role/mindset (which Pulsar also fulfills), then deleting to the end of the screen row would be more appropriate. My two cents.

- DeeDeeG