mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-21 12:26:11 +00:00
Highlight cursor line, not always first of offset in DiassemblyWidget
This commit is contained in:
parent
de010d4c6c
commit
65ec19ddbf
@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user