From c1d88e62ee28b1aa2c0a11c77acbd8d72a2461f5 Mon Sep 17 00:00:00 2001
From: David Lawrence Ramsey <pooka109@gmail.com>
Date: Sat, 22 Jul 2017 10:56:19 -0500
Subject: [PATCH 2/2] weeding: remove unused active parameter from spotlight()

Since all spotlight() calls now effectively set it to TRUE.
---
 src/proto.h  |  4 ++--
 src/search.c |  2 +-
 src/text.c   |  2 +-
 src/winio.c  | 25 ++++++++++---------------
 4 files changed, 14 insertions(+), 19 deletions(-)

diff --git a/src/proto.h b/src/proto.h
index 34d4343..372e4eb 100644
--- a/src/proto.h
+++ b/src/proto.h
@@ -679,9 +679,9 @@ void total_refresh(void);
 void display_main_list(void);
 void do_cursorpos(bool force);
 void do_cursorpos_void(void);
-void spotlight(bool active, size_t from_col, size_t to_col);
+void spotlight(size_t from_col, size_t to_col);
 #ifndef NANO_TINY
-void spotlight_softwrapped(bool active, size_t from_col, size_t to_col);
+void spotlight_softwrapped(size_t from_col, size_t to_col);
 #endif
 void xon_complaint(void);
 void xoff_complaint(void);
diff --git a/src/search.c b/src/search.c
index 2261aac..5ff4d77 100644
--- a/src/search.c
+++ b/src/search.c
@@ -624,7 +624,7 @@ ssize_t do_replace_loop(const char *needle, bool whole_word_only,
 	    /* Don't show cursor, to not distract from highlighted match. */
 	    curs_set(0);
 
-	    spotlight(TRUE, from_col, to_col);
+	    spotlight(from_col, to_col);
 
 	    /* TRANSLATORS: This is a prompt. */
 	    i = do_yesno_prompt(TRUE, _("Replace this instance?"));
diff --git a/src/text.c b/src/text.c
index fd372cc..84534fb 100644
--- a/src/text.c
+++ b/src/text.c
@@ -2604,7 +2604,7 @@ bool do_int_spell_fix(const char *word)
 
 	edit_refresh();
 
-	spotlight(TRUE, from_col, to_col);
+	spotlight(from_col, to_col);
 
 	/* Let the user supply a correctly spelled alternative. */
 	proceed = (do_prompt(FALSE, FALSE, MSPELL, word,
diff --git a/src/winio.c b/src/winio.c
index 84defae..ec2283c 100644
--- a/src/winio.c
+++ b/src/winio.c
@@ -3391,16 +3391,15 @@ void enable_waiting(void)
     nodelay(edit, FALSE);
 }
 
-/* Highlight the text between from_col and to_col when active is TRUE.
- * Remove the highlight when active is FALSE. */
-void spotlight(bool active, size_t from_col, size_t to_col)
+/* Highlight the text between from_col and to_col. */
+void spotlight(size_t from_col, size_t to_col)
 {
     char *word;
     size_t word_span, room;
 
 #ifndef NANO_TINY
     if (ISSET(SOFTWRAP)) {
-	spotlight_softwrapped(active, from_col, to_col);
+	spotlight_softwrapped(from_col, to_col);
 	return;
     }
 #endif
@@ -3422,16 +3421,14 @@ void spotlight(bool active, size_t from_col, size_t to_col)
     if (word_span > room)
 	room--;
 
-    if (active)
-	wattron(edit, hilite_attribute);
+    wattron(edit, hilite_attribute);
 
     waddnstr(edit, word, actual_x(word, room));
 
     if (word_span > room)
 	waddch(edit, '$');
 
-    if (active)
-	wattroff(edit, hilite_attribute);
+    wattroff(edit, hilite_attribute);
 
     free(word);
 
@@ -3439,10 +3436,10 @@ void spotlight(bool active, size_t from_col, size_t to_col)
 }
 
 #ifndef NANO_TINY
-/* Highlight the text between from_col and to_col when active is TRUE; remove
- * the highlight when active is FALSE.  This will not highlight softwrapped
+/* Highlight the text between from_col and to_col when active is TRUE.
+ * This will not highlight softwrapped
  * line breaks, since they're not actually part of the spotlighted text. */
-void spotlight_softwrapped(bool active, size_t from_col, size_t to_col)
+void spotlight_softwrapped(size_t from_col, size_t to_col)
 {
     ssize_t row = openfile->current_y;
     size_t leftedge = leftedge_for(from_col, openfile->current);
@@ -3469,13 +3466,11 @@ void spotlight_softwrapped(bool active, size_t from_col, size_t to_col)
 	    word = display_string(openfile->current->data, from_col,
 					break_col - from_col, FALSE);
 
-	if (active)
-	    wattron(edit, hilite_attribute);
+	wattron(edit, hilite_attribute);
 
 	waddnstr(edit, word, actual_x(word, break_col));
 
-	if (active)
-	    wattroff(edit, hilite_attribute);
+	wattroff(edit, hilite_attribute);
 
 	free(word);
 
-- 
2.9.0

