Menu

#2094 Folding: handling newlines at the start of closed folds

minor bug
closed-fixed
6
2007-09-21
2004-05-09
Anonymous
No

Here is the example text folded using explicit folding:
1| //{{{
2| Folding
3| Test
4| Case
5| //}}}
6| Other text

which folds to:
1| //{{{ [4 lines]
6| Other text

By placing the caret after the last brace and pressing
return we get the
following result:
1| //{{{
2| New text entered
7| Other text

In the editor the fold is now showen as unfolded, but the
text within the fold is not displayed. To display the
contents of the fold you have to close the fold and open
it again which then would display the expected text:
1| //{{{
2| New text entered
3| Folding
4| Test
5| Case
6| //}}}
7| Other text

This error appears to exist with any folding plugin, not
just explicit folding. Secondly, with explict folding only,
placing the caret between the braces that make up the
start of the fold whilst folded and pressing return causes
the fold to be 'lost'. As in the space taken up by the fold
is still indicated by jEdit but the fold is no longer
displayed:
1| //{{
2| ^{
7| Other text

There are three ways to get the fold back.
1) Delete the new line and whitespace entered.
This returns the fold in a closed position

2) Add new braces to complete the fold marker.
This adds the fold in an open position but without the
origenal text displayed. Closing and reopening the fold
corrects this, the same as the first bug.

3) Reopen the file

KeeperOfTheSoul <ex@dynafus.com>

Discussion

  • Brad Mace

    Brad Mace - 2006-03-22
    • priority: 5 --> 6
     
  • Brad Mace

    Brad Mace - 2006-03-22

    Logged In: YES
    user_id=370261

    This still occurs in 4.3pre3.

    I'd expect hitting 'enter' at the end of a collapsed fold
    line would create a new line after the fold, rather than
    inside the fold.

     
  • Robert Schwenn

    Robert Schwenn - 2007-01-30

    Logged In: YES
    user_id=1486645
    Originator: NO

    jEdit 4.3pre9: still occurs

    Because "{{{" is the beginning of the fold, I find it's ok to create a new line under "{{{" when hitting ENTER there. But to avoid confusion the fold should be expanded automatically in this case.

     
  • Matthieu Casanova

    • assigned_to: nobody --> kpouer
     
  • Matthieu Casanova

    Logged In: YES
    user_id=285591
    Originator: NO

    fixed in SVN

     
  • Matthieu Casanova

    • status: open --> closed-fixed
     

Log in to post a comment.