[geany/geany] f99e62: Fix folding of the very last line in a level when unfolding children

Colomban Wendling git-noreply at xxxxx
Fri Nov 22 23:45:39 UTC 2013


Branch:      refs/heads/master
Author:      Colomban Wendling <ban at herbesfolles.org>
Committer:   Colomban Wendling <ban at herbesfolles.org>
Date:        Fri, 22 Nov 2013 23:45:39 UTC
Commit:      f99e627bb0d28821168a44553f92fd5dd60eafe3
             https://github.com/geany/geany/commit/f99e627bb0d28821168a44553f92fd5dd60eafe3

Log Message:
-----------
Fix folding of the very last line in a level when unfolding children

Fix an off-by-one mistake resulting on the very last line of a nested
folded level not to be unfolded when recursively unfolding it's parent.

This was only visible when the last fold point was only one line long,
otherwise unfolding the (N-1)th line was enough.

Closes #1007.


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

Modified: src/editor.c
4 files changed, 2 insertions(+), 2 deletions(-)
===================================================================
@@ -473,7 +473,7 @@ void editor_toggle_fold(GeanyEditor *editor, gint line, gint modifiers)
 
 		if (sci_get_line_is_visible(sci, line + 1))
 		{	/* unfold all children of the current fold point */
-			for (i = line; i < last_line; i++)
+			for (i = line; i <= last_line; i++)
 			{
 				if (! sci_get_line_is_visible(sci, i))
 				{
@@ -483,7 +483,7 @@ void editor_toggle_fold(GeanyEditor *editor, gint line, gint modifiers)
 		}
 		else
 		{	/* fold all children of the current fold point */
-			for (i = line; i < last_line; i++)
+			for (i = line; i <= last_line; i++)
 			{
 				gint level = sci_get_fold_level(sci, i);
 				if (level & SC_FOLDLEVELHEADERFLAG)



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Commits mailing list