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

in do_gotolinecolumn(), start the search for a line from fileage instead

of current (again)


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2526 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
parent d3d37433
Showing with 4 additions and 9 deletions
+4 -9
...@@ -65,6 +65,8 @@ CVS code - ...@@ -65,6 +65,8 @@ CVS code -
do_gotoline() do_gotoline()
- Properly show an error message if we try to go to line 0, - Properly show an error message if we try to go to line 0,
since the first line in the file is 1. (DLR) since the first line in the file is 1. (DLR)
- Start the search for a line from fileage instead of current
(again). (DLR)
- utils.c: - utils.c:
num_of_digits() num_of_digits()
- Use a size_t instead of an int, and rename to digits(). (DLR) - Use a size_t instead of an int, and rename to digits(). (DLR)
......
...@@ -1016,15 +1016,8 @@ void do_gotolinecolumn(int line, ssize_t column, bool use_answer, bool ...@@ -1016,15 +1016,8 @@ void do_gotolinecolumn(int line, ssize_t column, bool use_answer, bool
column = 0; column = 0;
} }
if (current->lineno > line) { for (current = fileage; current->next != NULL && line > 1; line--)
for (; current->prev != NULL && current->lineno > line; current = current->next;
current = current->prev)
;
} else {
for (; current->next != NULL && current->lineno < line;
current = current->next)
;
}
current_x = actual_x(current->data, column); current_x = actual_x(current->data, column);
placewewant = column; placewewant = column;
......
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