From 1592ca05857e3834d4fb6a8d0cc5035d4ce1e80a Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Thu, 31 Dec 2015 17:20:46 +0000 Subject: [PATCH] Chopping an always FALSE parameter. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5518 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 1 + src/files.c | 2 +- src/nano.c | 8 ++++---- src/proto.h | 2 +- src/search.c | 18 +++++++----------- src/text.c | 2 +- 6 files changed, 15 insertions(+), 18 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4906c213..7a224d2c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ 2015-12-31 Benno Schulenberg * src/text.c (do_formatter): Restore the cursor position differently. * src/search.c (do_gotopos): Delete this now unused function. + * src/search.c (do_gotolinecolumn): Chop an always FALSE parameter. 2015-12-30 Benno Schulenberg * src/nano.c (main), src/files.c (open_buffer): Don't try to position diff --git a/src/files.c b/src/files.c index 5e421372..55d94aa2 100644 --- a/src/files.c +++ b/src/files.c @@ -1207,7 +1207,7 @@ void do_insertfile( !execute && #endif check_poshistory(answer, &savedposline, &savedposcol)) - do_gotolinecolumn(savedposline, savedposcol, FALSE, FALSE, FALSE, FALSE); + do_gotolinecolumn(savedposline, savedposcol, FALSE, FALSE, FALSE); } else #endif /* !DISABLE_MULTIBUFFER && !DISABLE_HISTORIES */ { diff --git a/src/nano.c b/src/nano.c index 9066bf0e..f3543ea0 100644 --- a/src/nano.c +++ b/src/nano.c @@ -2628,7 +2628,7 @@ int main(int argc, char **argv) /* If a position was given on the command line, go there. */ if (iline > 0 || icol > 0) { - do_gotolinecolumn(iline, icol, FALSE, FALSE, FALSE, FALSE); + do_gotolinecolumn(iline, icol, FALSE, FALSE, FALSE); iline = 0; icol = 0; } @@ -2637,7 +2637,7 @@ int main(int argc, char **argv) ssize_t savedposline, savedposcol; /* If edited before, restore the last cursor position. */ if (check_poshistory(argv[i], &savedposline, &savedposcol)) - do_gotolinecolumn(savedposline, savedposcol, FALSE, + do_gotolinecolumn(savedposline, savedposcol, FALSE, FALSE, FALSE); } #endif @@ -2669,13 +2669,13 @@ int main(int argc, char **argv) /* If a starting position was given on the command line, go there. */ if (startline > 0 || startcol > 0) - do_gotolinecolumn(startline, startcol, FALSE, FALSE, FALSE, FALSE); + do_gotolinecolumn(startline, startcol, FALSE, FALSE, FALSE); #ifndef DISABLE_HISTORIES else { ssize_t savedposline, savedposcol; /* If the file was edited before, restore the last cursor position. */ if (check_poshistory(argv[optind], &savedposline, &savedposcol)) - do_gotolinecolumn(savedposline, savedposcol, FALSE, FALSE, FALSE, FALSE); + do_gotolinecolumn(savedposline, savedposcol, FALSE, FALSE, FALSE); } #endif diff --git a/src/proto.h b/src/proto.h index 53643260..564f4e3b 100644 --- a/src/proto.h +++ b/src/proto.h @@ -619,7 +619,7 @@ ssize_t do_replace_loop( void do_replace(void); void goto_line_posx(ssize_t line, size_t pos_x); void do_gotolinecolumn(ssize_t line, ssize_t column, bool use_answer, - bool interactive, bool save_pos, bool allow_update); + bool interactive, bool allow_update); void do_gotolinecolumn_void(void); #ifndef NANO_TINY bool find_bracket_match(bool reverse, const char *bracket_set); diff --git a/src/search.c b/src/search.c index fb72a823..8a1d03c8 100644 --- a/src/search.c +++ b/src/search.c @@ -236,8 +236,7 @@ int search_init(bool replacing, bool use_answer) return -2; /* Call the opposite search function. */ } else if (func == do_gotolinecolumn_void) { do_gotolinecolumn(openfile->current->lineno, - openfile->placewewant + 1, TRUE, TRUE, FALSE, - TRUE); + openfile->placewewant + 1, TRUE, TRUE, TRUE); /* Put answer up on the statusbar and * fall through. */ return 3; @@ -947,11 +946,10 @@ void goto_line_posx(ssize_t line, size_t pos_x) } /* Go to the specified line and column, or ask for them if interactive - * is TRUE. Save the x-coordinate and y-coordinate if save_pos is TRUE. - * Update the screen afterwards if allow_update is TRUE. Note that both - * the line and column numbers should be one-based. */ + * is TRUE. Update the screen afterwards if allow_update is TRUE. + * Note that both the line and column number should be one-based. */ void do_gotolinecolumn(ssize_t line, ssize_t column, bool use_answer, - bool interactive, bool save_pos, bool allow_update) + bool interactive, bool allow_update) { if (interactive) { char *ans = mallocstrcpy(NULL, answer); @@ -1013,10 +1011,8 @@ void do_gotolinecolumn(ssize_t line, ssize_t column, bool use_answer, openfile->current_x = actual_x(openfile->current->data, column - 1); openfile->placewewant = column - 1; - /* Put the top line of the edit window in range of the current line. - * If save_pos is TRUE, don't change the cursor position when doing - * it. */ - edit_update(save_pos ? NONE : CENTER); + /* Put the top line of the edit window in range of the current line. */ + edit_update(CENTER); /* If allow_update is TRUE, update the screen. */ if (allow_update) { @@ -1029,7 +1025,7 @@ void do_gotolinecolumn(ssize_t line, ssize_t column, bool use_answer, void do_gotolinecolumn_void(void) { do_gotolinecolumn(openfile->current->lineno, - openfile->placewewant + 1, FALSE, TRUE, FALSE, TRUE); + openfile->placewewant + 1, FALSE, TRUE, TRUE); } #ifndef NANO_TINY diff --git a/src/text.c b/src/text.c index c196a93a..f4a75c9d 100644 --- a/src/text.c +++ b/src/text.c @@ -3180,7 +3180,7 @@ void do_linter(void) } } #endif /* !NANO_TINY */ - do_gotolinecolumn(curlint->lineno, tmpcol, FALSE, FALSE, FALSE, FALSE); + do_gotolinecolumn(curlint->lineno, tmpcol, FALSE, FALSE, FALSE); titlebar(NULL); edit_refresh(); statusbar(curlint->msg); -- 2.39.5