Added context menu action to compare two files#636
Open
VisarDomi wants to merge 1 commit intocboxdoerfer:masterfrom
Open
Added context menu action to compare two files#636VisarDomi wants to merge 1 commit intocboxdoerfer:masterfrom
VisarDomi wants to merge 1 commit intocboxdoerfer:masterfrom
Conversation
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.
90487a6 to
2820791
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
win.compare-filesthat launches the configured command with the two selected file paths.This also includes a small fix to
config_cmpto correctly classify external tool commands (diff_tool_cmdand the existingfolder_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.