summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/cpptools/cppchecksymbols.cpp7
-rw-r--r--src/plugins/texteditor/semantichighlighter.h9
2 files changed, 14 insertions, 2 deletions
diff --git a/src/plugins/cpptools/cppchecksymbols.cpp b/src/plugins/cpptools/cppchecksymbols.cpp
index d99e49934d..fbf2766606 100644
--- a/src/plugins/cpptools/cppchecksymbols.cpp
+++ b/src/plugins/cpptools/cppchecksymbols.cpp
@@ -285,7 +285,10 @@ protected:
static bool sortByLinePredicate(const CheckSymbols::Use &lhs, const CheckSymbols::Use &rhs)
{
- return lhs.line < rhs.line;
+ if (lhs.line == rhs.line)
+ return lhs.column < rhs.column;
+ else
+ return lhs.line < rhs.line;
}
@@ -325,7 +328,7 @@ CheckSymbols::CheckSymbols(Document::Ptr doc, const LookupContext &context, cons
unsigned line = 0;
getTokenEndPosition(translationUnit()->ast()->lastToken(), &line, 0);
- _chunkSize = qMin(50U, line / 200);
+ _chunkSize = qMax(50U, line / 200);
_usages.reserve(_chunkSize);
_astStack.reserve(200);
diff --git a/src/plugins/texteditor/semantichighlighter.h b/src/plugins/texteditor/semantichighlighter.h
index 9def1c0db6..e068d3b351 100644
--- a/src/plugins/texteditor/semantichighlighter.h
+++ b/src/plugins/texteditor/semantichighlighter.h
@@ -65,6 +65,15 @@ public:
: line(0), column(0), length(0), kind(-1) {}
Result(unsigned line, unsigned column, unsigned length, int kind)
: line(line), column(column), length(length), kind(kind) {}
+
+ bool operator==(const Result& other) const
+ {
+ return
+ line == other.line &&
+ column == other.column &&
+ length == other.length &&
+ kind == other.kind;
+ }
};
// Applies the future results [from, to) and applies the extra formats