forked from qt-creator/qt-creator
ClangFormat: Add cursor position to the indenter interface
Sometimes it's imnportant where the cursor currently is to properly format the code without affecting the current line. Change-Id: I8b1fb11d2303adb5f960c7cb80a0ed2e6e45010f Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io> Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
@@ -412,14 +412,14 @@ void TextDocument::setExtraEncodingSettings(const ExtraEncodingSettings &extraEn
|
||||
d->m_extraEncodingSettings = extraEncodingSettings;
|
||||
}
|
||||
|
||||
void TextDocument::autoIndent(const QTextCursor &cursor, QChar typedChar)
|
||||
void TextDocument::autoIndent(const QTextCursor &cursor, QChar typedChar, int currentCursorPosition)
|
||||
{
|
||||
d->m_indenter->indent(cursor, typedChar, tabSettings());
|
||||
d->m_indenter->indent(cursor, typedChar, tabSettings(), currentCursorPosition);
|
||||
}
|
||||
|
||||
void TextDocument::autoReindent(const QTextCursor &cursor)
|
||||
void TextDocument::autoReindent(const QTextCursor &cursor, int currentCursorPosition)
|
||||
{
|
||||
d->m_indenter->reindent(cursor, tabSettings());
|
||||
d->m_indenter->reindent(cursor, tabSettings(), currentCursorPosition);
|
||||
}
|
||||
|
||||
void TextDocument::autoFormatOrIndent(const QTextCursor &cursor)
|
||||
|
||||
Reference in New Issue
Block a user