From a10dbfc4175867c0d15f02b7f244837c5d41478e Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Mon, 9 Sep 2019 11:20:47 +0200 Subject: edit: replace ASCII codes by symbolic names Code has some magic numbers, replace them. This has the added benefit that at least the touched lines are now charset-agnostic. Signed-off-by: Ahmad Fatoum Signed-off-by: Sascha Hauer --- commands/edit.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'commands') diff --git a/commands/edit.c b/commands/edit.c index 290222ce15..ba6a8c7cdd 100644 --- a/commands/edit.c +++ b/commands/edit.c @@ -524,12 +524,12 @@ static int do_edit(int argc, char *argv[]) } else delete_char(textx); break; - case 13: - case 10: + case '\r': + case '\n': split_line(); break; case 127: - case 8: + case '\b': if (textx > 0) { textx--; delete_char(textx); @@ -542,10 +542,10 @@ static int do_edit(int argc, char *argv[]) merge_line(curline); } break; - case 4: + case CTL_CH('d'): ret = save_file(argv[1]); goto out; - case 3: + case CTL_CH('c'): goto out; default: if ((signed char)c != -1) -- cgit v1.2.3