mirror of
https://github.com/alexpasmantier/television.git
synced 2025-06-07 03:55:23 +00:00
formatting
This commit is contained in:
parent
40f466548b
commit
856c570e27
@ -219,7 +219,7 @@ impl OnAir for Channel {
|
||||
.matched_items(
|
||||
offset
|
||||
..(num_entries + offset)
|
||||
.min(snapshot.matched_item_count()),
|
||||
.min(snapshot.matched_item_count()),
|
||||
)
|
||||
.map(move |item| {
|
||||
snapshot.pattern().column_pattern(0).indices(
|
||||
@ -238,11 +238,11 @@ impl OnAir for Channel {
|
||||
display_path.clone() + &item.data.line_number.to_string(),
|
||||
PreviewType::Files,
|
||||
)
|
||||
.with_display_name(display_path)
|
||||
.with_value(line)
|
||||
.with_value_match_ranges(indices.map(|i| (i, i + 1)).collect())
|
||||
.with_icon(FileIcon::from(item.data.path.as_path()))
|
||||
.with_line_number(item.data.line_number)
|
||||
.with_display_name(display_path)
|
||||
.with_value(line)
|
||||
.with_value_match_ranges(indices.map(|i| (i, i + 1)).collect())
|
||||
.with_icon(FileIcon::from(item.data.path.as_path()))
|
||||
.with_line_number(item.data.line_number)
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
@ -364,7 +364,7 @@ fn try_inject_lines(
|
||||
if (bytes_read == 0)
|
||||
|| is_not_text(&buffer).unwrap_or(false)
|
||||
|| proportion_of_printable_ascii_characters(&buffer)
|
||||
< PRINTABLE_ASCII_THRESHOLD
|
||||
< PRINTABLE_ASCII_THRESHOLD
|
||||
{
|
||||
return None;
|
||||
}
|
||||
|
@ -333,12 +333,14 @@ impl Television {
|
||||
}
|
||||
}
|
||||
}
|
||||
Action::CopyEntryToClipboard => if self.mode == Mode::Channel {
|
||||
if let Some(entry) = self.get_selected_entry(None) {
|
||||
let mut ctx = ClipboardContext::new().unwrap();
|
||||
ctx.set_contents(entry.name).unwrap();
|
||||
Action::CopyEntryToClipboard => {
|
||||
if self.mode == Mode::Channel {
|
||||
if let Some(entry) = self.get_selected_entry(None) {
|
||||
let mut ctx = ClipboardContext::new().unwrap();
|
||||
ctx.set_contents(entry.name).unwrap();
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
Action::ToggleSendToChannel => match self.mode {
|
||||
Mode::Channel | Mode::RemoteControl => {
|
||||
self.mode = Mode::SendToChannel;
|
||||
|
@ -174,9 +174,9 @@ impl Television {
|
||||
self.preview_scroll.unwrap_or(0),
|
||||
self.preview_pane_height,
|
||||
)
|
||||
.block(preview_block)
|
||||
.alignment(Alignment::Left)
|
||||
.scroll((self.preview_scroll.unwrap_or(0), 0))
|
||||
.block(preview_block)
|
||||
.alignment(Alignment::Left)
|
||||
.scroll((self.preview_scroll.unwrap_or(0), 0))
|
||||
}
|
||||
// meta
|
||||
PreviewContent::Loading => self
|
||||
|
Loading…
x
Reference in New Issue
Block a user