Documentation
¶
Index ¶
- Variables
- 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 (t *Browser) New() tree.Node
- func (t *Browser) NodeType() *types.Type
- 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) New() tree.Node
- func (t *Node) NodeType() *types.Type
- func (tn *Node) OnDoubleClick(e events.Event)
- 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 ¶
var BrowserType = types.AddType(&types.Type{Name: "cogentcore.org/core/texteditor/diffbrowser.Browser", IDName: "browser", Doc: "Browser is a diff browser, for browsing a set of paired files\nfor viewing differences between them, organized into a tree\nstructure, e.g., reflecting their source in a filesystem.", Methods: []types.Method{{Name: "OpenFiles", Doc: "OpenFiles Updates the tree based on files", Directives: []types.Directive{{Tool: "types", Directive: "add"}}}}, Embeds: []types.Field{{Name: "Frame"}}, Fields: []types.Field{{Name: "PathA", Doc: "starting paths for the files being compared"}, {Name: "PathB", Doc: "starting paths for the files being compared"}}, Instance: &Browser{}})
BrowserType is the types.Type for Browser
var NodeType = types.AddType(&types.Type{Name: "cogentcore.org/core/texteditor/diffbrowser.Node", IDName: "node", Doc: "Node is an element in the diff tree", Embeds: []types.Field{{Name: "Tree"}}, Fields: []types.Field{{Name: "FileA", Doc: "file names (full path) being compared. Name of node is just the filename.\nTypically A is the older, base version and B is the newer one being compared."}, {Name: "FileB", Doc: "file names (full path) being compared. Name of node is just the filename.\nTypically A is the older, base version and B is the newer one being compared."}, {Name: "RevA", Doc: "VCS revisions for files if applicable"}, {Name: "RevB", Doc: "VCS revisions for files if applicable"}, {Name: "Status", Doc: "Status of the change from A to B: A=Added, D=Deleted, M=Modified, R=Renamed"}, {Name: "TextA", Doc: "Text content of the files"}, {Name: "TextB", Doc: "Text content of the files"}, {Name: "Info", Doc: "Info about the B file, for getting icons etc"}}, Instance: &Node{}})
NodeType is the types.Type for Node
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) NodeType ¶
NodeType returns the *types.Type of Browser
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) NodeType ¶
NodeType returns the *types.Type of Node
func (*Node) OnDoubleClick ¶
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