forked from qt-creator/qt-creator
Add explicit option to clean indentation
It is desirable to have removal of trailing whitespace as a separate option to "tab cleanup". Clean Whitespace option without Clean Indentation option will now only remove trailing whitespace on file save and on Clean Whitespace requests. Clean Indentation option is set to true by default to maintain backward compatibility. Signed-off-by: Adam Majer <adamm@zombino.com>
This commit is contained in:
committed by
Thorbjørn Lindeijer
parent
62d78bb062
commit
18952c98b9
@@ -330,7 +330,7 @@ void BaseTextDocument::cleanWhitespace(QTextCursor& cursor, bool inEntireDocumen
|
||||
cursor.movePosition(QTextCursor::PreviousCharacter, QTextCursor::KeepAnchor, trailing);
|
||||
cursor.removeSelectedText();
|
||||
}
|
||||
if (!m_tabSettings.isIndentationClean(blockText)) {
|
||||
if (m_storageSettings.m_cleanIndentation && !m_tabSettings.isIndentationClean(blockText)) {
|
||||
cursor.setPosition(block.position());
|
||||
int firstNonSpace = m_tabSettings.firstNonSpace(blockText);
|
||||
if (firstNonSpace == blockText.length()) {
|
||||
|
||||
Reference in New Issue
Block a user