Commit 46db6384 authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

Chopping a duplicate parameter.

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5519 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
parent 1592ca05
Showing with 15 additions and 13 deletions
+15 -13
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
* src/text.c (do_formatter): Restore the cursor position differently. * src/text.c (do_formatter): Restore the cursor position differently.
* src/search.c (do_gotopos): Delete this now unused function. * 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 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> 2015-12-30 Benno Schulenberg <bensberg@justemail.net>
* src/nano.c (main), src/files.c (open_buffer): Don't try to position * src/nano.c (main), src/files.c (open_buffer): Don't try to position
......
...@@ -1207,7 +1207,7 @@ void do_insertfile( ...@@ -1207,7 +1207,7 @@ void do_insertfile(
!execute && !execute &&
#endif #endif
check_poshistory(answer, &savedposline, &savedposcol)) check_poshistory(answer, &savedposline, &savedposcol))
do_gotolinecolumn(savedposline, savedposcol, FALSE, FALSE, FALSE); do_gotolinecolumn(savedposline, savedposcol, FALSE, FALSE);
} else } else
#endif /* !DISABLE_MULTIBUFFER && !DISABLE_HISTORIES */ #endif /* !DISABLE_MULTIBUFFER && !DISABLE_HISTORIES */
{ {
......
...@@ -2628,7 +2628,7 @@ int main(int argc, char **argv) ...@@ -2628,7 +2628,7 @@ int main(int argc, char **argv)
/* If a position was given on the command line, go there. */ /* If a position was given on the command line, go there. */
if (iline > 0 || icol > 0) { if (iline > 0 || icol > 0) {
do_gotolinecolumn(iline, icol, FALSE, FALSE, FALSE); do_gotolinecolumn(iline, icol, FALSE, FALSE);
iline = 0; iline = 0;
icol = 0; icol = 0;
} }
...@@ -2638,7 +2638,7 @@ int main(int argc, char **argv) ...@@ -2638,7 +2638,7 @@ int main(int argc, char **argv)
/* If edited before, restore the last cursor position. */ /* If edited before, restore the last cursor position. */
if (check_poshistory(argv[i], &savedposline, &savedposcol)) if (check_poshistory(argv[i], &savedposline, &savedposcol))
do_gotolinecolumn(savedposline, savedposcol, do_gotolinecolumn(savedposline, savedposcol,
FALSE, FALSE, FALSE); FALSE, FALSE);
} }
#endif #endif
} }
...@@ -2669,13 +2669,13 @@ int main(int argc, char **argv) ...@@ -2669,13 +2669,13 @@ int main(int argc, char **argv)
/* If a starting position was given on the command line, go there. */ /* If a starting position was given on the command line, go there. */
if (startline > 0 || startcol > 0) if (startline > 0 || startcol > 0)
do_gotolinecolumn(startline, startcol, FALSE, FALSE, FALSE); do_gotolinecolumn(startline, startcol, FALSE, FALSE);
#ifndef DISABLE_HISTORIES #ifndef DISABLE_HISTORIES
else { else {
ssize_t savedposline, savedposcol; ssize_t savedposline, savedposcol;
/* If the file was edited before, restore the last cursor position. */ /* If the file was edited before, restore the last cursor position. */
if (check_poshistory(argv[optind], &savedposline, &savedposcol)) if (check_poshistory(argv[optind], &savedposline, &savedposcol))
do_gotolinecolumn(savedposline, savedposcol, FALSE, FALSE, FALSE); do_gotolinecolumn(savedposline, savedposcol, FALSE, FALSE);
} }
#endif #endif
......
...@@ -619,7 +619,7 @@ ssize_t do_replace_loop( ...@@ -619,7 +619,7 @@ ssize_t do_replace_loop(
void do_replace(void); void do_replace(void);
void goto_line_posx(ssize_t line, size_t pos_x); void goto_line_posx(ssize_t line, size_t pos_x);
void do_gotolinecolumn(ssize_t line, ssize_t column, bool use_answer, void do_gotolinecolumn(ssize_t line, ssize_t column, bool use_answer,
bool interactive, bool allow_update); bool interactive);
void do_gotolinecolumn_void(void); void do_gotolinecolumn_void(void);
#ifndef NANO_TINY #ifndef NANO_TINY
bool find_bracket_match(bool reverse, const char *bracket_set); bool find_bracket_match(bool reverse, const char *bracket_set);
......
...@@ -236,7 +236,7 @@ int search_init(bool replacing, bool use_answer) ...@@ -236,7 +236,7 @@ int search_init(bool replacing, bool use_answer)
return -2; /* Call the opposite search function. */ return -2; /* Call the opposite search function. */
} else if (func == do_gotolinecolumn_void) { } else if (func == do_gotolinecolumn_void) {
do_gotolinecolumn(openfile->current->lineno, do_gotolinecolumn(openfile->current->lineno,
openfile->placewewant + 1, TRUE, TRUE, TRUE); openfile->placewewant + 1, TRUE, TRUE);
/* Put answer up on the statusbar and /* Put answer up on the statusbar and
* fall through. */ * fall through. */
return 3; return 3;
...@@ -946,10 +946,10 @@ void goto_line_posx(ssize_t line, size_t pos_x) ...@@ -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 /* 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. */ * Note that both the line and column number should be one-based. */
void do_gotolinecolumn(ssize_t line, ssize_t column, bool use_answer, void do_gotolinecolumn(ssize_t line, ssize_t column, bool use_answer,
bool interactive, bool allow_update) bool interactive)
{ {
if (interactive) { if (interactive) {
char *ans = mallocstrcpy(NULL, answer); char *ans = mallocstrcpy(NULL, answer);
...@@ -1014,8 +1014,8 @@ void do_gotolinecolumn(ssize_t line, ssize_t column, bool use_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. */ /* Put the top line of the edit window in range of the current line. */
edit_update(CENTER); edit_update(CENTER);
/* If allow_update is TRUE, update the screen. */ /* When in interactive mode, update the screen. */
if (allow_update) { if (interactive) {
edit_refresh(); edit_refresh();
display_main_list(); display_main_list();
} }
...@@ -1025,7 +1025,7 @@ void do_gotolinecolumn(ssize_t line, ssize_t column, bool use_answer, ...@@ -1025,7 +1025,7 @@ void do_gotolinecolumn(ssize_t line, ssize_t column, bool use_answer,
void do_gotolinecolumn_void(void) void do_gotolinecolumn_void(void)
{ {
do_gotolinecolumn(openfile->current->lineno, do_gotolinecolumn(openfile->current->lineno,
openfile->placewewant + 1, FALSE, TRUE, TRUE); openfile->placewewant + 1, FALSE, TRUE);
} }
#ifndef NANO_TINY #ifndef NANO_TINY
......
...@@ -3180,7 +3180,7 @@ void do_linter(void) ...@@ -3180,7 +3180,7 @@ void do_linter(void)
} }
} }
#endif /* !NANO_TINY */ #endif /* !NANO_TINY */
do_gotolinecolumn(curlint->lineno, tmpcol, FALSE, FALSE, FALSE); do_gotolinecolumn(curlint->lineno, tmpcol, FALSE, FALSE);
titlebar(NULL); titlebar(NULL);
edit_refresh(); edit_refresh();
statusbar(curlint->msg); statusbar(curlint->msg);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment