commit 8ce1eb2bb5bac39ed33dd3aace28d40a53878c16 Author: Tom Schwindl <schwi...@posteo.de> AuthorDate: Wed Jan 11 16:08:36 2023 +0100 Commit: Jan Klemkow <j.klem...@wemelug.de> CommitDate: Tue Jan 24 16:59:40 2023 +0100
slackline: restore some comments diff --git a/slackline.c b/slackline.c index 4573899..a56c030 100644 --- a/slackline.c +++ b/slackline.c @@ -164,7 +164,7 @@ sl_default(struct slackline *sl, int key) case CTRL_U: sl_reset(sl); break; - case CTRL_W: + case CTRL_W: /* erase previous word */ while (sl->rcur != 0 && isspace((unsigned char) *(sl->ptr-1))) sl_backspace(sl); while (sl->rcur != 0 && !isspace((unsigned char) *(sl->ptr-1))) diff --git a/slackline_emacs.c b/slackline_emacs.c index a5ed7ab..352b226 100644 --- a/slackline_emacs.c +++ b/slackline_emacs.c @@ -15,13 +15,13 @@ sl_emacs(struct slackline *sl, int key) case ESC_KEY: sl->esc = ESC; break; - case CTRL_A: + case CTRL_A: /* start of line */ sl_move(sl, HOME); break; - case CTRL_B: + case CTRL_B: /* previous char */ sl_move(sl, LEFT); break; - case CTRL_D: + case CTRL_D: /* delete char in front of the cursor or exit */ if (sl->rcur < sl->rlen) { sl_move(sl, RIGHT); sl_backspace(sl); @@ -29,19 +29,19 @@ sl_emacs(struct slackline *sl, int key) exit(EXIT_SUCCESS); } break; - case CTRL_E: + case CTRL_E: /* end of line */ sl_move(sl, END); break; - case CTRL_F: + case CTRL_F: /* next char */ sl_move(sl, RIGHT); break; - case CTRL_K: + case CTRL_K: /* delete line from cursor to end */ for (int i = sl->rlen - sl->rcur; i > 0; --i) { sl_move(sl, RIGHT); sl_backspace(sl); } break; - case CTRL_T: + case CTRL_T: /* swap last two chars */ if (sl->rcur >= 2) { tmp = *sl_postoptr(sl, sl->rcur-1); sl->buf[sl->rcur-1] = *sl_postoptr(sl, sl->rcur-2);