MCPcopy Create free account
hub / github.com/cogentcore/core / DiffEditorDialog

Function DiffEditorDialog

texteditor/diffeditor.go:89–99  ·  view source on GitHub ↗

DiffEditorDialog opens a dialog for displaying diff between two files as line-strings

(ctx core.Widget, title string, astr, bstr []string, afile, bfile, arev, brev string)

Source from the content-addressed store, hash-verified

87
88// DiffEditorDialog opens a dialog for displaying diff between two files as line-strings
89func DiffEditorDialog(ctx core.Widget, title string, astr, bstr []string, afile, bfile, arev, brev string) *DiffEditor {
90 d := core.NewBody("Diff editor")
91 d.SetTitle(title)
92
93 dv := NewDiffEditor(d)
94 dv.SetFileA(afile).SetFileB(bfile).SetRevisionA(arev).SetRevisionB(brev)
95 dv.DiffStrings(astr, bstr)
96 d.AddAppBar(dv.MakeToolbar)
97 d.NewWindow().SetContext(ctx).SetNewWindow(true).Run()
98 return dv
99}
100
101// TextDialog opens a dialog for displaying text string
102func TextDialog(ctx core.Widget, title, text string) *Editor {

Callers 2

DiffFilesFunction · 0.85
DiffEditorDialogFromRevsFunction · 0.85

Calls 13

SetTitleMethod · 0.95
SetFileAMethod · 0.95
DiffStringsMethod · 0.95
AddAppBarMethod · 0.95
NewWindowMethod · 0.95
NewBodyFunction · 0.92
NewDiffEditorFunction · 0.85
SetRevisionBMethod · 0.80
SetRevisionAMethod · 0.80
SetFileBMethod · 0.45
RunMethod · 0.45
SetNewWindowMethod · 0.45

Tested by

no test coverage detected