TextEditor: Make TabSettings accessible for AutoCompleters

Change-Id: I3591ad94ca98979c2d47585d33800a489d87eeda
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Nikolai Kosjar
2017-07-17 12:41:37 +02:00
parent f77dfd64d5
commit c8a543b949
6 changed files with 23 additions and 18 deletions

View File

@@ -273,8 +273,7 @@ bool AutoCompleter::autoBackspace(QTextCursor &cursor)
return false;
}
int AutoCompleter::paragraphSeparatorAboutToBeInserted(QTextCursor &cursor,
const TabSettings &tabSettings)
int AutoCompleter::paragraphSeparatorAboutToBeInserted(QTextCursor &cursor)
{
if (!m_autoInsertBrackets)
return 0;
@@ -302,15 +301,15 @@ int AutoCompleter::paragraphSeparatorAboutToBeInserted(QTextCursor &cursor,
if (condition) {|
statement;
*/
int indentation = tabSettings.indentationColumn(block.text());
int indentation = m_tabSettings.indentationColumn(block.text());
if (block.next().isValid()) { // not the last block
block = block.next();
//skip all empty blocks
while (block.isValid() && tabSettings.onlySpace(block.text()))
while (block.isValid() && m_tabSettings.onlySpace(block.text()))
block = block.next();
if (block.isValid()
&& tabSettings.indentationColumn(block.text()) > indentation)
&& m_tabSettings.indentationColumn(block.text()) > indentation)
return 0;
}