mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-07 08:39:22 +00:00
LibLine: Don't overwrite stuff when moving origin around
This fixes an issue (mainly) with multiline prompts, where a multiline prompt would overwrite the lines before it when libline tries to display it. To reproduce, set `PROMPT="a\nb\nc> "` in the shell, then press return a few times.
This commit is contained in:
parent
1f03b6ad57
commit
1c4a425bff
Notes:
sideshowbarker
2024-07-19 00:07:27 +09:00
Author: https://github.com/alimpfard
Commit: 1c4a425bff
Pull-request: https://github.com/SerenityOS/serenity/pull/4785
Reviewed-by: https://github.com/linusg
3 changed files with 56 additions and 18 deletions
|
@ -37,6 +37,7 @@ struct StringMetrics {
|
|||
size_t max_line_length { 0 };
|
||||
|
||||
size_t lines_with_addition(const StringMetrics& offset, size_t column_width) const;
|
||||
size_t offset_with_addition(const StringMetrics& offset, size_t column_width) const;
|
||||
void reset()
|
||||
{
|
||||
line_lengths.clear();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue