Skip to content

Commit c3f323b

Browse files
Add cursor support (#659)
* Add Cursor support * Docs changes --------- Co-authored-by: GitHub Action <[email protected]>
1 parent fb089d7 commit c3f323b

File tree

9 files changed

+157
-1
lines changed

9 files changed

+157
-1
lines changed

docs/diff-tool.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -873,6 +873,63 @@ Non-MDI tools are preferred since it allows [DiffEngineTray](tray.md) to track a
873873
* `/Applications/Araxis Merge.app/Contents/Utilities/compare`
874874
* `%PATH%compare`
875875

876+
### [Cursor](https://cursor.com)
877+
878+
* Cost: Free and Paid
879+
* Is MDI: True
880+
* Supports auto-refresh: True
881+
* Supports text files: True
882+
* Use shell execute: False
883+
* Environment variable for custom install location: `DiffEngine_Cursor`
884+
* Supported binaries: .bin, .svg
885+
886+
#### Notes:
887+
888+
* [Command line reference](https://cursor.com/docs/configuration/shell)
889+
890+
#### Windows settings:
891+
892+
* Example target on left arguments:
893+
```
894+
--diff "targetFile.txt" "tempFile.txt"
895+
```
896+
* Example target on right arguments:
897+
```
898+
--diff "tempFile.txt" "targetFile.txt"
899+
```
900+
* Scanned paths:
901+
* `%ProgramFiles%\Cursor\Cursor.exe`
902+
* `%ProgramW6432%\Cursor\Cursor.exe`
903+
* `%ProgramFiles(x86)%\Cursor\Cursor.exe`
904+
* `%PATH%Cursor.exe`
905+
906+
#### OSX settings:
907+
908+
* Example target on left arguments:
909+
```
910+
--diff "targetFile.txt" "tempFile.txt"
911+
```
912+
* Example target on right arguments:
913+
```
914+
--diff "tempFile.txt" "targetFile.txt"
915+
```
916+
* Scanned paths:
917+
* `/Applications/Cursor.app/Contents/MacOScursor`
918+
* `%PATH%cursor`
919+
920+
#### Linux settings:
921+
922+
* Example target on left arguments:
923+
```
924+
--diff "targetFile.txt" "tempFile.txt"
925+
```
926+
* Example target on right arguments:
927+
```
928+
--diff "tempFile.txt" "targetFile.txt"
929+
```
930+
* Scanned paths:
931+
* `%PATH%cursor`
932+
876933
### [Meld](https://meldmerge.org/)
877934

878935
* Cost: Free

docs/diff-tool.order.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ To change this file edit the source file and then run MarkdownSnippets.
3131
* **[Meld](/docs/diff-tool.md#meld)** Win/OSX/Linux (Cost: Free)
3232
* **[SublimeMerge](/docs/diff-tool.md#sublimemerge)** Win/OSX/Linux (Cost: Paid)
3333
* **[VisualStudioCode](/docs/diff-tool.md#visualstudiocode)** Win/OSX/Linux (Cost: Free)
34+
* **[Cursor](/docs/diff-tool.md#cursor)** Win/OSX/Linux (Cost: Free and Paid)
3435
* **[VisualStudio](/docs/diff-tool.md#visualstudio)** Win (Cost: Paid and free options)<!-- endInclude -->
3536

3637

readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ DiffEngine manages launching and cleanup of diff tools. It is designed to be use
8484
* **[Meld](/docs/diff-tool.md#meld)** Win/OSX/Linux (Cost: Free)
8585
* **[SublimeMerge](/docs/diff-tool.md#sublimemerge)** Win/OSX/Linux (Cost: Paid)
8686
* **[VisualStudioCode](/docs/diff-tool.md#visualstudiocode)** Win/OSX/Linux (Cost: Free)
87+
* **[Cursor](/docs/diff-tool.md#cursor)** Win/OSX/Linux (Cost: Free and Paid)
8788
* **[VisualStudio](/docs/diff-tool.md#visualstudio)** Win (Cost: Paid and free options)<!-- endInclude -->
8889

8990

src/DiffEngine.Tests/defaultOrder.include.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@
1919
* **[Meld](/docs/diff-tool.md#meld)** Win/OSX/Linux (Cost: Free)
2020
* **[SublimeMerge](/docs/diff-tool.md#sublimemerge)** Win/OSX/Linux (Cost: Paid)
2121
* **[VisualStudioCode](/docs/diff-tool.md#visualstudiocode)** Win/OSX/Linux (Cost: Free)
22+
* **[Cursor](/docs/diff-tool.md#cursor)** Win/OSX/Linux (Cost: Free and Paid)
2223
* **[VisualStudio](/docs/diff-tool.md#visualstudio)** Win (Cost: Paid and free options)

src/DiffEngine.Tests/diffToolList.include.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@
1919
* **[Meld](/docs/diff-tool.md#meld)** Win/OSX/Linux (Cost: Free)
2020
* **[SublimeMerge](/docs/diff-tool.md#sublimemerge)** Win/OSX/Linux (Cost: Paid)
2121
* **[VisualStudioCode](/docs/diff-tool.md#visualstudiocode)** Win/OSX/Linux (Cost: Free)
22+
* **[Cursor](/docs/diff-tool.md#cursor)** Win/OSX/Linux (Cost: Free and Paid)
2223
* **[VisualStudio](/docs/diff-tool.md#visualstudio)** Win (Cost: Paid and free options)

src/DiffEngine.Tests/diffTools.include.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,63 @@ Non-MDI tools are preferred since it allows [DiffEngineTray](tray.md) to track a
738738
* `/Applications/Araxis Merge.app/Contents/Utilities/compare`
739739
* `%PATH%compare`
740740

741+
### [Cursor](https://cursor.com)
742+
743+
* Cost: Free and Paid
744+
* Is MDI: True
745+
* Supports auto-refresh: True
746+
* Supports text files: True
747+
* Use shell execute: False
748+
* Environment variable for custom install location: `DiffEngine_Cursor`
749+
* Supported binaries: .bin, .svg
750+
751+
#### Notes:
752+
753+
* [Command line reference](https://cursor.com/docs/configuration/shell)
754+
755+
#### Windows settings:
756+
757+
* Example target on left arguments:
758+
```
759+
--diff "targetFile.txt" "tempFile.txt"
760+
```
761+
* Example target on right arguments:
762+
```
763+
--diff "tempFile.txt" "targetFile.txt"
764+
```
765+
* Scanned paths:
766+
* `%ProgramFiles%\Cursor\Cursor.exe`
767+
* `%ProgramW6432%\Cursor\Cursor.exe`
768+
* `%ProgramFiles(x86)%\Cursor\Cursor.exe`
769+
* `%PATH%Cursor.exe`
770+
771+
#### OSX settings:
772+
773+
* Example target on left arguments:
774+
```
775+
--diff "targetFile.txt" "tempFile.txt"
776+
```
777+
* Example target on right arguments:
778+
```
779+
--diff "tempFile.txt" "targetFile.txt"
780+
```
781+
* Scanned paths:
782+
* `/Applications/Cursor.app/Contents/MacOScursor`
783+
* `%PATH%cursor`
784+
785+
#### Linux settings:
786+
787+
* Example target on left arguments:
788+
```
789+
--diff "targetFile.txt" "tempFile.txt"
790+
```
791+
* Example target on right arguments:
792+
```
793+
--diff "tempFile.txt" "targetFile.txt"
794+
```
795+
* Scanned paths:
796+
* `%PATH%cursor`
797+
741798
### [Meld](https://meldmerge.org/)
742799

743800
* Cost: Free

src/DiffEngine/Definitions.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ static Definitions() =>
2828
Implementation.Meld(),
2929
Implementation.SublimeMerge(),
3030
Implementation.VisualStudioCode(),
31+
Implementation.Cursor(),
3132
Implementation.VisualStudio()
3233
];
3334
}

src/DiffEngine/DiffTool.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,6 @@ public enum DiffTool
2323
Meld,
2424
SublimeMerge,
2525
VisualStudioCode,
26-
VisualStudio
26+
VisualStudio,
27+
Cursor
2728
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
static partial class Implementation
2+
{
3+
public static Definition Cursor()
4+
{
5+
var launchArguments = new LaunchArguments(
6+
Left: (temp, target) => $"--diff \"{target}\" \"{temp}\"",
7+
Right: (temp, target) => $"--diff \"{temp}\" \"{target}\"");
8+
return new(
9+
Tool: DiffTool.Cursor,
10+
Url: "https://cursor.com",
11+
AutoRefresh: true,
12+
IsMdi: true,
13+
SupportsText: true,
14+
UseShellExecute: false,
15+
RequiresTarget: true,
16+
Cost: "Free and Paid",
17+
BinaryExtensions:
18+
[
19+
".svg",
20+
".bin"
21+
],
22+
OsSupport: new(
23+
Windows: new(
24+
"Cursor.exe",
25+
launchArguments,
26+
@"%ProgramFiles%\Cursor\"),
27+
Linux: new(
28+
"cursor",
29+
launchArguments),
30+
Osx: new(
31+
"cursor",
32+
launchArguments,
33+
"/Applications/Cursor.app/Contents/MacOS")),
34+
Notes: " * [Command line reference](https://cursor.com/docs/configuration/shell)");
35+
}
36+
}

0 commit comments

Comments
 (0)