mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:48:12 +00:00
LibGUI: Make TextEditor write a trailing newline to non-empty files
Fixes #4801.
This commit is contained in:
parent
a048f46be5
commit
7f616449ec
2 changed files with 23 additions and 14 deletions
|
@ -79,6 +79,11 @@ void TextDocument::set_text(const StringView& text)
|
|||
add_line(i);
|
||||
}
|
||||
add_line(i);
|
||||
|
||||
// Don't show the file's trailing newline as an actual new line.
|
||||
if (line_count() > 1 && line(line_count() - 1).is_empty())
|
||||
m_lines.take_last();
|
||||
|
||||
m_client_notifications_enabled = true;
|
||||
|
||||
for (auto* client : m_clients)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue