Skip to content

Added context menu action to compare two files#636

Open
VisarDomi wants to merge 1 commit intocboxdoerfer:masterfrom
VisarDomi:feature/meld-compare-action
Open

Added context menu action to compare two files#636
VisarDomi wants to merge 1 commit intocboxdoerfer:masterfrom
VisarDomi:feature/meld-compare-action

Conversation

@VisarDomi
Copy link

@VisarDomi VisarDomi commented Oct 21, 2025

This adds a "Compare" action to the right-click context menu. This action is dynamically added to the menu only when a diff tool command is configured in Preferences. It is enabled when exactly two files are selected.

Motivation:
So, I had a flow in windows where i used Everything to search for a file, selected two files with the same name but different directories, right-click - and used WinMerge to see the differences between them.

I use linux mint now so fsearch is the closest thing to Everything, and the only missing part was comparing (I use meld), which this commit adds.


More info:

The feature includes:

  • A new "Diff tool command" text entry in Preferences -> Interface. The placeholder text is shown by default.
  • A new action win.compare-files that launches the configured command with the two selected file paths.
  • A warning dialog if the command fails to execute.
  • The action state is updated immediately after changing the setting without losing the user's current file selection.

This also includes a small fix to config_cmp to correctly classify external tool commands (diff_tool_cmd and the existing folder_open_cmd) as non-destructive UI changes, preventing an unnecessary and disruptive database reload when these settings are modified. A unit test has been added to verify this specific logic.

compare compare-settings

This adds a "Compare" action to the right-click context menu. This action is dynamically added to the menu only when a diff tool command is configured in Preferences. It is enabled when exactly two files are selected.

The feature includes:
- A new "Diff tool command" text entry in Preferences -> Interface. The placeholder text is shown by default.
- A new action `win.compare-files` that launches the configured command with the two selected file paths.
- A warning dialog if the command fails to execute.
- The action state is updated immediately after changing the setting without losing the user's current file selection.

This also includes a small fix to `config_cmp` to correctly classify external tool commands (`diff_tool_cmd` and the existing `folder_open_cmd`) as non-destructive UI changes, preventing an unnecessary and disruptive database reload when these settings are modified. A unit test has been added to verify this specific logic.
@VisarDomi VisarDomi force-pushed the feature/meld-compare-action branch from 90487a6 to 2820791 Compare October 21, 2025 01:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant