diff --git a/ChangeLog b/ChangeLog index 7a224d2cbdb1bc851b23599dafa8c7f4567f8b0f..47f78e0c583507425b0a0a779056a6100469430f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,8 @@ * 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. + * src/search.c (do_gotolinecolumn): Chop a duplicate parameter -- + 'allow_update' always has the same value as 'interactive'. 2015-12-30 Benno Schulenberg <bensberg@justemail.net> * 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 55d94aa2b79646a12efda2478420156abc8165e4..de1c050a12998e2e5d478378a82c7e6c29022cf6 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); + do_gotolinecolumn(savedposline, savedposcol, FALSE, FALSE); } else #endif /* !DISABLE_MULTIBUFFER && !DISABLE_HISTORIES */ { diff --git a/src/nano.c b/src/nano.c index f3543ea0042f193d2ca4965102bcb2635064234e..07607467f52b8d28befef870dfea4695610245be 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); + do_gotolinecolumn(iline, icol, FALSE, FALSE); iline = 0; icol = 0; } @@ -2638,7 +2638,7 @@ int main(int argc, char **argv) /* If edited before, restore the last cursor position. */ if (check_poshistory(argv[i], &savedposline, &savedposcol)) do_gotolinecolumn(savedposline, savedposcol, - FALSE, FALSE, 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); + do_gotolinecolumn(startline, startcol, 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); + do_gotolinecolumn(savedposline, savedposcol, FALSE, FALSE); } #endif diff --git a/src/proto.h b/src/proto.h index 564f4e3b8b17987a9dfb453777bce2a9d1a4d012..fd9e3af6f89ca4a30713c4d318b7204675ca12ce 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 allow_update); + bool interactive); 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 8a1d03c8b64cb18958b95ffd27d7d3ec68c88a5a..0556d81e77f7a0bc0fa9c053d795e8d99a3e0dc8 100644 --- a/src/search.c +++ b/src/search.c @@ -236,7 +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, TRUE); + openfile->placewewant + 1, TRUE, TRUE); /* Put answer up on the statusbar and * fall through. */ return 3; @@ -946,10 +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. Update the screen afterwards if allow_update is TRUE. + * is TRUE. In the latter case also update the screen afterwards. * 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 allow_update) + bool interactive) { if (interactive) { char *ans = mallocstrcpy(NULL, answer); @@ -1014,8 +1014,8 @@ void do_gotolinecolumn(ssize_t line, ssize_t column, bool use_answer, /* 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) { + /* When in interactive mode, update the screen. */ + if (interactive) { edit_refresh(); display_main_list(); } @@ -1025,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, TRUE); + openfile->placewewant + 1, FALSE, TRUE); } #ifndef NANO_TINY diff --git a/src/text.c b/src/text.c index f4a75c9d1ca8e552b6b71e934cbb270367a61b6c..ff1a9f635e7092e175f1a1df385a810c9449d4f6 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); + do_gotolinecolumn(curlint->lineno, tmpcol, FALSE, FALSE); titlebar(NULL); edit_refresh(); statusbar(curlint->msg);