mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 18:37:34 +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
|
@ -37,6 +37,7 @@ public:
|
|||
|
||||
void select_all();
|
||||
bool has_selection() const { return !(m_selection_start == -1 || m_selection_end == -1 || (m_selection_end - m_selection_start) < 0 || m_buffer.is_empty()); }
|
||||
size_t selection_size();
|
||||
int selection_start_offset() const { return m_selection_start; }
|
||||
bool copy_selected_text_to_clipboard();
|
||||
bool copy_selected_hex_to_clipboard();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue