allow_pending_sigwinch()
- Simplify by using the "?" operator instead of an if clause.
(DLR)
+ main()
+ - When opening files with "+LINE,COLUMN" arguments on the
+ command line, don't update the screen when moving to their
+ specified lines and columns. (DLR)
- nano.h:
- Since we only use vsnprintf() now, remove the #ifdef block for
HAVE_SNPRINTF. (DLR)
- Blank out last_replace properly again just before displaying
the "Replace" prompt. (DLR, found by Mike Frysinger)
- Remove unnecessary renumber(). (DLR)
+ do_gotolinecolumn()
+ - Add parameter allow_update to control whether the screen is
+ updated after moving. (DLR)
- winio.c:
edit_scroll(), edit_redraw(), edit_refresh()
- Clean up and simplify. (DLR)
open_buffer(argv[i]);
if (iline > 1 || icol > 1) {
- do_gotolinecolumn(iline, icol, FALSE, FALSE, FALSE);
+ do_gotolinecolumn(iline, icol, FALSE, FALSE, FALSE,
+ FALSE);
iline = 1;
icol = 1;
}
#endif
if (startline > 1 || startcol > 1)
- do_gotolinecolumn(startline, startcol, FALSE, FALSE, FALSE);
+ do_gotolinecolumn(startline, startcol, FALSE, FALSE, FALSE,
+ FALSE);
display_main_list();
*canceled);
void do_replace(void);
void do_gotolinecolumn(ssize_t line, ssize_t column, bool use_answer,
- bool interactive, bool save_pos);
+ bool interactive, bool save_pos, bool allow_update);
void do_gotolinecolumn_void(void);
#if defined(ENABLE_MULTIBUFFER) || !defined(DISABLE_SPELLER)
void do_gotopos(ssize_t line, size_t pos_x, ssize_t pos_y, size_t
return -2; /* Call the opposite search function. */
case NANO_TOGOTOLINE_KEY:
do_gotolinecolumn(openfile->current->lineno,
- openfile->placewewant + 1, TRUE, TRUE, FALSE);
+ openfile->placewewant + 1, TRUE, TRUE, FALSE,
+ TRUE);
/* Put answer up on the statusbar and
* fall through. */
default:
/* 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.
- * Note that both the line and column numbers should be one-based. */
+ * Update the screen afterwards if allow_update is TRUE. Note that both
+ * the line and column numbers should be one-based. */
void do_gotolinecolumn(ssize_t line, ssize_t column, bool use_answer,
- bool interactive, bool save_pos)
+ bool interactive, bool save_pos, bool allow_update)
{
- if (interactive) { /* Ask for it. */
+ if (interactive) {
char *ans = mallocstrcpy(NULL, answer);
+
+ /* Ask for it. */
int i = statusq(FALSE, gotoline_list, use_answer ? ans : "",
#ifndef NANO_SMALL
NULL,
openfile->current_x = actual_x(openfile->current->data, column - 1);
openfile->placewewant = column - 1;
- /* If save_pos is TRUE, don't change the cursor position when
- * updating the edit window. */
- edit_update(save_pos ? NONE : CENTER);
+ /* If allow_update is TRUE, update the edit window. If save_pos is
+ * TRUE, don't change the cursor position when doing it. */
+ if (allow_update)
+ edit_update(save_pos ? NONE : CENTER);
display_main_list();
}
void do_gotolinecolumn_void(void)
{
do_gotolinecolumn(openfile->current->lineno,
- openfile->placewewant + 1, FALSE, TRUE, FALSE);
+ openfile->placewewant + 1, FALSE, TRUE, FALSE, TRUE);
}
#if defined(ENABLE_MULTIBUFFER) || !defined(DISABLE_SPELLER)
/* Since do_gotolinecolumn() resets the x-coordinate but not the
* y-coordinate, set the coordinates up this way. */
openfile->current_y = pos_y;
- do_gotolinecolumn(line, pos_x + 1, FALSE, FALSE, TRUE);
+ do_gotolinecolumn(line, pos_x + 1, FALSE, FALSE, TRUE, TRUE);
/* Set the rest of the coordinates up. */
openfile->placewewant = pos_pww;