Commit 57542019 authored by David Lawrence Ramsey's avatar David Lawrence Ramsey
Browse files

when calling do_gotolinecolymn(), default to the current line and column

if the ones passed in are unspecified or invalid


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2527 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
No related merge requests found
Showing with 5 additions and 4 deletions
+5 -4
...@@ -255,7 +255,8 @@ int search_init(bool replacing, bool use_answer) ...@@ -255,7 +255,8 @@ int search_init(bool replacing, bool use_answer)
#ifndef NANO_SMALL #ifndef NANO_SMALL
search_history.current = search_history.next; search_history.current = search_history.next;
#endif #endif
do_gotolinecolumn(1, 0, TRUE, TRUE, FALSE); do_gotolinecolumn(current->lineno, placewewant, TRUE,
TRUE, FALSE);
/* Put answer up on the statusbar and /* Put answer up on the statusbar and
* fall through. */ * fall through. */
default: default:
...@@ -1010,10 +1011,10 @@ void do_gotolinecolumn(int line, ssize_t column, bool use_answer, bool ...@@ -1010,10 +1011,10 @@ void do_gotolinecolumn(int line, ssize_t column, bool use_answer, bool
} }
} else { } else {
if (line < 1) if (line < 1)
line = 1; line = current->lineno;
if (column < 0) if (column < 0)
column = 0; column = placewewant;
} }
for (current = fileage; current->next != NULL && line > 1; line--) for (current = fileage; current->next != NULL && line > 1; line--)
...@@ -1031,7 +1032,7 @@ void do_gotolinecolumn(int line, ssize_t column, bool use_answer, bool ...@@ -1031,7 +1032,7 @@ void do_gotolinecolumn(int line, ssize_t column, bool use_answer, bool
void do_gotolinecolumn_void(void) void do_gotolinecolumn_void(void)
{ {
do_gotolinecolumn(1, 1, FALSE, TRUE, FALSE); do_gotolinecolumn(current->lineno, placewewant, FALSE, TRUE, FALSE);
} }
#if defined(ENABLE_MULTIBUFFER) || !defined(DISABLE_SPELLER) #if defined(ENABLE_MULTIBUFFER) || !defined(DISABLE_SPELLER)
......
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