2

I'm trying to use QScintilla 2.8.3 along side Qt5.3 to make a small text editor but I'm having a problem with folding.

As you can see here:

enter image description here

the end of the folding block does not corespond with the closing bracket.

This is how I'm setting up the lexer and folding:

cpplexer->setDefaultFont( font );
cpplexer->setFoldAtElse( true );
cpplexer->setFoldComments( true );
cpplexer->setFoldCompact( true );
cpplexer->setFoldPreprocessor( true );

editor->setLexer( cpplexer );
editor->setFolding( QsciScintilla::BoxedTreeFoldStyle );

Is it possible to have the block end on the same line as the closing bracket? Is there a flag for this or do I need to change something in QScintilla's source ?

user1233963
  • 1,450
  • 15
  • 41

1 Answers1

2

You just set the setFoldCompact() to true, the documentation says:

virtual void QsciLexerPostScript::setFoldCompact( bool fold ) [virtual, slot]

If fold is true then trailing blank lines are included in a fold block. The default is true.

Turn that off and you'll be good to go.

Marco A.
  • 43,032
  • 26
  • 132
  • 246