mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 18:02:05 -05:00
LibLine: Don't add empty lines to history
This commit is contained in:
parent
67b742bf32
commit
4e607192c7
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