asottile / babi

a text editor
MIT License
396 stars 46 forks source link

Alt-UP crashes if the first line in the buffer is empty #218

Closed gryzus24 closed 2 years ago

gryzus24 commented 2 years ago

To reproduce:

This happens because there is no bound check in Alt-UP action implementation when counting the offset.

I can issue a pull request with slightly different implementation where the bound check is obvious. If you would like to keep the current code it suffices to add two more if statements.

asottile commented 2 years ago

huh, I didn't even know there was an alt+up keyboard shortcut

asottile commented 2 years ago

ah it was added in #179 by @ClasherKasten