Fix crash

FossilOrigin-Name: b5a250176b51af0c83455b933ed31190ed1bb11a972bdf92fbb3f3e7ad96c06e
This commit is contained in:
Jonathan Schleifer 2025-03-08 10:12:33 +00:00
parent 4871985da9
commit 6131c4b261
2 changed files with 7 additions and 6 deletions

View file

@ -191,14 +191,15 @@ keypress(int code, bool isdown, int cooked)
break;
case SDLK_BACKSPACE:
case SDLK_LEFT: {
[commandbuf
deleteCharactersInRange:
OFMakeRange(commandbuf.length - 1, 1)];
case SDLK_LEFT:
if (commandbuf.length > 0)
[commandbuf
deleteCharactersInRange:
OFMakeRange(
commandbuf.length - 1, 1)];
resetcomplete();
break;
}
case SDLK_UP:
if (histpos)