Documentation ¶
Index ¶
- func NewDiffBrowserVCS(repo vcs.Repo, revA, revB string)
- type Browser
- func (br *Browser) DiffDirs(pathA, pathB string, excludeFile func(fname string) bool)
- func (br *Browser) DiffVCS(repo vcs.Repo, revA, revB string)
- func (br *Browser) Init()
- func (br *Browser) MakeToolbar(p *tree.Plan)
- func (br *Browser) OpenFiles()
- func (t *Browser) SetPathA(v string) *Browser
- func (t *Browser) SetPathB(v string) *Browser
- func (br *Browser) Splits() *core.Splits
- func (br *Browser) Tabs() *core.Tabs
- func (br *Browser) Tree() *Node
- func (br *Browser) ViewDiff(fn *Node) *texteditor.DiffEditor
- type Node
- func (tn *Node) Browser() *Browser
- func (tn *Node) ContextMenu(m *core.Scene)
- func (tn *Node) Init()
- func (t *Node) SetFileA(v string) *Node
- func (t *Node) SetFileB(v string) *Node
- func (t *Node) SetInfo(v fileinfo.FileInfo) *Node
- func (t *Node) SetRevA(v string) *Node
- func (t *Node) SetRevB(v string) *Node
- func (t *Node) SetStatus(v string) *Node
- func (t *Node) SetTextA(v string) *Node
- func (t *Node) SetTextB(v string) *Node
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDiffBrowserVCS ¶
NewDiffBrowserVCS returns a new diff browser for files that differ between two given revisions in the repository.
Types ¶
type Browser ¶
type Browser struct { core.Frame // starting paths for the files being compared PathA, PathB string }
Browser is a diff browser, for browsing a set of paired files for viewing differences between them, organized into a tree structure, e.g., reflecting their source in a filesystem.
func NewBrowser ¶
NewBrowser returns a new Browser with the given optional parent: Browser is a diff browser, for browsing a set of paired files for viewing differences between them, organized into a tree structure, e.g., reflecting their source in a filesystem.
func NewBrowserWindow ¶
NewBrowserWindow opens a new diff Browser in a new window
func (*Browser) DiffDirs ¶
DiffDirs creates a tree of files within the two paths, where the files have the same names, yet differ in content. The excludeFile function, if non-nil, will exclude files or directories from consideration if it returns true.
func (*Browser) MakeToolbar ¶
func (*Browser) OpenFiles ¶
func (br *Browser) OpenFiles()
OpenFiles Updates the tree based on files
func (*Browser) SetPathA ¶
SetPathA sets the [Browser.PathA]: starting paths for the files being compared
func (*Browser) SetPathB ¶
SetPathB sets the [Browser.PathB]: starting paths for the files being compared
func (*Browser) ViewDiff ¶
func (br *Browser) ViewDiff(fn *Node) *texteditor.DiffEditor
ViewDiff views diff for given file Node, returning a texteditor.DiffEditor
type Node ¶
type Node struct { core.Tree // file names (full path) being compared. Name of node is just the filename. // Typically A is the older, base version and B is the newer one being compared. FileA, FileB string // VCS revisions for files if applicable RevA, RevB string // Status of the change from A to B: A=Added, D=Deleted, M=Modified, R=Renamed Status string // Text content of the files TextA, TextB string // Info about the B file, for getting icons etc Info fileinfo.FileInfo }
Node is an element in the diff tree
func NewNode ¶
NewNode returns a new Node with the given optional parent: Node is an element in the diff tree
func (*Node) ContextMenu ¶
func (*Node) SetFileA ¶
SetFileA sets the [Node.FileA]: file names (full path) being compared. Name of node is just the filename. Typically A is the older, base version and B is the newer one being compared.
func (*Node) SetFileB ¶
SetFileB sets the [Node.FileB]: file names (full path) being compared. Name of node is just the filename. Typically A is the older, base version and B is the newer one being compared.
func (*Node) SetStatus ¶
SetStatus sets the [Node.Status]: Status of the change from A to B: A=Added, D=Deleted, M=Modified, R=Renamed