1
0
mirror of https://github.com/janet-lang/janet synced 2024-11-28 19:19:53 +00:00

Make ctrl-d behave like delete, but exit on an empty line.

This is the default readline behavior.
This commit is contained in:
Leah Neukirchen 2020-03-04 14:56:04 +01:00
parent 6bc67b70a6
commit bc2ebce086

View File

@ -620,8 +620,12 @@ static int line() {
clearlines();
return -1;
case 4: /* ctrl-d, eof */
clearlines();
return -1;
if (gbl_len == 0) { /* quit on empty line */
clearlines();
return -1;
}
kdelete(1);
break;
case 5: /* ctrl-e */
gbl_pos = gbl_len;
refresh();