From b878f0f4053398eb6bbb625facef56166222fd9e Mon Sep 17 00:00:00 2001 From: Bobbi Webber-Manners Date: Sun, 23 Aug 2020 19:49:30 -0400 Subject: [PATCH] EDIT: Modifield selection delete logic so OA-A, [Del] deletes whole buffer --- apps/edit.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/apps/edit.c b/apps/edit.c index b6a2037..ce2c245 100644 --- a/apps/edit.c +++ b/apps/edit.c @@ -5,7 +5,8 @@ ///////////////////////////////////////////////////////////////////////////// // TODO: File picker!! -// TODO: Bug - cursor down at EOF succeeds when it should fail +// TODO: Bug - cursor down at EOF succeeds when it should fail. Seems to happen +// after one inserts a CR at EOF. // TODO: Search options - ignore case, complete word. // Note: Use my fork of cc65 to get a flashing cursor!! @@ -2223,16 +2224,13 @@ donehelp: draw_screen(); break; case DELETE: // DEL "BACKSPACE" - if (mode == SEL_NONE) { - delete_char(); - update_after_delete_char(); - set_modified(1); - } else if (mode == SEL_SELECT) { - tmp = (startsel == 65535U ? 0 : 1); // Selection active? - if (!tmp) { - beep(); - break; + if (startsel == 65535U) { // No selection + if (mode == SEL_NONE) { + delete_char(); + update_after_delete_char(); + set_modified(1); } + } else { snprintf(userentry, 80, "Delete selection (%d chars)", abs(endsel - startsel)); if (prompt_okay(userentry) != 0)