From c00c044d98d7b208e1a948c5c69a899071aea0a2 Mon Sep 17 00:00:00 2001 From: Vincent Boutour Date: Wed, 13 Dec 2023 15:36:15 +0100 Subject: [PATCH] F - Adding SublimeMerge support --- reporters/diff_reporter.go | 1 + reporters/sublime_merge.go | 12 ++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 reporters/sublime_merge.go diff --git a/reporters/diff_reporter.go b/reporters/diff_reporter.go index f2fb693..3304869 100644 --- a/reporters/diff_reporter.go +++ b/reporters/diff_reporter.go @@ -21,6 +21,7 @@ func NewDiffReporter() Reporter { NewFileMergeReporter(), NewVSCodeReporter(), NewGoLandReporter(), + NewSublimeMergeReporter(), NewRealDiffReporter(), NewPrintSupportedDiffProgramsReporter(), NewQuietReporter(), diff --git a/reporters/sublime_merge.go b/reporters/sublime_merge.go new file mode 100644 index 0000000..e28179e --- /dev/null +++ b/reporters/sublime_merge.go @@ -0,0 +1,12 @@ +package reporters + +type sublimeMerge struct{} + +// NewSublimeMergeReporter creates a new reporter for the SublimeMerge diff tool. +func NewSublimeMergeReporter() Reporter { + return &sublimeMerge{} +} + +func (s *sublimeMerge) Report(approved, received string) bool { + return launchProgram("smerge", approved, "mergetool", received, approved, "-o", approved) +}