mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-05 00:01:15 -03:00
Fix an off-by-one error in reporting dropped history items
This was introduced in the Rust port. The original C++ was pretty gnarly to be fair.
This commit is contained in:
@@ -309,7 +309,11 @@ fn test_history_races() {
|
||||
continue;
|
||||
};
|
||||
|
||||
// Remove everything from this item on
|
||||
// Remove the item we found.
|
||||
list.remove(position);
|
||||
|
||||
// We expected this item to be the last. Items after this item
|
||||
// in this array were therefore not found in history.
|
||||
let removed = list.drain(position..);
|
||||
for line in removed.into_iter().rev() {
|
||||
printf!("Item dropped from history: %ls\n", line);
|
||||
|
||||
Reference in New Issue
Block a user