-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
98 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
; ExplorerDiff - ExplorerDiff.ahk | ||
; author: teric | ||
; created: 2022 2 2 | ||
|
||
ExplorerDiff() { | ||
files := explorer_get_selected() | ||
|
||
if (!files.Length()) { | ||
a2tip("ExplorerDiff: Nothing selected!") | ||
return | ||
} else if (files.Length() != 2) { | ||
MsgBox, Please select 2 files exactly! | ||
} | ||
|
||
if !FileExist(ExplorerDiff_Path) { | ||
if (ExplorerDiff_Path == "") | ||
MsgBox, No Diff app set! Please open the dialog and set one! | ||
else | ||
MsgBox, Unable to find set diff app! The path seems to be invalid!`n`n %ExplorerDiff_Path%`n?? | ||
Return | ||
} | ||
|
||
file1 := files[1], file2 := files[2] | ||
size1 := FileGetSize(file1), size2 := FileGetSize(file2) | ||
|
||
if (size1 == size2) { | ||
identical := true | ||
Loop | ||
{ | ||
FileReadLine, line1, %file1%, %A_Index% | ||
FileReadLine, line2, %file2%, %A_Index% | ||
if ErrorLevel | ||
break | ||
if (line1 != line2) { | ||
identical := false | ||
Break | ||
} | ||
} | ||
if (identical) { | ||
a2tip("ExplorerDiff: Files are identical!") | ||
Return | ||
} | ||
} else | ||
a2tip("ExplorerDiff: Sizes different ... (" size1 "/" size2 ")") | ||
|
||
cmd := """" ExplorerDiff_Path """ """ files[1] """ """ files[2] """" | ||
Run(cmd) | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
[ | ||
{ | ||
"author": "eric", | ||
"date": "2022 2 2", | ||
"description": "Easier file diffing in the Windows Explorer.\nSelect 2 files, Ctrl+D: tell if files are identical already without opening your diff tool. Select one file in Explorer, have another selected in another Explorer window: Offer to diff these right away.", | ||
"display_name": "", | ||
"tags": [ | ||
"file", | ||
"code", | ||
"wip" | ||
], | ||
"typ": "nfo", | ||
"url": "", | ||
"version": "0.1" | ||
}, | ||
{ | ||
"disablable": true, | ||
"enabled": true, | ||
"functionCode": "ExplorerDiff()", | ||
"functionMode": 0, | ||
"key": [ | ||
"Ctrl+D" | ||
], | ||
"keyChange": true, | ||
"label": "Diff selected files", | ||
"multiple": true, | ||
"name": "ExplorerDiff_Hotkey", | ||
"scope": [ | ||
"ahk_class CabinetWClass", | ||
"ahk_class #32770" | ||
], | ||
"scopeChange": true, | ||
"scopeMode": 1, | ||
"typ": "hotkey" | ||
}, | ||
{ | ||
"file": "ExplorerDiff.ahk", | ||
"typ": "include" | ||
}, | ||
{ | ||
"browse_type": 1, | ||
"file_types": "Executable (*.exe)", | ||
"label": "Diff application path", | ||
"name": "ExplorerDiff_Path", | ||
"save_mode": false, | ||
"typ": "path", | ||
"value": ".", | ||
"writable": false | ||
} | ||
] |