mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
LibWeb: Add Document helpers to move its cursor to word boundaries
This implementation is based on the same feature I added to Serenity's TextEditor: https://github.com/SerenityOS/serenity/pull/17477
This commit is contained in:
parent
eece7697fd
commit
ecf2cc600b
Notes:
github-actions[bot]
2024-09-06 05:44:05 +00:00
Author: https://github.com/trflynn89
Commit: ecf2cc600b
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1292
6 changed files with 92 additions and 0 deletions
|
@ -5423,6 +5423,24 @@ bool Document::decrement_cursor_position_offset()
|
|||
return true;
|
||||
}
|
||||
|
||||
bool Document::increment_cursor_position_to_next_word()
|
||||
{
|
||||
if (!m_cursor_position->increment_offset_to_next_word())
|
||||
return false;
|
||||
|
||||
reset_cursor_blink_cycle();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Document::decrement_cursor_position_to_previous_word()
|
||||
{
|
||||
if (!m_cursor_position->decrement_offset_to_previous_word())
|
||||
return false;
|
||||
|
||||
reset_cursor_blink_cycle();
|
||||
return true;
|
||||
}
|
||||
|
||||
void Document::user_did_edit_document_text(Badge<EditEventHandler>)
|
||||
{
|
||||
reset_cursor_blink_cycle();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue