Skip to content

Commit

Permalink
fix source code search
Browse files Browse the repository at this point in the history
The search functions only works on a limited range, but the model
contained the complete source code. This patch runs the search function
on only a subset of that code.
fixes: #577
  • Loading branch information
lievenhey committed Apr 15, 2024
1 parent e8f04fc commit 7ca5079
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/models/sourcecodemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ void SourceCodeModel::find(const QString& search, Direction direction, int curre

auto endReached = [this] { emit searchEndReached(); };

const int resultIndex = ::search(m_lines, current, direction, searchFunc, endReached);
const int resultIndex = ::search(m_lines.mid(m_startLine, m_numLines), current, direction, searchFunc, endReached);

if (resultIndex >= 0) {
emit resultFound(createIndex(resultIndex + 1, SourceCodeColumn));
Expand Down

0 comments on commit 7ca5079

Please sign in to comment.