aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2020-03-05 16:44:52 +0100
committerEike Ziller <eike.ziller@qt.io>2020-03-05 15:45:38 +0000
commitf163b9bcd2c11c84e287fa7cc7d798453892a3d7 (patch)
tree7914620a3a7f70a54cd08c2636d358364956d427
parentedf6d1f89d2c78832253a60d48d7f0cf05bec89c (diff)
Add simple default indenter to Haskell editor
Change-Id: Iecc6f1be2fd18d301046f7508fa91770de41487e Reviewed-by: Eike Ziller <eike.ziller@qt.io>
-rw-r--r--plugins/haskell/haskelleditorfactory.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/plugins/haskell/haskelleditorfactory.cpp b/plugins/haskell/haskelleditorfactory.cpp
index be450d9..2066779 100644
--- a/plugins/haskell/haskelleditorfactory.cpp
+++ b/plugins/haskell/haskelleditorfactory.cpp
@@ -32,6 +32,7 @@
#include <coreplugin/actionmanager/commandbutton.h>
#include <texteditor/textdocument.h>
#include <texteditor/texteditoractionhandler.h>
+#include <texteditor/textindenter.h>
#include <QCoreApplication>
@@ -58,6 +59,7 @@ HaskellEditorFactory::HaskellEditorFactory()
setEditorActionHandlers(TextEditor::TextEditorActionHandler::UnCommentSelection
| TextEditor::TextEditorActionHandler::FollowSymbolUnderCursor);
setDocumentCreator([] { return new TextEditor::TextDocument(Constants::C_HASKELLEDITOR_ID); });
+ setIndenterCreator([](QTextDocument *doc) { return new TextEditor::TextIndenter(doc); });
setEditorWidgetCreator(createEditorWidget);
setCommentDefinition(Utils::CommentDefinition("--", "{-", "-}"));
setParenthesesMatchingEnabled(true);