LibLine: Don't add empty lines to history
This commit is contained in:
parent
67b742bf32
commit
4e607192c7
Notes:
sideshowbarker
2024-07-19 06:08:35 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/4e607192c73 Pull-request: https://github.com/SerenityOS/serenity/pull/2383 Reviewed-by: https://github.com/awesomekling
1 changed files with 2 additions and 0 deletions
|
@ -63,6 +63,8 @@ Editor::~Editor()
|
|||
|
||||
void Editor::add_to_history(const String& line)
|
||||
{
|
||||
if (line.is_empty())
|
||||
return;
|
||||
if ((m_history.size() + 1) > m_history_capacity)
|
||||
m_history.take_first();
|
||||
m_history.append(line);
|
||||
|
|
Loading…
Add table
Reference in a new issue