nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 3dc6ccbe86fc8884dd181318f28c82da2de80014
parent b98545f4551937af0dfd6fd818df65161ffc10fe
Author: Benno Schulenberg <bensberg@justemail.net>
Date:   Mon, 17 Apr 2017 11:27:29 +0200

tweaks: rename a function, to be more accurate

Because nothing gets reset to zero or to some initial value.

Diffstat:
Msrc/cut.c | 4++--
Msrc/files.c | 4++--
Msrc/nano.c | 2+-
Msrc/proto.h | 2+-
Msrc/text.c | 6+++---
Msrc/winio.c | 8++++----
6 files changed, 13 insertions(+), 13 deletions(-)

diff --git 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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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);