From e1ee22fba29255a910ec9f3d5978fb50d4b9e3be Mon Sep 17 00:00:00 2001
From: David Lawrence Ramsey <pooka109@gmail.com>
Date: Wed, 3 Nov 2004 23:05:11 +0000
Subject: [PATCH] in search_init(), when we're replacing and the mark is on,
 display a prompt indicating that we're replacing text only in the selection
 instead of the usual prompt

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2051 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
---
 ChangeLog    |  3 +++
 src/search.c | 11 ++++++++++-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 782b92e4..8998ca5f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -229,6 +229,9 @@ CVS code -
 	  the search prompt to the "Go To Line" prompt, since the
 	  toggling works both ways now and non-numeric text shouldn't be
 	  lost when going only one of those ways. (DLR)
+	- When we're replacing and the mark is on, display a prompt
+	  indicating that we're replacing text only in the selection
+	  instead of the usual prompt. (DLR)
   findnextstr()
 	- Take the no_sameline parameter after can_display_wrap and
 	  wholewords, not after all other parameters. (DLR)
diff --git a/src/search.c b/src/search.c
index 67ecc03d..de0aea72 100644
--- a/src/search.c
+++ b/src/search.c
@@ -188,7 +188,16 @@ int search_init(bool replacing, bool use_answer)
 #endif
 		"",
 
-	replacing ? _(" (to replace)") : "",
+	replacing ?
+#ifndef NANO_SMALL
+		(ISSET(MARK_ISSET) ? _(" (to replace) in selection") :
+#endif
+		_(" (to replace)")
+#ifndef NANO_SMALL
+		)
+#endif
+		: "",
+
 	buf);
 
     /* Release buf now that we don't need it anymore. */
-- 
GitLab