boxdot / gurk-rs

Signal Messenger client for terminal
GNU Affero General Public License v3.0
456 stars 33 forks source link

Add support for Ctrl+U to delete line backwards #230

Closed maximbaz closed 12 months ago

maximbaz commented 12 months ago

It is common behavior of Ctrl+U to delete line backwards, so I wanted to have support for it in gurk.

The desired behavior is as following. Given text (cursor indicated as |):

aaaaaaaaaaaa
bbbbbbbbbbbb
ccccccc|ddddd

Pressing Ctrl+U should result into:

aaaaaaaaaaaa
bbbbbbbbbbbb
|ddddd

Pressing again should result into:

aaaaaaaaaaaa
bbbbbbbbbbbb|ddddd

Then:

aaaaaaaaaaaa
|ddddd

Then:

aaaaaaaaaaaa|ddddd

Then:

|ddddd

Further presses of Ctrl+U would have no effect.

Let me know if it makes sense!

boxdot commented 12 months ago

It fits very nicely to Ctrl+k. Thank you for the implementation.