Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion kilo.c
Original file line number Diff line number Diff line change
Expand Up @@ -1181,8 +1181,16 @@ void editorProcessKeypress(int fd) {
"Press Ctrl-Q %d more times to quit.", quit_times);
quit_times--;
return;
} else {
/* move cursor below editor before quitting */
char buf[32];
struct abuf ab = ABUF_INIT;
snprintf(buf,sizeof(buf),"\x1b[%d;%dH\r\n",E.screenrows+2,1); //numrows
abAppend(&ab,buf,strlen(buf));
write(STDOUT_FILENO,ab.b,ab.len);
abFree(&ab);
exit(0);
}
exit(0);
break;
case CTRL_S: /* Ctrl-s */
editorSave();
Expand Down