Skip to content

Commit 5cd46e3

Browse files
joskeclaude
andcommitted
batch 2: swap panes, labels, binary detection, filters, patch export
- Swap panes button (Ctrl+Shift+S) for 2-way diff and directory view - Custom labels (-L flag) for all view modes - Binary file detection with info bar - Blank line and whitespace filtering with pre-filter + line remapping - Unified diff patch export (Ctrl+Shift+P) - Fix file watcher overwriting unsaved edits - Fix directory tree collapsing on watcher events - Fix filter toggle racing with duplicate diff calls - Consolidate on_complete callback for refresh_diff/refresh_merge_diffs Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent ab7c0f9 commit 5cd46e3

2 files changed

Lines changed: 670 additions & 275 deletions

File tree

src/main.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,30 @@ struct Cli {
1616
/// Output file for 3-way merge result
1717
#[arg(short, long)]
1818
output: Option<PathBuf>,
19+
20+
/// Custom labels for panes (one per pane)
21+
#[arg(short = 'L', long = "label")]
22+
labels: Vec<String>,
1923
}
2024

2125
#[derive(Clone)]
2226
pub enum CompareMode {
2327
Files {
2428
left: PathBuf,
2529
right: PathBuf,
30+
labels: Vec<String>,
2631
},
2732
Dirs {
2833
left: PathBuf,
2934
right: PathBuf,
35+
labels: Vec<String>,
3036
},
3137
Merge {
3238
left: PathBuf,
3339
middle: PathBuf,
3440
right: PathBuf,
3541
output: Option<PathBuf>,
42+
labels: Vec<String>,
3643
},
3744
}
3845

@@ -56,6 +63,7 @@ fn main() -> glib::ExitCode {
5663
middle: middle.clone(),
5764
right: right.clone(),
5865
output: cli.output,
66+
labels: cli.labels.clone(),
5967
}
6068
} else if cli.paths.len() == 2 {
6169
let left = &cli.paths[0];
@@ -65,11 +73,13 @@ fn main() -> glib::ExitCode {
6573
CompareMode::Files {
6674
left: left.clone(),
6775
right: right.clone(),
76+
labels: cli.labels.clone(),
6877
}
6978
} else if left.is_dir() && right.is_dir() {
7079
CompareMode::Dirs {
7180
left: left.clone(),
7281
right: right.clone(),
82+
labels: cli.labels.clone(),
7383
}
7484
} else if !left.exists() {
7585
eprintln!("Error: '{}' does not exist", left.display());

0 commit comments

Comments
 (0)