mirror of
https://github.com/nushell/nushell.git
synced 2025-02-18 03:21:05 +01:00
added real index column to history (#4756)
This commit is contained in:
parent
5ae5ef5146
commit
7701c6b1d4
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -3406,7 +3406,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "reedline"
|
name = "reedline"
|
||||||
version = "0.2.0"
|
version = "0.2.0"
|
||||||
source = "git+https://github.com/nushell/reedline?branch=main#7c5f20d25248901872a91da6c235ae942e815b03"
|
source = "git+https://github.com/nushell/reedline?branch=main#0d6e26276abd8792ee631581a073126d0f845445"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"chrono",
|
"chrono",
|
||||||
"crossterm",
|
"crossterm",
|
||||||
|
@ -53,8 +53,19 @@ impl Command for History {
|
|||||||
if let Ok(contents) = contents {
|
if let Ok(contents) = contents {
|
||||||
Ok(contents
|
Ok(contents
|
||||||
.lines()
|
.lines()
|
||||||
.map(move |x| Value::String {
|
.enumerate()
|
||||||
val: decode_newlines(x),
|
.map(move |(index, command)| Value::Record {
|
||||||
|
cols: vec!["command".to_string(), "index".to_string()],
|
||||||
|
vals: vec![
|
||||||
|
Value::String {
|
||||||
|
val: decode_newlines(command),
|
||||||
|
span: head,
|
||||||
|
},
|
||||||
|
Value::Int {
|
||||||
|
val: index as i64,
|
||||||
|
span: head,
|
||||||
|
},
|
||||||
|
],
|
||||||
span: head,
|
span: head,
|
||||||
})
|
})
|
||||||
.collect::<Vec<_>>()
|
.collect::<Vec<_>>()
|
||||||
|
Loading…
Reference in New Issue
Block a user