diff options
author | Ignacio Casal Quinteiro <nacho.resa@gmail.com> | 2008-11-22 15:02:10 +0000 |
---|---|---|
committer | Ignacio Casal Quinteiro <icq@src.gnome.org> | 2008-11-22 15:02:10 +0000 |
commit | 46825008e40a4b44f6b1c59f6bc4b64137f5e5f4 (patch) | |
tree | fa2ee7a7266754372115b9e69e365f16dde33d12 | |
parent | 2d6854be1a8b425a4a302ce39886c7234d43624a (diff) | |
download | gedit-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-- | ChangeLog | 6 | ||||
-rw-r--r-- | gedit/gedit-view.c | 12 |
2 files changed, 13 insertions, 5 deletions
@@ -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 { |