diff --git a/src/cut.c b/src/cut.c index 14b20864522b9f95a053aa86238324ac020b37fa..015c80d4489eee5ee63ffc33876533800c023afb 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 b64a58c0a53c3c6295c3ea8693a6d3cd33485b97..8c4b5b83fff6f3c738edfa46bad8f3d983d6743c 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 87e122e44b31deed5c246f295d9bec254764b10d..333dfd45d077a6cf22bb8cdaa6f8ee2565284299 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 11dcc77ee5617c597f5162fe0dce09ce4f979fcc..3e439884bce08c57bd85c10fd607b5a9c1f9a56e 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 2aaebb64ef6606bcc94a74fb3747109781fef57b..2304d6dab0ed26f972403a2979588c67e99ddd07 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 381a1b963fc8aff54751c476da5bd2ddb058e1e7..d5b854c20c4923ae22a86f9db43b188c24429f3a 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);