[PATCH] feedback: give better messages when there is nothing to cut or copy

Hussam al-Homsi <[email protected]>
Newsgroups gmane.editors.nano.devel
Message-ID <CAJebAKuFJhJBPLjGKENnK_wntKM44nDNKposCWujuXrdTemVuQ@mail.gmail.com>
The following messages are given when there is nothing to cut or copy:

  - "Nothing was cut"
  - "Copied nothing"

They kind of give the impression that nano failed to cut or copy,
which is not the case.

I propose the following messages instead:

  - "Nothing to cut"
  - "Nothing to copy"

They are consistent with the messages given when there is nothing to
undo or redo:

  - "Nothing to undo"
  - "Nothing to redo"
0001-feedback-give-better-messages-when-there-is-nothing-.patch (text/x-patch, 1.9 KB)
From 3045f87228273fedd4041d4378196c90deb5cdae Mon Sep 17 00:00:00 2001
From: Hussam al-Homsi <[email protected]>
Date: Sun, 14 May 2023 10:00:09 -0400
Subject: [PATCH] feedback: give better messages when there is nothing to cut
 or copy

The new messages make it clear that nano did not fail to cut or copy. Also, they
are consistent with the messages given when there is nothing to undo or redo.

Signed-off-by: Hussam al-Homsi <[email protected]>
---
 src/cut.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/cut.c b/src/cut.c
index 4458abce..243ef025 100644
--- a/src/cut.c
+++ b/src/cut.c
@@ -166,7 +166,7 @@ bool is_cuttable(bool test_cliff)
 #endif
 					)) {
 #ifndef NANO_TINY
-		statusbar(_("Nothing was cut"));
+		statusbar(_("Nothing to cut"));
 		openfile->mark = NULL;
 #endif
 		return FALSE;
@@ -231,7 +231,7 @@ void chop_word(bool forward)
 void chop_previous_word(void)
 {
 	if (openfile->current->prev == NULL && openfile->current_x == 0)
-		statusbar(_("Nothing was cut"));
+		statusbar(_("Nothing to cut"));
 	else
 		chop_word(BACKWARD);
 }
@@ -565,7 +565,7 @@ void cut_till_eof(void)
 				(openfile->current->next == NULL ||
 				(!ISSET(NO_NEWLINES) && openfile->current_x > 0 &&
 				openfile->current->next == openfile->filebot))) {
-		statusbar(_("Nothing was cut"));
+		statusbar(_("Nothing to cut"));
 		return;
 	}
 
@@ -615,7 +615,7 @@ void copy_marked_region(void)
 	refresh_needed = TRUE;
 
 	if (topline == botline && top_x == bot_x) {
-		statusbar(_("Copied nothing"));
+		statusbar(_("Nothing to copy"));
 		return;
 	}
 
@@ -661,7 +661,7 @@ void copy_text(void)
 	/* When at the very end of the buffer, there is nothing to do. */
 	if (openfile->current->next == NULL && at_eol && (ISSET(CUT_FROM_CURSOR) ||
 									openfile->current_x == 0 || cutbuffer)) {
-		statusbar(_("Copied nothing"));
+		statusbar(_("Nothing to copy"));
 		return;
 	}
 
-- 
2.34.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.