forked from qt-creator/qt-creator
Editors: Continue refactoring indenters out of the editors.
This is pretty much a complement of commit 3a684586fa,
which is an attempt to make editors and indenters a bit more decoupled.
Reviewed-by: Thorbjorn Lindeijer
This commit is contained in:
@@ -50,15 +50,20 @@ public:
|
||||
Indenter();
|
||||
virtual ~Indenter();
|
||||
|
||||
// Returns true if key triggers an indent.
|
||||
bool isElectricCharacter(const QChar &ch) const;
|
||||
// Indent a text block based on previous line. Default does nothing
|
||||
void indentBlock(QTextDocument *doc,
|
||||
const QTextBlock &block,
|
||||
const QChar &typedChar,
|
||||
BaseTextEditor *editor);
|
||||
// Indent at cursor. Calls indentBlock for selection or current line.
|
||||
void indent(QTextDocument *doc,
|
||||
const QTextCursor &cursor,
|
||||
const QChar &typedChar,
|
||||
BaseTextEditor *editor);
|
||||
// Reindent at cursor. Selection will be adjusted according to the indentation
|
||||
// change of the first block.
|
||||
void reindent(QTextDocument *doc, const QTextCursor &cursor, BaseTextEditor *editor);
|
||||
|
||||
private:
|
||||
@@ -66,7 +71,7 @@ private:
|
||||
virtual void doIndentBlock(QTextDocument *doc,
|
||||
const QTextBlock &block,
|
||||
const QChar &typedChar,
|
||||
BaseTextEditor *editor) = 0;
|
||||
BaseTextEditor *editor);
|
||||
virtual void doIndent(QTextDocument *doc,
|
||||
const QTextCursor &cursor,
|
||||
const QChar &typedChar,
|
||||
|
||||
Reference in New Issue
Block a user