ViewDiff views diff for given file Node, returning a texteditor.DiffEditor
(fn *Node)
| 90 | |
| 91 | // ViewDiff views diff for given file Node, returning a texteditor.DiffEditor |
| 92 | func (br *Browser) ViewDiff(fn *Node) *texteditor.DiffEditor { |
| 93 | df := fsx.DirAndFile(fn.FileA) |
| 94 | tabs := br.Tabs() |
| 95 | tab := tabs.RecycleTab(df) |
| 96 | if tab.HasChildren() { |
| 97 | dv := tab.Child(1).(*texteditor.DiffEditor) |
| 98 | return dv |
| 99 | } |
| 100 | tb := core.NewToolbar(tab) |
| 101 | dv := texteditor.NewDiffEditor(tab) |
| 102 | tb.Maker(dv.MakeToolbar) |
| 103 | dv.SetFileA(fn.FileA).SetFileB(fn.FileB).SetRevisionA(fn.RevA).SetRevisionB(fn.RevB) |
| 104 | dv.DiffStrings(stringsx.SplitLines(fn.TextA), stringsx.SplitLines(fn.TextB)) |
| 105 | br.Update() |
| 106 | return dv |
| 107 | } |
no test coverage detected