mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-21 02:08:12 +03:00
HexEditor: Ignore control keys in text mode
The HexEditor now ignores control key events in text mode. Previously null bytes were written.
This commit is contained in:
parent
fea498e9ac
commit
35c4338625
Notes:
sideshowbarker
2024-07-19 00:25:12 +09:00
Author: https://github.com/GalHorowitz Commit: https://github.com/SerenityOS/serenity/commit/35c43386255 Pull-request: https://github.com/SerenityOS/serenity/pull/4632
@ -447,8 +447,11 @@ void HexEditor::text_mode_keydown_event(GUI::KeyEvent& event)
|
||||
ASSERT(m_position >= 0);
|
||||
ASSERT(m_position < static_cast<int>(m_buffer.size()));
|
||||
|
||||
if (event.code_point() == 0) // This is a control key
|
||||
return;
|
||||
|
||||
m_tracked_changes.set(m_position, m_buffer.data()[m_position]);
|
||||
m_buffer.data()[m_position] = (u8)event.text().characters()[0]; // save the first 4 bits, OR the new value in the last 4
|
||||
m_buffer.data()[m_position] = event.code_point();
|
||||
if (m_position + 1 < static_cast<int>(m_buffer.size()))
|
||||
m_position++;
|
||||
m_byte_position = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user