mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-19 11: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()
|
void DisassemblyWidget::updateCursorPosition()
|
||||||
{
|
{
|
||||||
connectCursorPositionChanged(true);
|
|
||||||
RVA offset = Core()->getOffset();
|
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))
|
if (offset < topOffset || (offset > bottomOffset && bottomOffset != RVA_INVALID))
|
||||||
{
|
{
|
||||||
mDisasTextEdit->moveCursor(QTextCursor::Start);
|
mDisasTextEdit->moveCursor(QTextCursor::Start);
|
||||||
@ -345,10 +353,10 @@ void DisassemblyWidget::updateCursorPosition()
|
|||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
mDisasTextEdit->setTextCursor(cursor);
|
RVA lineOffset = readDisassemblyOffset(cursor);
|
||||||
RVA lineOffset = readCurrentDisassemblyOffset();
|
|
||||||
if (lineOffset == offset)
|
if (lineOffset == offset)
|
||||||
{
|
{
|
||||||
|
mDisasTextEdit->setTextCursor(cursor);
|
||||||
highlightCurrentLine();
|
highlightCurrentLine();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -394,6 +402,7 @@ void DisassemblyWidget::cursorPositionChanged()
|
|||||||
{
|
{
|
||||||
RVA offset = readCurrentDisassemblyOffset();
|
RVA offset = readCurrentDisassemblyOffset();
|
||||||
Core()->seek(offset);
|
Core()->seek(offset);
|
||||||
|
highlightCurrentLine();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user