SF.net SVN: geany: [2175] trunk

ntrel at users.sourceforge.net ntrel at xxxxx
Wed Jan 16 13:07:06 UTC 2008


Revision: 2175
          http://geany.svn.sourceforge.net/geany/?rev=2175&view=rev
Author:   ntrel
Date:     2008-01-16 05:07:04 -0800 (Wed, 16 Jan 2008)

Log Message:
-----------
Fix hidden lines after deleting a line that is a collapsed fold
point.

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/src/editor.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2008-01-15 17:04:31 UTC (rev 2174)
+++ trunk/ChangeLog	2008-01-16 13:07:04 UTC (rev 2175)
@@ -1,3 +1,10 @@
+2008-01-16  Nick Treleaven  <nick(dot)treleaven(at)btinternet(dot)com>
+
+ * src/editor.c:
+   Fix hidden lines after deleting a line that is a collapsed fold
+   point.
+
+
 2008-01-15  Nick Treleaven  <nick(dot)treleaven(at)btinternet(dot)com>
 
  * src/dialogs.c:

Modified: trunk/src/editor.c
===================================================================
--- trunk/src/editor.c	2008-01-15 17:04:31 UTC (rev 2174)
+++ trunk/src/editor.c	2008-01-16 13:07:04 UTC (rev 2175)
@@ -266,6 +266,20 @@
 }
 
 
+static void ensure_range_visible(ScintillaObject *sci, gint posStart, gint posEnd,
+		gboolean enforcePolicy)
+{
+	gint lineStart = SSM(sci, SCI_LINEFROMPOSITION, MIN(posStart, posEnd), 0);
+	gint lineEnd = SSM(sci, SCI_LINEFROMPOSITION, MAX(posStart, posEnd), 0);
+	gint line;
+
+	for (line = lineStart; line <= lineEnd; line++)
+	{
+		SSM(sci, enforcePolicy ? SCI_ENSUREVISIBLEENFORCEPOLICY : SCI_ENSUREVISIBLE, line, 0);
+	}
+}
+
+
 // callback func called by all editors when a signal arises
 void on_editor_notification(GtkWidget *editor, gint scn, gpointer lscn, gpointer user_data)
 {
@@ -357,6 +371,11 @@
 			break;
 		}
 #endif
+		case SCN_NEEDSHOWN:
+		{
+			ensure_range_visible(sci, nt->position, nt->position + nt->length, FALSE);
+			break;
+		}
 		case SCN_URIDROPPED:
 		{
 			if (nt->text != NULL)


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list