diff options
author | David Schulz <david.schulz@qt.io> | 2024-01-12 15:11:53 +0100 |
---|---|---|
committer | David Schulz <david.schulz@qt.io> | 2024-01-16 07:29:16 +0000 |
commit | e70b99c7da49c27b519f2fcacb4e06974ef1f6ad (patch) | |
tree | abf18ee962bdcea9efa929fd526449271cfbbdaa /src/plugins/texteditor/textindenter.cpp | |
parent | 0db551bfe7465fef862b94bcfca217847a0494d4 (diff) |
TextEditor: avoid autoIndent when using default TextIndenter
Most programming languages use indentation to group stuff. So if we have
no special language support for a text file it is useful to start a
newline on the same indent depth as the previous line. But if we trigger
an explicit reindent (default ctrl+i) we usually don't want to change
the indentation if we don't know exactly where it should end up. This
also applies to refactoring changes, for example from the lsp.
Change-Id: I8268dc88cbceddfc7112757fd7d2fef940ab9a39
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Diffstat (limited to 'src/plugins/texteditor/textindenter.cpp')
-rw-r--r-- | src/plugins/texteditor/textindenter.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/plugins/texteditor/textindenter.cpp b/src/plugins/texteditor/textindenter.cpp index 5684bcfc09..8ffbca4534 100644 --- a/src/plugins/texteditor/textindenter.cpp +++ b/src/plugins/texteditor/textindenter.cpp @@ -51,6 +51,15 @@ int TextIndenter::indentFor(const QTextBlock &block, return tabSettings.indentationColumn(previousText); } +void TextIndenter::autoIndent(const QTextCursor &cursor, + const TabSettings &tabSettings, + int cursorPositionInEditor) +{ + Q_UNUSED(cursor); + Q_UNUSED(tabSettings); + Q_UNUSED(cursorPositionInEditor); +} + IndentationForBlock TextIndenter::indentationForBlocks(const QVector<QTextBlock> &blocks, const TabSettings &tabSettings, int /*cursorPositionInEditor*/) |