nsf / godit

A very religious text editor
MIT License
578 stars 76 forks source link

Fix minor cursor position bug with no-op 'C-x <' #23

Closed ixtenu closed 2 years ago

ixtenu commented 2 years ago

C-x < has a very minor cursor position issue: it moves the cursor one byte to the left even if the current line had no indentation and the operation was a no-op for it.

To reproduce, mark a region ending with a line that has no indentation, putting the cursor on a column greater than zero. Then invoke C-x <: it will move the cursor one byte to the left even though the line is unchanged, and repeating the operation with < will continue to move the cursor to the left each time.

The idea with moving the cursor to the left is to adjust for the deleted tab, but if no tab was deleted, then the cursor should remain where it was.

nsf commented 2 years ago

Thanks.