Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
alexpasmantier committed Oct 31, 2024
1 parent 40f4665 commit 856c570
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
14 changes: 7 additions & 7 deletions crates/television/channels/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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()
}
Expand Down Expand Up @@ -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;
}
Expand Down
12 changes: 7 additions & 5 deletions crates/television/television.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions crates/television/ui/preview.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 856c570

Please sign in to comment.