mirror of
https://github.com/alexpasmantier/television.git
synced 2025-06-01 09:00:16 +00:00
feat(windows): add text channel with preview offset for windows (#514)

This commit is contained in:
parent
d106adafc0
commit
3b3a0ec1ff
@ -4,6 +4,14 @@ name = "files"
|
||||
source_command = "Get-ChildItem -Recurse -File | Select-Object -ExpandProperty FullName"
|
||||
preview.command = "bat -n --color=always {}"
|
||||
|
||||
# Text
|
||||
[[cable_channel]]
|
||||
name = "text"
|
||||
source_command = "rg . --no-heading --line-number"
|
||||
preview.command = "bat -n --color=always {0}"
|
||||
preview.delimiter = ":"
|
||||
preview.offset = "{1}"
|
||||
|
||||
# Directories
|
||||
[[cable_channel]]
|
||||
name = "dirs"
|
||||
|
@ -85,7 +85,12 @@ impl Channel {
|
||||
};
|
||||
|
||||
return Entry::new(name).with_line_number(
|
||||
offset_str.parse::<usize>().unwrap(),
|
||||
offset_str.parse::<usize>().unwrap_or_else(|_| {
|
||||
panic!(
|
||||
"Failed to parse line number from {}",
|
||||
offset_str
|
||||
);
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user