I'm seeing the following odd behaviour in a container which has SC_AUTOMATICFOLD_SHOW, SC_AUTOMATICFOLD_CLICK and SC_AUTOMATICFOLD_CHANGE all on.
- The initial set of the level numbers is shown in screenshot 1.
- Note how there are 3 lines with whitespace flags.
- Then I click the minus sign.
- Scintilla auto contracts the fold as expected, as shown in screenshot 2.
- Then I type a space in the middle of the word 'Setup'
- This makes the contrainer change the level numbers as shown in screenshot 3 which includes removing the first header flag.
- In this screenshot it can also be seen that Scintilla auto expanded the fold as expected
- However 2 of the 3 lines with the whitespace flags are still invisible. This is the issue.
- Then I remove the space again.
- This makes the contrainer change the level numbers once more, back to the initial state.
- All 3 whitespace lines are visible again, as shown in screenshot 4.
The issue does not appear when I click the plus sign instead in step 5.
I tried looking at Scintilla's folding code but it was too complicated for me to debug the issue.
Thanks!
Greetings,
Martijn Laan
You should add the file to this issue and name the lexer being used.
So it's not a lexer producing the folding but the container?
That's an unusual situation now. Its possible that this scenario isn't compatible with automatic folding and folding will have to be implemented in the application like it was before automatic was added.
Correct, no lexer is involved.
The format appears similar to SciTE's properties file format so I wrote a similar file and set the language to
Properties. This reproduced the levels and header and whitespace line states. For properties, bracketed section headers may contain spaces so a different way of unfolding is needed which can be done by removing the initial '[' . Contracted the first line then removed the '[' to unfold which revealed all the lines including the whitespace lines. Therefore, it appears the problem doesn't reproduce with SciTE.