Skip to content

Commit 94677f6

Browse files
committed
remove remaining text if cursor is at pos 0 or 1 (left/middle)
1 parent 8ae6c79 commit 94677f6

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/frontend/qt_sdl/MemViewDialog.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,13 @@ void CustomTextItem::keyPressEvent(QKeyEvent *event)
108108
QTextCursor cursor = this->textCursor();
109109
int cursorPos = cursor.position();
110110
int anchorPos = cursor.anchor();
111+
112+
if (this->IsKeyHex(key) && cursorPos != 2) {
113+
text.remove(cursorPos, 2 - cursorPos);
114+
this->setPlainText(text);
115+
this->setTextCursor(cursor);
116+
}
117+
111118
qsizetype textLength = text.length();
112119

113120
// make sure that:

0 commit comments

Comments
 (0)