gedit r6606 - in trunk: . gedit



Author: icq
Date: Sat Nov 22 15:02:10 2008
New Revision: 6606
URL: http://svn.gnome.org/viewvc/gedit?rev=6606&view=rev

Log:
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.



Modified:
   trunk/ChangeLog
   trunk/gedit/gedit-view.c

Modified: trunk/gedit/gedit-view.c
==============================================================================
--- trunk/gedit/gedit-view.c	(original)
+++ trunk/gedit/gedit-view.c	Sat Nov 22 15:02:10 2008
@@ -1263,7 +1263,7 @@
 
 		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 @@
 			
 			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
 			{



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]