mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-25 10:48:41 +00:00
TextEditor: Jump to word break when deleting and holding Ctrl modifier
This commit is contained in:
committed by
Andreas Kling
parent
107db38a51
commit
a2bbacbfc8
@@ -895,7 +895,10 @@ void TextEditor::keydown_event(KeyEvent& event)
|
||||
}
|
||||
if (m_cursor.column() > 0) {
|
||||
int erase_count = 1;
|
||||
if (current_line().first_non_whitespace_column() >= m_cursor.column()) {
|
||||
if (event.modifiers() == Mod_Ctrl) {
|
||||
auto word_break_pos = document().first_word_break_before(m_cursor, true);
|
||||
erase_count = m_cursor.column() - word_break_pos.column();
|
||||
} else if (current_line().first_non_whitespace_column() >= m_cursor.column()) {
|
||||
int new_column;
|
||||
if (m_cursor.column() % m_soft_tab_width == 0)
|
||||
new_column = m_cursor.column() - m_soft_tab_width;
|
||||
|
||||
Reference in New Issue
Block a user