1
0
mirror of https://github.com/janet-lang/janet synced 2024-11-25 01:37:19 +00:00

Merge pull request #296 from leahneukirchen/ctrl-d

Make ctrl-d behave like delete, but exit on an empty line.
This commit is contained in:
Calvin Rose 2020-03-04 20:42:05 -06:00 committed by GitHub
commit d804ee3c07
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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();