Commit e5887d9f authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Improved the update of the method combo.

parent 05d2cd60
...@@ -252,17 +252,14 @@ void ScriptEditor::updateMethodBoxIndex() ...@@ -252,17 +252,14 @@ void ScriptEditor::updateMethodBoxIndex()
int currentSymbolIndex = 0; int currentSymbolIndex = 0;
for (int index = 0; index < m_declarations.size(); ++index) { int index = 0;
const Declaration &d = m_declarations.at(index); while (index < m_declarations.size()) {
const Declaration &d = m_declarations.at(index++);
// qDebug() << line << column << d.startLine << d.startColumn << d.endLine << d.endColumn;
if (line < d.startLine)
if (line >= d.startLine || (line == d.startLine && column > d.startColumn)) { break;
if (line < d.endLine || (line == d.endLine && column < d.endColumn)) { else
currentSymbolIndex = index + 1; currentSymbolIndex = index;
break;
}
}
} }
m_methodCombo->setCurrentIndex(currentSymbolIndex); m_methodCombo->setCurrentIndex(currentSymbolIndex);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment