Editor: add formatter support

Change-Id: I65590273b2541e08a39970cd9bb4739a5634b2f7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
David Schulz
2019-11-18 10:38:35 +01:00
parent cadb00cdf3
commit 4070d6a289
14 changed files with 154 additions and 35 deletions

View File

@@ -26,6 +26,7 @@
#pragma once
#include "texteditor_global.h"
#include "formatter.h"
#include "indenter.h"
#include <coreplugin/id.h>
@@ -93,11 +94,13 @@ public:
int currentCursorPosition = -1);
void autoReindent(const QTextCursor &cursor, int currentCursorPosition = -1);
void autoFormatOrIndent(const QTextCursor &cursor);
QTextCursor indent(const QTextCursor &cursor, bool blockSelection = false, int column = 0,
int *offset = nullptr);
QTextCursor indent(const QTextCursor &cursor, bool blockSelection, int column, int *offset);
QTextCursor unindent(const QTextCursor &cursor, bool blockSelection = false, int column = 0,
int *offset = nullptr);
void setFormatter(Formatter *indenter); // transfers ownership
void autoFormat(const QTextCursor &cursor);
TextMarks marks() const;
bool addMark(TextMark *mark);
TextMarks marksAt(int line) const;