mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 20:59:16 +00:00
LibGUI: Don't delete within a line if the line is empty
This commit is contained in:
parent
2c8309c841
commit
e24f1dfbe1
Notes:
sideshowbarker
2024-07-18 12:46:44 +09:00
Author: https://github.com/dylanbobb
Commit: e24f1dfbe1
Pull-request: https://github.com/SerenityOS/serenity/pull/7832
Issue: https://github.com/SerenityOS/serenity/issues/6013
1 changed files with 3 additions and 0 deletions
|
@ -879,6 +879,9 @@ void TextDocument::remove(const TextRange& unnormalized_range)
|
|||
if (range.start().line() == range.end().line()) {
|
||||
// Delete within same line.
|
||||
auto& line = this->line(range.start().line());
|
||||
if (line.length() == 0)
|
||||
return;
|
||||
|
||||
bool whole_line_is_selected = range.start().column() == 0 && range.end().column() == line.length();
|
||||
|
||||
if (whole_line_is_selected) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue