mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 02:13:56 +09:00
LibLine: Consider URL in actual_rendered_string_length
This allows to not count URLs' metadata for the visible length.
This commit is contained in:
parent
84fd011c49
commit
4a9218451d
Notes:
sideshowbarker
2024-07-17 04:38:10 +09:00
Author: https://github.com/LucasChollet
Commit: 4a9218451d
Pull-request: https://github.com/SerenityOS/serenity/pull/15976
Issue: https://github.com/SerenityOS/serenity/issues/15242
Reviewed-by: https://github.com/alimpfard
1 changed files with 7 additions and 0 deletions
|
@ -1778,6 +1778,7 @@ enum VTState {
|
|||
Bracket = 5,
|
||||
BracketArgsSemi = 7,
|
||||
Title = 9,
|
||||
URL = 11,
|
||||
};
|
||||
static VTState actual_rendered_string_length_step(StringMetrics& metrics, size_t index, StringMetrics::LineMetrics& current_line, u32 c, u32 next_c, VTState state, Optional<Style::Mask> const& mask, Optional<size_t> const& maximum_line_width = {}, Optional<size_t&> last_return = {});
|
||||
|
||||
|
@ -1966,6 +1967,8 @@ VTState actual_rendered_string_length_step(StringMetrics& metrics, size_t index,
|
|||
if (c == ']') {
|
||||
if (next_c == '0')
|
||||
state = Title;
|
||||
if (next_c == '8')
|
||||
state = URL;
|
||||
return state;
|
||||
}
|
||||
if (c == '[') {
|
||||
|
@ -1989,6 +1992,10 @@ VTState actual_rendered_string_length_step(StringMetrics& metrics, size_t index,
|
|||
if (c == 7)
|
||||
state = Free;
|
||||
return state;
|
||||
case URL:
|
||||
if (c == '\\')
|
||||
state = Free;
|
||||
return state;
|
||||
}
|
||||
return state;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue