mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 14:40:06 +02:00
Adapt for improved history isolation in reedline (#10402)
Depends on https://github.com/nushell/reedline/pull/634 --------- Co-authored-by: WindSoilder <WindSoilder@outlook.com>
This commit is contained in:
@ -70,12 +70,14 @@ impl Command for History {
|
||||
} else {
|
||||
let history_reader: Option<Box<dyn ReedlineHistory>> =
|
||||
match engine_state.config.history_file_format {
|
||||
HistoryFileFormat::Sqlite => SqliteBackedHistory::with_file(history_path)
|
||||
.map(|inner| {
|
||||
let boxed: Box<dyn ReedlineHistory> = Box::new(inner);
|
||||
boxed
|
||||
})
|
||||
.ok(),
|
||||
HistoryFileFormat::Sqlite => {
|
||||
SqliteBackedHistory::with_file(history_path, None, None)
|
||||
.map(|inner| {
|
||||
let boxed: Box<dyn ReedlineHistory> = Box::new(inner);
|
||||
boxed
|
||||
})
|
||||
.ok()
|
||||
}
|
||||
|
||||
HistoryFileFormat::PlainText => FileBackedHistory::with_file(
|
||||
engine_state.config.max_history_size as usize,
|
||||
|
@ -730,9 +730,14 @@ fn update_line_editor_history(
|
||||
)
|
||||
.into_diagnostic()?,
|
||||
),
|
||||
HistoryFileFormat::Sqlite => {
|
||||
Box::new(SqliteBackedHistory::with_file(history_path.to_path_buf()).into_diagnostic()?)
|
||||
}
|
||||
HistoryFileFormat::Sqlite => Box::new(
|
||||
SqliteBackedHistory::with_file(
|
||||
history_path.to_path_buf(),
|
||||
history_session_id,
|
||||
Some(chrono::Utc::now()),
|
||||
)
|
||||
.into_diagnostic()?,
|
||||
),
|
||||
};
|
||||
let line_editor = line_editor
|
||||
.with_history_session_id(history_session_id)
|
||||
|
Reference in New Issue
Block a user