mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:07:35 +00:00
HexEditor: Fix off-by-one bugs in selected text length calculations
find_and_highlight() selected +1 too many bytes. 'Select All' selected +1 too many bytes past the end of the buffer. Status bar 'Selected Bytes' count was off by -1 when more than zero bytes were selected.
This commit is contained in:
parent
2e23954271
commit
996f69a1b2
3 changed files with 11 additions and 3 deletions
|
@ -51,7 +51,7 @@ HexEditorWidget::HexEditorWidget()
|
|||
m_statusbar->set_text(1, String::formatted("Edit Mode: {}", edit_mode == HexEditor::EditMode::Hex ? "Hex" : "Text"));
|
||||
m_statusbar->set_text(2, String::formatted("Selection Start: {}", selection_start));
|
||||
m_statusbar->set_text(3, String::formatted("Selection End: {}", selection_end));
|
||||
m_statusbar->set_text(4, String::formatted("Selected Bytes: {}", abs(selection_end - selection_start)));
|
||||
m_statusbar->set_text(4, String::formatted("Selected Bytes: {}", m_editor->selection_size()));
|
||||
};
|
||||
|
||||
m_editor->on_change = [this] {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue