From 3dc6ccbe86fc8884dd181318f28c82da2de80014 Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@justemail.net>
Date: Mon, 17 Apr 2017 11:27:29 +0200
Subject: [PATCH] tweaks: rename a function, to be more accurate

Because nothing gets reset to zero or to some initial value.
---
 src/cut.c   | 4 ++--
 src/files.c | 4 ++--
 src/nano.c  | 2 +-
 src/proto.h | 2 +-
 src/text.c  | 6 +++---
 src/winio.c | 8 ++++----
 6 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/src/cut.c b/src/cut.c
index 14b20864..015c80d4 100644
--- a/src/cut.c
+++ b/src/cut.c
@@ -291,8 +291,8 @@ void do_uncut_text(void)
     /* Mark the file as modified. */
     set_modified();
 
-    /* Update the cursor position to account for the inserted lines. */
-    reset_cursor();
+    /* Update current_y to account for the inserted lines. */
+    place_the_cursor();
 
     refresh_needed = TRUE;
 
diff --git a/src/files.c b/src/files.c
index b64a58c0..8c4b5b83 100644
--- a/src/files.c
+++ b/src/files.c
@@ -1200,8 +1200,8 @@ void do_insertfile(void)
 			openfile->current_x != was_current_x)
 		    set_modified();
 
-		/* Update the cursor position to account for inserted lines. */
-		reset_cursor();
+		/* Update current_y to account for inserted lines. */
+		place_the_cursor();
 
 		refresh_needed = TRUE;
 	    }
diff --git a/src/nano.c b/src/nano.c
index 87e122e4..333dfd45 100644
--- a/src/nano.c
+++ b/src/nano.c
@@ -2665,7 +2665,7 @@ int main(int argc, char **argv)
 
 	/* Refresh just the cursor position or the entire edit window. */
 	if (!refresh_needed) {
-	    reset_cursor();
+	    place_the_cursor();
 	    wnoutrefresh(edit);
 	} else
 	    edit_refresh();
diff --git a/src/proto.h b/src/proto.h
index 11dcc77e..3e439884 100644
--- a/src/proto.h
+++ b/src/proto.h
@@ -640,7 +640,7 @@ void warn_and_shortly_pause(const char *msg);
 void statusline(message_type importance, const char *msg, ...);
 void bottombars(int menu);
 void onekey(const char *keystroke, const char *desc, int length);
-void reset_cursor(void);
+void place_the_cursor(void);
 void edit_draw(filestruct *fileptr, const char *converted,
 	int line, size_t from_col);
 int update_line(filestruct *fileptr, size_t index);
diff --git a/src/text.c b/src/text.c
index 2aaebb64..2304d6da 100644
--- a/src/text.c
+++ b/src/text.c
@@ -2443,7 +2443,7 @@ void do_justify(bool full_justify)
     do {
 #endif
 	statusbar(_("Can now UnJustify!"));
-	reset_cursor();
+	place_the_cursor();
 	curs_set(1);
 	kbinput = do_input(FALSE);
 #ifndef NANO_TINY
@@ -3315,7 +3315,7 @@ void do_linter(void)
 	}
 
 	/* Place and show the cursor to indicate the affected line. */
-	reset_cursor();
+	place_the_cursor();
 	wnoutrefresh(edit);
 	curs_set(1);
 
@@ -3559,7 +3559,7 @@ void do_verbatim_input(void)
     /* TRANSLATORS: This is displayed when the next keystroke will be
      * inserted verbatim. */
     statusbar(_("Verbatim Input"));
-    reset_cursor();
+    place_the_cursor();
     curs_set(1);
 
     /* Read in all the verbatim characters. */
diff --git a/src/winio.c b/src/winio.c
index 381a1b96..d5b854c2 100644
--- a/src/winio.c
+++ b/src/winio.c
@@ -1235,7 +1235,7 @@ int parse_escape_sequence(WINDOW *win, int kbinput)
 	    suppress_cursorpos = FALSE;
 	    lastmessage = HUSH;
 	    if (currmenu == MMAIN) {
-		reset_cursor();
+		place_the_cursor();
 		curs_set(1);
 	    }
 	}
@@ -2278,7 +2278,7 @@ void onekey(const char *keystroke, const char *desc, int length)
 
 /* Redetermine current_y from the position of current relative to edittop,
  * and put the cursor in the edit window at (current_y, "current_x"). */
-void reset_cursor(void)
+void place_the_cursor(void)
 {
     ssize_t row = 0;
     size_t col, xpt = xplustabs();
@@ -3087,7 +3087,7 @@ void edit_refresh(void)
     while (row < editwinrows)
 	blank_row(edit, row++, 0, COLS);
 
-    reset_cursor();
+    place_the_cursor();
     wnoutrefresh(edit);
 
     refresh_needed = FALSE;
@@ -3255,7 +3255,7 @@ void spotlight(bool active, const char *word)
 	    room--;
     }
 
-    reset_cursor();
+    place_the_cursor();
 
     if (active)
 	wattron(edit, hilite_attribute);
-- 
GitLab