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:
Adam Majer
2009-01-26 13:14:28 +01:00
committed by Thorbjørn Lindeijer
parent 62d78bb062
commit 18952c98b9
5 changed files with 47 additions and 3 deletions

View File

@@ -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()) {