diff --git a/src/widgets/DisassemblyWidget.cpp b/src/widgets/DisassemblyWidget.cpp index f3a41735..a9b39f7e 100644 --- a/src/widgets/DisassemblyWidget.cpp +++ b/src/widgets/DisassemblyWidget.cpp @@ -327,9 +327,17 @@ RVA DisassemblyWidget::readDisassemblyOffset(QTextCursor tc) void DisassemblyWidget::updateCursorPosition() { - connectCursorPositionChanged(true); RVA offset = Core()->getOffset(); + // already fine where it is? + RVA currentLineOffset = readCurrentDisassemblyOffset(); + if (currentLineOffset == offset) + { + return; + } + + connectCursorPositionChanged(true); + if (offset < topOffset || (offset > bottomOffset && bottomOffset != RVA_INVALID)) { mDisasTextEdit->moveCursor(QTextCursor::Start); @@ -345,10 +353,10 @@ void DisassemblyWidget::updateCursorPosition() while (true) { - mDisasTextEdit->setTextCursor(cursor); - RVA lineOffset = readCurrentDisassemblyOffset(); + RVA lineOffset = readDisassemblyOffset(cursor); if (lineOffset == offset) { + mDisasTextEdit->setTextCursor(cursor); highlightCurrentLine(); break; } @@ -394,6 +402,7 @@ void DisassemblyWidget::cursorPositionChanged() { RVA offset = readCurrentDisassemblyOffset(); Core()->seek(offset); + highlightCurrentLine(); }