Show multiple instructions in edit->bytes dialog

closes #1940
This commit is contained in:
int_13h 2020-01-01 19:09:27 +05:30 committed by karliss
parent 7e6a8ae17a
commit 12c1d2c5ab

View File

@ -46,13 +46,13 @@ void EditInstructionDialog::updatePreview(const QString &input)
return; return;
} else if (editMode == EDIT_BYTES) { } else if (editMode == EDIT_BYTES) {
QByteArray data = CutterCore::hexStringToBytes(input); QByteArray data = CutterCore::hexStringToBytes(input);
result = Core()->disassemble(data).trimmed(); result = Core()->disassemble(data).simplified();
} else if (editMode == EDIT_TEXT) { } else if (editMode == EDIT_TEXT) {
QByteArray data = Core()->assemble(input); QByteArray data = Core()->assemble(input);
result = CutterCore::bytesToHexString(data).trimmed(); result = CutterCore::bytesToHexString(data).trimmed();
} }
if (result.isEmpty() || result.contains(QLatin1Char('\n'))) { if (result.isEmpty() || result.contains("invalid")) {
ui->instructionLabel->setText("Unknown Instruction"); ui->instructionLabel->setText("Unknown Instruction");
} else { } else {
ui->instructionLabel->setText(result); ui->instructionLabel->setText(result);