Fix hidden lines after deleting a line that is a collapsed fold

point.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2175 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Nick Treleaven 2008-01-16 13:07:04 +00:00
parent f446def461
commit 62c0ad1493
2 changed files with 26 additions and 0 deletions

View File

@ -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:

View File

@ -266,6 +266,20 @@ static void on_char_added(gint idx, SCNotification *nt)
}
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 @@ void on_editor_notification(GtkWidget *editor, gint scn, gpointer lscn, gpointer
break;
}
#endif
case SCN_NEEDSHOWN:
{
ensure_range_visible(sci, nt->position, nt->position + nt->length, FALSE);
break;
}
case SCN_URIDROPPED:
{
if (nt->text != NULL)