mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 12:05:15 +00:00
LibGUI: Add GTextDocument::range_for_entire_line()
This commit is contained in:
parent
9641f74310
commit
150090c742
Notes:
sideshowbarker
2024-07-19 10:53:42 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/150090c7421
2 changed files with 9 additions and 0 deletions
|
@ -552,3 +552,10 @@ void GTextDocument::remove(const GTextRange& unnormalized_range)
|
|||
|
||||
notify_did_change();
|
||||
}
|
||||
|
||||
GTextRange GTextDocument::range_for_entire_line(size_t line_index) const
|
||||
{
|
||||
if (line_index >= line_count())
|
||||
return {};
|
||||
return { { line_index, 0 }, { line_index, line(line_index).length() } };
|
||||
}
|
||||
|
|
|
@ -116,6 +116,8 @@ public:
|
|||
|
||||
char character_at(const GTextPosition&) const;
|
||||
|
||||
GTextRange range_for_entire_line(size_t line_index) const;
|
||||
|
||||
Optional<GTextDocumentSpan> first_non_skippable_span_before(const GTextPosition&) const;
|
||||
Optional<GTextDocumentSpan> first_non_skippable_span_after(const GTextPosition&) const;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue