mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-19 10:20:17 -06:00
qscintilla: Enable code folding
This commit is contained in:
@@ -8,6 +8,10 @@ SqlUiLexer::SqlUiLexer(QObject* parent) :
|
||||
autocompleteApi = new QsciAPIs(this);
|
||||
setupAutoCompletion();
|
||||
autocompleteApi->prepare();
|
||||
|
||||
// Setup folding
|
||||
setFoldComments(true);
|
||||
setFoldCompact(false);
|
||||
}
|
||||
|
||||
void SqlUiLexer::setupAutoCompletion()
|
||||
|
||||
@@ -79,6 +79,9 @@ SqlTextEdit::SqlTextEdit(QWidget* parent) :
|
||||
|
||||
// Set tab width
|
||||
setTabWidth(PreferencesDialog::getSettingsValue("editor", "tabsize").toInt());
|
||||
|
||||
// Enable folding
|
||||
setFolding(QsciScintilla::BoxedTreeFoldStyle);
|
||||
}
|
||||
|
||||
SqlTextEdit::~SqlTextEdit()
|
||||
@@ -112,7 +115,6 @@ void SqlTextEdit::dropEvent(QDropEvent* e)
|
||||
f.close();
|
||||
}
|
||||
|
||||
|
||||
void SqlTextEdit::setupSyntaxHighlightingFormat(const QString& settings_name, int style)
|
||||
{
|
||||
sqlLexer->setColor(QColor(PreferencesDialog::getSettingsValue("syntaxhighlighter", settings_name + "_colour").toString()), style);
|
||||
|
||||
Reference in New Issue
Block a user