diff options
Diffstat (limited to 'src/plugins/cppeditor/cppautocompleter.cpp')
-rw-r--r-- | src/plugins/cppeditor/cppautocompleter.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/plugins/cppeditor/cppautocompleter.cpp b/src/plugins/cppeditor/cppautocompleter.cpp index a1b5ca5900b..2f6a2fc46f1 100644 --- a/src/plugins/cppeditor/cppautocompleter.cpp +++ b/src/plugins/cppeditor/cppautocompleter.cpp @@ -27,15 +27,20 @@ #include <cplusplus/MatchingText.h> +#include <texteditor/tabsettings.h> + +#include <QTextBlock> #include <QTextCursor> using namespace CppEditor; using namespace Internal; bool CppAutoCompleter::contextAllowsAutoBrackets(const QTextCursor &cursor, - const QString &textToInsert) const + const QString &textToInsert) const { - return CPlusPlus::MatchingText::contextAllowsAutoParentheses(cursor, textToInsert); + const CPlusPlus::MatchingText::IsNextBlockDeeperIndented isIndented + = [this](const QTextBlock &b) { return isNextBlockIndented(b); }; + return CPlusPlus::MatchingText::contextAllowsAutoParentheses(cursor, textToInsert, isIndented); } bool CppAutoCompleter::contextAllowsAutoQuotes(const QTextCursor &cursor, |