Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/app/text_copy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,13 +239,13 @@ impl App {

let mut text = String::new();
let mut ranges = Vec::new();
for idx in start..=end {
for (idx, line) in self.lines.iter().enumerate().take(end + 1).skip(start) {
let clusters = match cell {
Some(cell) => match table_cell_clusters(line_clusters(&self.lines[idx]), cell) {
Some(cell) => match table_cell_clusters(line_clusters(line), cell) {
Some(clusters) => clusters,
None => continue,
},
None => line_clusters(&self.lines[idx]),
None => line_clusters(line),
};
let Some(first) = clusters.iter().position(|c| !is_strippable(c)) else {
continue;
Expand Down
6 changes: 1 addition & 5 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,7 @@ pub(crate) struct CliOptions {
}

pub(crate) fn is_diff_spec(value: &str) -> bool {
if value.is_empty() || value.starts_with('-') {
return false;
}

true
!(value.is_empty() || value.starts_with('-'))
}

pub(crate) fn parse_diff_spec(value: &str) -> Result<DiffSpec> {
Expand Down
8 changes: 4 additions & 4 deletions src/tests/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,9 +303,9 @@ fn trailing_blank_context_lines_are_trimmed() {
"Add row must be emitted"
);

for i in (header_idx + 3)..built.lines.len() {
for line in &built.lines[header_idx + 3..] {
assert_ne!(
line_text(&built.lines[i]),
line_text(line),
"│ ",
"no trailing blank context body rows must survive the trim"
);
Expand All @@ -331,9 +331,9 @@ fn both_leading_and_trailing_blanks_trimmed() {
"content Add row must be emitted"
);

for i in (header_idx + 3)..built.lines.len() {
for line in &built.lines[header_idx + 3..] {
assert_ne!(
line_text(&built.lines[i]),
line_text(line),
"│ ",
"no blank context body rows must survive when both trims apply"
);
Expand Down
Loading