summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgnacio Casal Quinteiro <nacho.resa@gmail.com>2008-11-22 15:02:10 +0000
committerIgnacio Casal Quinteiro <icq@src.gnome.org>2008-11-22 15:02:10 +0000
commit46825008e40a4b44f6b1c59f6bc4b64137f5e5f4 (patch)
treefa2ee7a7266754372115b9e69e365f16dde33d12
parent2d6854be1a8b425a4a302ce39886c7234d43624a (diff)
downloadgedit-46825008e40a4b44f6b1c59f6bc4b64137f5e5f4.tar.gz
Now you can type +/- only as the first character. Don't try to jump to a
2008-11-22 Ignacio Casal Quinteiro <nacho.resa@gmail.com> * gedit/gedit-view.c: Now you can type +/- only as the first character. Don't try to jump to a line < 0. svn path=/trunk/; revision=6606
-rw-r--r--ChangeLog6
-rw-r--r--gedit/gedit-view.c12
2 files changed, 13 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 5a398f18b..071e65e7d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,12 @@
2008-11-22 Ignacio Casal Quinteiro <nacho.resa@gmail.com>
* gedit/gedit-view.c:
+ Now you can type +/- only as the first character.
+ Don't try to jump to a line < 0.
+
+2008-11-22 Ignacio Casal Quinteiro <nacho.resa@gmail.com>
+
+ * gedit/gedit-view.c:
Allow the use of "+N" and "-N" in the Move to Line entry.
Fixes bug #560013.
diff --git a/gedit/gedit-view.c b/gedit/gedit-view.c
index 5045b2e67..598b91003 100644
--- a/gedit/gedit-view.c
+++ b/gedit/gedit-view.c
@@ -1263,7 +1263,7 @@ search_entry_insert_text (GtkEditable *editable,
c = g_utf8_get_char (p);
- if (c == '-' || c == '+')
+ if ((c == '-' || c == '+') && *position == 0)
{
next = g_utf8_next_char (p);
p = next;
@@ -1667,19 +1667,21 @@ search_init (GtkWidget *entry,
if (*entry_text == '-')
{
+ gint cur_line = gtk_text_iter_get_line (&view->priv->start_search_iter);
+
if (*(entry_text + 1) != '\0')
offset_line = MAX (atoi (entry_text + 1), 0);
- line = gtk_text_iter_get_line (&view->priv->start_search_iter)
- - offset_line;
+ line = MAX (cur_line - offset_line, 0);
}
else if (*entry_text == '+')
{
+ gint cur_line = gtk_text_iter_get_line (&view->priv->start_search_iter);
+
if (*(entry_text + 1) != '\0')
offset_line = MAX (atoi (entry_text + 1), 0);
- line = gtk_text_iter_get_line (&view->priv->start_search_iter)
- + offset_line;
+ line = cur_line + offset_line;
}
else
{