mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
LibLine: Handle history across multiple concurrent sessions better
- Store history entries as (timestamp)::(entry)\n\n - Merge the entries together when saving to avoid loss of history entries To ideally make having two concurrently open shells (or `js` repls or whatever) not overwrite each others' history entries.
This commit is contained in:
committed by
Andreas Kling
parent
711ced80c0
commit
510030971b
@@ -425,7 +425,7 @@ void Editor::insert_last_words()
|
||||
{
|
||||
if (!m_history.is_empty()) {
|
||||
// FIXME: This isn't quite right: if the last arg was `"foo bar"` or `foo\ bar` (but not `foo\\ bar`), we should insert that whole arg as last token.
|
||||
if (auto last_words = m_history.last().split_view(' '); !last_words.is_empty())
|
||||
if (auto last_words = m_history.last().entry.split_view(' '); !last_words.is_empty())
|
||||
insert(last_words.last());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user