Skip to content

Commit

Permalink
Fix folding of the very last line in a level when unfolding children
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
b4n committed Nov 22, 2013
1 parent cff36e7 commit f99e627
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/editor.c
Expand Up @@ -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))
{
Expand All @@ -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)
Expand Down

0 comments on commit f99e627

Please sign in to comment.