nano

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

commit a195ba6cc014e29d733dc4ec4a863c08fd87576a
parent e05b7a5cd5c38eb6d4e4cb03d5a6ba739074c554
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Fri,  4 Jul 2025 16:36:39 +0200

tweaks: rename a parameter, and invert its logic

Diffstat:
Msrc/history.c | 2+-
Msrc/nano.c | 2+-
Msrc/prototypes.h | 2+-
Msrc/search.c | 6+++---
4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/history.c b/src/history.c @@ -595,6 +595,6 @@ void restore_cursor_position_if_any(void) if (item && item->anchors) restore_anchors(item->anchors); if (item) - goto_line_and_column(item->linenumber, item->columnnumber, FALSE); + goto_line_and_column(item->linenumber, item->columnnumber, TRUE); } #endif /* ENABLE_HISTORIES */ diff --git a/src/nano.c b/src/nano.c @@ -2589,7 +2589,7 @@ int main(int argc, char **argv) if (givenline != 0 || givencol != 0) { openfile->current = openfile->filetop; openfile->placewewant = 0; - goto_line_and_column(givenline, givencol, FALSE); + goto_line_and_column(givenline, givencol, TRUE); } #ifndef NANO_TINY else if (searchstring != NULL) { diff --git a/src/prototypes.h b/src/prototypes.h @@ -485,7 +485,7 @@ void ask_for_and_do_replacements(void); void goto_line_posx(ssize_t line, size_t pos_x); #endif void ask_for_line_and_column(bool retain_answer); -void goto_line_and_column(ssize_t line, ssize_t column, bool interactive); +void goto_line_and_column(ssize_t line, ssize_t column, bool hugfloor); void do_gotolinecolumn(void); #ifndef NANO_TINY void do_find_bracket(void); diff --git a/src/search.c b/src/search.c @@ -802,14 +802,14 @@ void ask_for_line_and_column(bool retain_answer) if (doublesign) line += openfile->current->lineno; - goto_line_and_column(line, column, TRUE); + goto_line_and_column(line, column, FALSE); adjust_viewport((*answer == ',') ? STATIONARY : CENTERING); refresh_needed = TRUE; } /* Go to the specified line and column. (Note that both are one-based.) */ -void goto_line_and_column(ssize_t line, ssize_t column, bool interactive) +void goto_line_and_column(ssize_t line, ssize_t column, bool hugfloor) { if (line == 0) line = openfile->current->lineno; @@ -849,7 +849,7 @@ void goto_line_and_column(ssize_t line, ssize_t column, bool interactive) openfile->placewewant = breadth(openfile->current->data); #endif - if (interactive) + if (!hugfloor) return; int rows_from_tail;