Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When "go to line" is out of bounds, go to beginning or end of document #2973

Merged
merged 9 commits into from
Nov 9, 2021
9 changes: 1 addition & 8 deletions src/callbacks.c
Original file line number Diff line number Diff line change
Expand Up @@ -921,17 +921,10 @@ void on_go_to_line_activate(GtkMenuItem *menuitem, gpointer user_data)
_("Enter the line you want to go to:"), value);
if (result != NULL)
{
GeanyDocument *doc = document_get_current();
g_return_if_fail(doc != NULL);

gint line_no = atoi(result);
gboolean offset = (*result == '+' || *result == '-');
on_toolbutton_goto_entry_activate(NULL, result, NULL);

if (! editor_goto_line(doc->editor, line_no, offset))
utils_beep();
/* remember value for future calls */
g_snprintf(value, sizeof(value), "%s", result);

g_free(result);
}
}
Expand Down