| 83 | } |
| 84 | |
| 85 | void DataWidget::highlightCurrentLine() { |
| 86 | if (moveable) { |
| 87 | if (!highlights.isEmpty()) { |
| 88 | highlights.removeLast(); |
| 89 | } |
| 90 | addHighlight(QColor(Qt::yellow).lighter(160), Qt::black); |
| 91 | setExtraSelections(highlights); |
| 92 | if (QApplication::keyboardModifiers().testFlag(Qt::ControlModifier)) { |
| 93 | bool ok = true; |
| 94 | |
| 95 | QTextCursor cursor = textCursor(); |
| 96 | cursor.select(QTextCursor::WordUnderCursor); |
| 97 | if (cursor.selectedText().isEmpty()) { |
| 98 | return; |
| 99 | } |
| 100 | |
| 101 | QString weird(QStringLiteral("[]()\",./\\-=")); |
| 102 | |
| 103 | if (weird.contains(cursor.selectedText().at(0))) { |
| 104 | cursor.movePosition(QTextCursor::WordLeft); |
| 105 | cursor.movePosition(QTextCursor::WordLeft); |
| 106 | cursor.select(QTextCursor::WordUnderCursor); |
| 107 | } |
| 108 | setTextCursor(cursor); |
| 109 | |
| 110 | QString equ = getAddressOfEquate(cursor.selectedText().toUpper().toStdString()); |
| 111 | uint32_t address; |
| 112 | |
| 113 | if (!equ.isEmpty()) { |
| 114 | address = hex2int(equ); |
| 115 | } else { |
| 116 | address = textCursor().selectedText().toUInt(&ok, 16); |
| 117 | } |
| 118 | |
| 119 | if (ok) { |
| 120 | if (QApplication::keyboardModifiers().testFlag(Qt::ShiftModifier)) { |
| 121 | emit gotoMemoryAddress(address); |
| 122 | } else { |
| 123 | emit gotoDisasmAddress(address); |
| 124 | } |
| 125 | } |
| 126 | } |
| 127 | } |
| 128 | } |
| 129 | |
| 130 | AsmHighlighter::AsmHighlighter(QTextDocument *parent) : QSyntaxHighlighter(parent) { |
| 131 | HighlightingRule rule; |
nothing calls this directly
no test coverage detected