mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-02 14:48:15 +00:00
LibLine+Shell: Add dirty history flag and use it
This patch adds a new flag called history_dirty to Line::Editor that is set when history is added to but written. Applications can leverage this flag to write history only when it changes. This patch adds an example usage of this functionality to Shell, which will now only save the history when it is dirty.
This commit is contained in:
@@ -2084,7 +2084,7 @@ void Shell::timer_event(Core::TimerEvent& event)
|
||||
if (!m_history_autosave_time.has_value())
|
||||
return;
|
||||
|
||||
if (m_editor)
|
||||
if (m_editor && m_editor->is_history_dirty())
|
||||
m_editor->save_history(get_history_path());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user