gide

package
v0.5.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2018 License: BSD-3-Clause Imports: 31 Imported by: 0

Documentation

Overview

package gide provides the core Gide editor object.

Derived classes can extend the functionality for specific domains.

WARNING: auto-generated by Makefile release target -- run 'make release' to update

Index

Constants

View Source
const (
	FileTreeIdx = iota
	TextView1Idx
	TextView2Idx
	MainTabsIdx
	VisTabsIdx
)

These are then the fixed indices of the different elements in the splitview

View Source
const (
	Version     = "v0.5.3"
	GitCommit   = "b3b4871"          // the commit JUST BEFORE the release
	VersionDate = "2018-11-15 01:36" // UTC
)
View Source
const NTextViews = 2

NTextViews is the number of text views to create -- to keep things simple and consistent (e.g., splitter settings always have the same number of values), we fix this degree of freedom, and have flexibility in the splitter settings for what to actually show.

Variables

View Source
var ArgVarVals map[string]string

ArgVarVals are current values of arg var vals -- updated on demand when a command is invoked

View Source
var ArgVars = map[string]ArgVarInfo{

	"{FilePath}":       ArgVarInfo{"Current file name with full path.", ArgVarFile},
	"{FileName}":       ArgVarInfo{"Current file name only, without path.", ArgVarFile},
	"{FileExt}":        ArgVarInfo{"Extension of current file name.", ArgVarExt},
	"{FileExtLC}":      ArgVarInfo{"Extension of current file name, lowercase.", ArgVarExt},
	"{FileNameNoExt}":  ArgVarInfo{"Current file name without path and extension.", ArgVarFile},
	"{FileDir}":        ArgVarInfo{"Name only of current file's directory.", ArgVarDir},
	"{FileDirPath}":    ArgVarInfo{"Full path to current file's directory.", ArgVarDir},
	"{FileDirProjRel}": ArgVarInfo{"Path to current file's directory relative to project root.", ArgVarDir},

	"{ProjDir}":  ArgVarInfo{"Current project directory name, without full path.", ArgVarDir},
	"{ProjPath}": ArgVarInfo{"Full path to current project directory.", ArgVarDir},

	"{BuildDir}":    ArgVarInfo{"Full path to BuildDir specified in project prefs -- the default Build.", ArgVarDir},
	"{BuildDirRel}": ArgVarInfo{"Path to BuildDir relative to project root.", ArgVarDir},

	"{BuildTarg}":           ArgVarInfo{"Build target specified in prefs BuildTarg, just filename by itself, without path.", ArgVarFile},
	"{BuildTargPath}":       ArgVarInfo{"Full path to build target specified in prefs BuildTarg.", ArgVarFile},
	"{BuildTargDirPath}":    ArgVarInfo{"Full path to build target directory, without filename.", ArgVarDir},
	"{BuildTargDirPathRel}": ArgVarInfo{"Project-relative path to build target directory, without filename.", ArgVarDir},

	"{RunExec}":           ArgVarInfo{"Run-time executable file RunExec specified in project prefs -- just the raw name of the file, without path.", ArgVarFile},
	"{RunExecPath}":       ArgVarInfo{"Full path to the run-time executable file RunExec specified in project prefs.", ArgVarFile},
	"{RunExecDirPath}":    ArgVarInfo{"Full path to the directory of the run-time executable file RunExec specified in project prefs.", ArgVarDir},
	"{RunExecDirPathRel}": ArgVarInfo{"Project-root relative path to the directory of the run-time executable file RunExec specified in project prefs.", ArgVarDir},

	"{CurLine}":      ArgVarInfo{"Cursor current line number (starts at 1).", ArgVarPos},
	"{CurCol}":       ArgVarInfo{"Cursor current column number (starts at 0).", ArgVarPos},
	"{SelStartLine}": ArgVarInfo{"Selection starting line (same as CurLine if no selection).", ArgVarPos},
	"{SelStartCol}":  ArgVarInfo{"Selection starting column (same as CurCol if no selection).", ArgVarPos},
	"{SelEndLine}":   ArgVarInfo{"Selection ending line (same as CurLine if no selection).", ArgVarPos},
	"{SelEndCol}":    ArgVarInfo{"Selection ending column (same as CurCol if no selection).", ArgVarPos},

	"{CurSel}":      ArgVarInfo{"Currently selected text.", ArgVarText},
	"{CurLineText}": ArgVarInfo{"Current line text under cursor.", ArgVarText},
	"{CurWord}":     ArgVarInfo{"Current word under cursor.", ArgVarText},

	"{PromptFilePath}":       ArgVarInfo{"Prompt user for a file, and this is the full path to that file.", ArgVarPrompt},
	"{PromptFileName}":       ArgVarInfo{"Prompt user for a file, and this is the filename (only) of that file.", ArgVarPrompt},
	"{PromptFileDir}":        ArgVarInfo{"Prompt user for a file, and this is the directory name (only) of that file.", ArgVarPrompt},
	"{PromptFileDirPath}":    ArgVarInfo{"Prompt user for a file, and this is the full path to that directory.", ArgVarPrompt},
	"{PromptFileDirProjRel}": ArgVarInfo{"Prompt user for a file, and this is the path of that directory relative to the project root.", ArgVarPrompt},
	"{PromptString1}":        ArgVarInfo{"Prompt user for a string -- this is it.", ArgVarPrompt},
	"{PromptString2}":        ArgVarInfo{"Prompt user for another string -- this is it.", ArgVarPrompt},
}

ArgVars are variables that can be used for arguments to commands in CmdAndArgs

View Source
var AvailKeyMapsChanged = false

AvailKeyMapsChanged is used to update giv.KeyMapsView toolbars via following menu, toolbar props update methods -- not accurate if editing any other map but works for now..

View Source
var AvailLangsChanged = false

AvailLangsChanged is used to update giv.LangsView toolbars via following menu, toolbar props update methods -- not accurate if editing any other map but works for now..

View Source
var AvailRegisterNames []string

AvailRegisterNames are the names of the current AvailRegisters -- used for some choosers

View Source
var AvailRegistersChanged = false

AvailRegistersChanged is used to update toolbars via following menu, toolbar props update methods -- not accurate if editing any other map but works for now..

View Source
var AvailSplitNames []string

AvailSplitNames are the names of the current AvailSplits -- used for some choosers

View Source
var AvailSplitsChanged = false

AvailSplitsChanged is used to update toolbars via following menu, toolbar props update methods -- not accurate if editing any other map but works for now..

View Source
var CmdNoUserPrompt bool

CmdNoUserPrompt can be set to true to prevent user from being prompted for strings this is useful when a custom outer-loop has already set the string values. this will be reset automatically after command is run.

View Source
var CmdOutStatusLen = 80

CmdOutStatusLen is amount of command output to include in the status update

View Source
var CmdWaitOverride bool

CmdWaitOverride will cause the next commands that are run to be in wait mode (sequentially, waiting for completion after each), instead of running each in a separate process as is typical. Don't forget to reset it after commands. This is important when running multiple of the same command, to prevent collisions in the output buffer.

View Source
var CommandsProps = ki.Props{
	"MainMenu": ki.PropSlice{
		{"AppMenu", ki.BlankProp{}},
		{"File", ki.PropSlice{
			{"OpenPrefs", ki.Props{}},
			{"SavePrefs", ki.Props{
				"shortcut": "Command+S",
				"updtfunc": giv.ActionUpdateFunc(func(cmi interface{}, act *gi.Action) {
					act.SetActiveState(CustomCmdsChanged && cmi.(*Commands) == &CustomCmds)
				}),
			}},
			{"sep-file", ki.BlankProp{}},
			{"OpenJSON", ki.Props{
				"label":    "Open from file",
				"desc":     "You can save and open commands to / from files to share, experiment, transfer, etc",
				"shortcut": "Command+O",
				"Args": ki.PropSlice{
					{"File Name", ki.Props{
						"ext": ".json",
					}},
				},
			}},
			{"SaveJSON", ki.Props{
				"label": "Save to file",
				"desc":  "You can save and open commands to / from files to share, experiment, transfer, etc",
				"Args": ki.PropSlice{
					{"File Name", ki.Props{
						"ext": ".json",
					}},
				},
			}},
		}},
		{"Edit", "Copy Cut Paste Dupe"},
		{"Window", "Windows"},
	},
	"ToolBar": ki.PropSlice{
		{"SavePrefs", ki.Props{
			"desc": "saves Commands to App standard prefs directory, in file proj_types_prefs.json, which will be loaded automatically at startup if prefs SaveCommands is checked (should be if you're using custom commands)",
			"icon": "file-save",
			"updtfunc": giv.ActionUpdateFunc(func(cmi interface{}, act *gi.Action) {
				act.SetActiveState(CustomCmdsChanged && cmi.(*Commands) == &CustomCmds)
			}),
		}},
		{"sep-file", ki.BlankProp{}},
		{"OpenJSON", ki.Props{
			"label": "Open from file",
			"icon":  "file-open",
			"desc":  "You can save and open commands to / from files to share, experiment, transfer, etc",
			"Args": ki.PropSlice{
				{"File Name", ki.Props{
					"ext": ".json",
				}},
			},
		}},
		{"SaveJSON", ki.Props{
			"label": "Save to file",
			"icon":  "file-save",
			"desc":  "You can save and open commands to / from files to share, experiment, transfer, etc",
			"Args": ki.PropSlice{
				{"File Name", ki.Props{
					"ext": ".json",
				}},
			},
		}},
		{"sep-std", ki.BlankProp{}},
		{"ViewStd", ki.Props{
			"desc": "Shows the standard commands that are compiled into the program (edits will not be saved -- even though the viewer is editable).  Custom commands override standard ones of the same name, so that is the way to change any existing commands.",
			"updtfunc": giv.ActionUpdateFunc(func(cmi interface{}, act *gi.Action) {
				act.SetActiveState(cmi.(*Commands) != &StdCmds)
			}),
		}},
	},
}

CommandsProps define the ToolBar and MenuBar for TableView of Commands, e.g., CmdsView

View Source
var CustomCmdsChanged = false

CustomCmdsChanged is used to update giv.CmdsView toolbars via following menu, toolbar props update methods.

View Source
var DefaultKeyMap = KeyMapName("MacEmacs")

DefaultKeyMap is the overall default keymap -- reinitialized in gimain init() depending on platform

View Source
var ExtToLangMap = map[string]Langs{}

ExtToLangMap is a compiled map of file extensions (always lowercased) and their associated language(s) -- there can be some ambiguity (e.g., .h files), so multiple languages are allowed

View Source
var FileNodeProps = ki.Props{
	"CallMethods": ki.PropSlice{
		{"RenameFile", ki.Props{
			"label": "Rename",
			"desc":  "Rename file to new file name",
			"Args": ki.PropSlice{
				{"New Name", ki.Props{
					"default-field": "Name",
					"width":         60,
				}},
			},
		}},
	},
}
View Source
var FileTreeActiveDirFunc = giv.ActionUpdateFunc(func(fni interface{}, act *gi.Action) {
	ft := fni.(ki.Ki).Embed(KiT_FileTreeView).(*FileTreeView)
	fn := ft.FileNode()
	if fn != nil {
		act.SetActiveState(fn.IsDir())
	}
})

FileTreeActiveDirFunc is an ActionUpdateFunc that activates action if node is a dir

View Source
var FileTreeInactiveDirFunc = giv.ActionUpdateFunc(func(fni interface{}, act *gi.Action) {
	ft := fni.(ki.Ki).Embed(KiT_FileTreeView).(*FileTreeView)
	fn := ft.FileNode()
	if fn != nil {
		act.SetInactiveState(fn.IsDir())
	}
})

FileTreeInactiveDirFunc is an ActionUpdateFunc that inactivates action if node is a dir

View Source
var FileTreeViewProps = ki.Props{
	"indent":           units.NewValue(2, units.Ch),
	"spacing":          units.NewValue(.5, units.Ch),
	"border-width":     units.NewValue(0, units.Px),
	"border-radius":    units.NewValue(0, units.Px),
	"padding":          units.NewValue(0, units.Px),
	"margin":           units.NewValue(1, units.Px),
	"text-align":       gi.AlignLeft,
	"vertical-align":   gi.AlignTop,
	"color":            &gi.Prefs.Colors.Font,
	"background-color": "inherit",
	".exec": ki.Props{
		"font-weight": gi.WeightBold,
	},
	".open": ki.Props{
		"font-style": gi.FontItalic,
	},
	"#icon": ki.Props{
		"width":   units.NewValue(1, units.Em),
		"height":  units.NewValue(1, units.Em),
		"margin":  units.NewValue(0, units.Px),
		"padding": units.NewValue(0, units.Px),
		"fill":    &gi.Prefs.Colors.Icon,
		"stroke":  &gi.Prefs.Colors.Font,
	},
	"#branch": ki.Props{
		"icon":             "widget-wedge-down",
		"icon-off":         "widget-wedge-right",
		"margin":           units.NewValue(0, units.Px),
		"padding":          units.NewValue(0, units.Px),
		"background-color": color.Transparent,
		"max-width":        units.NewValue(.8, units.Em),
		"max-height":       units.NewValue(.8, units.Em),
	},
	"#space": ki.Props{
		"width": units.NewValue(.5, units.Em),
	},
	"#label": ki.Props{
		"margin":    units.NewValue(0, units.Px),
		"padding":   units.NewValue(0, units.Px),
		"min-width": units.NewValue(16, units.Ch),
	},
	"#menu": ki.Props{
		"indicator": "none",
	},
	giv.TreeViewSelectors[giv.TreeViewActive]: ki.Props{},
	giv.TreeViewSelectors[giv.TreeViewSel]: ki.Props{
		"background-color": &gi.Prefs.Colors.Select,
	},
	giv.TreeViewSelectors[giv.TreeViewFocus]: ki.Props{
		"background-color": &gi.Prefs.Colors.Control,
	},
	"CtxtMenuActive": ki.PropSlice{
		{"ViewFiles", ki.Props{
			"label":    "View",
			"updtfunc": FileTreeInactiveDirFunc,
		}},
		{"ExecCmdFiles", ki.Props{
			"label":        "Exec Cmd",
			"submenu-func": giv.SubMenuFunc(FileTreeViewExecCmds),
			"Args": ki.PropSlice{
				{"Cmd Name", ki.Props{}},
			},
		}},
		{"DuplicateFiles", ki.Props{
			"label":    "Duplicate",
			"updtfunc": FileTreeInactiveDirFunc,
		}},
		{"DeleteFiles", ki.Props{
			"label":    "Delete",
			"desc":     "Ok to delete file(s)?  This is not undoable and is not moving to trash / recycle bin",
			"confirm":  true,
			"updtfunc": FileTreeInactiveDirFunc,
		}},
		{"RenameFiles", ki.Props{
			"label": "Rename",
			"desc":  "Rename file to new file name",
		}},
		{"sep-open", ki.BlankProp{}},
		{"OpenDirs", ki.Props{
			"label":    "Open Dir",
			"desc":     "open given folder to see files within",
			"updtfunc": FileTreeActiveDirFunc,
		}},
		{"NewFile", ki.Props{
			"label":    "New File...",
			"desc":     "make a new file in this folder",
			"updtfunc": FileTreeActiveDirFunc,
			"Args": ki.PropSlice{
				{"File Name", ki.Props{
					"width": 60,
				}},
			},
		}},
		{"NewFolder", ki.Props{
			"label":    "New Folder...",
			"desc":     "make a new folder within this folder",
			"updtfunc": FileTreeActiveDirFunc,
			"Args": ki.PropSlice{
				{"Folder Name", ki.Props{
					"width": 60,
				}},
			},
		}},
	},
}
View Source
var FindViewProps = ki.Props{
	"background-color": &gi.Prefs.Colors.Background,
	"color":            &gi.Prefs.Colors.Font,
	"max-width":        -1,
	"max-height":       -1,
}
View Source
var GideBigFileSize = 10000000 // 10Mb?
View Source
var GideInactiveEmptyFunc = giv.ActionUpdateFunc(func(gei interface{}, act *gi.Action) {
	ge := gei.(ki.Ki).Embed(KiT_Gide).(*Gide)
	act.SetInactiveState(ge.IsEmpty())
})

GideInactiveEmptyFunc is an ActionUpdateFunc that inactivates action if project is empty

View Source
var GideProps = ki.Props{
	"background-color": &gi.Prefs.Colors.Background,
	"color":            &gi.Prefs.Colors.Font,
	"max-width":        -1,
	"max-height":       -1,
	"#title": ki.Props{
		"max-width":        -1,
		"horizontal-align": gi.AlignCenter,
		"vertical-align":   gi.AlignTop,
	},
	"MethViewNoUpdateAfter": true,
	"ToolBar": ki.PropSlice{
		{"UpdateFiles", ki.Props{
			"shortcut": "Command+U",
			"desc":     "update file browser list of files",
			"icon":     "update",
		}},
		{"ViewFile", ki.Props{
			"label": "Open",
			"icon":  "file-open",
			"desc":  "open a file in current active text view",
			"shortcut-func": giv.ShortcutFunc(func(gei interface{}, act *gi.Action) key.Chord {
				return key.Chord(ChordForFun(KeyFunFileOpen).String())
			}),
			"Args": ki.PropSlice{
				{"File Name", ki.Props{
					"default-field": "ActiveFilename",
				}},
			},
		}},
		{"SaveActiveView", ki.Props{
			"label": "Save",
			"desc":  "save active text view file to its current filename",
			"icon":  "file-save",
			"shortcut-func": giv.ShortcutFunc(func(gei interface{}, act *gi.Action) key.Chord {
				return key.Chord(ChordForFun(KeyFunBufSave).String())
			}),
		}},
		{"SaveActiveViewAs", ki.Props{
			"label": "Save As...",
			"icon":  "file-save",
			"desc":  "save active text view file to a new filename",
			"shortcut-func": giv.ShortcutFunc(func(gei interface{}, act *gi.Action) key.Chord {
				return key.Chord(ChordForFun(KeyFunBufSaveAs).String())
			}),
			"Args": ki.PropSlice{
				{"File Name", ki.Props{
					"default-field": "ActiveFilename",
				}},
			},
		}},
		{"ViewOpenNodeName", ki.Props{
			"icon":         "file-text",
			"label":        "Edit",
			"desc":         "select an open file to view in active text view",
			"submenu-func": giv.SubMenuFunc(GideOpenNodes),
			"shortcut-func": giv.ShortcutFunc(func(gei interface{}, act *gi.Action) key.Chord {
				return key.Chord(ChordForFun(KeyFunBufSelect).String())
			}),
			"Args": ki.PropSlice{
				{"Node Name", ki.Props{}},
			},
		}},
		{"sep-find", ki.BlankProp{}},
		{"CursorToHistPrev", ki.Props{
			"icon":     "widget-wedge-left",
			"shortcut": gi.KeyFunHistPrev,
			"label":    "",
			"desc":     "move cursor to previous location in active text view",
		}},
		{"CursorToHistNext", ki.Props{
			"icon":     "widget-wedge-right",
			"shortcut": gi.KeyFunHistNext,
			"label":    "",
			"desc":     "move cursor to next location in active text view",
		}},
		{"Find", ki.Props{
			"label":    "Find...",
			"icon":     "search",
			"desc":     "Find / replace in all open folders in file browser",
			"shortcut": gi.KeyFunFind,
			"Args": ki.PropSlice{
				{"Search For", ki.Props{
					"default-field": "Prefs.Find.Find",
					"history-field": "Prefs.Find.FindHist",
					"width":         80,
				}},
				{"Replace With", ki.Props{
					"desc":          "Optional replace string -- replace will be controlled interactively in Find panel, including replace all",
					"default-field": "Prefs.Find.Replace",
					"history-field": "Prefs.Find.ReplHist",
					"width":         80,
				}},
				{"Ignore Case", ki.Props{
					"default-field": "Prefs.Find.IgnoreCase",
				}},
				{"Location", ki.Props{
					"desc":          "location to find in",
					"default-field": "Prefs.Find.Loc",
				}},
				{"Languages", ki.Props{
					"desc":          "restrict find to files associated with these languages -- leave empty for all files",
					"default-field": "Prefs.Find.Langs",
				}},
			},
		}},
		{"Spell", ki.Props{
			"label": "Spelling...",
			"icon":  "spelling",
		}},
		{"sep-file", ki.BlankProp{}},
		{"Build", ki.Props{
			"icon":    "terminal",
			"tooltip": "build the project -- command(s) specified in Project Prefs",
			"shortcut-func": giv.ShortcutFunc(func(gei interface{}, act *gi.Action) key.Chord {
				return key.Chord(ChordForFun(KeyFunBuildProj).String())
			}),
		}},
		{"Run", ki.Props{
			"icon":    "terminal",
			"tooltip": "run the project -- command(s) specified in Project Prefs",
			"shortcut-func": giv.ShortcutFunc(func(gei interface{}, act *gi.Action) key.Chord {
				return key.Chord(ChordForFun(KeyFunRunProj).String())
			}),
		}},
		{"Commit", ki.Props{
			"icon": "star",
		}},
		{"ExecCmdNameActive", ki.Props{
			"icon":         "terminal",
			"label":        "Exec Cmd",
			"desc":         "execute given command on active file / directory / project",
			"submenu-func": giv.SubMenuFunc(GideExecCmds),
			"shortcut-func": giv.ShortcutFunc(func(gei interface{}, act *gi.Action) key.Chord {
				return key.Chord(ChordForFun(KeyFunExecCmd).String())
			}),
			"Args": ki.PropSlice{
				{"Cmd Name", ki.Props{}},
			},
		}},
		{"sep-splt", ki.BlankProp{}},
		{"Splits", ki.PropSlice{
			{"SplitsSetView", ki.Props{
				"label":   "Set View",
				"submenu": &AvailSplitNames,
				"Args": ki.PropSlice{
					{"Split Name", ki.Props{
						"default-field": "Prefs.SplitName",
					}},
				},
			}},
			{"SplitsSaveAs", ki.Props{
				"label": "Save As...",
				"desc":  "save current splitter values to a new named split configuration",
				"Args": ki.PropSlice{
					{"Name", ki.Props{
						"width": 60,
					}},
					{"Desc", ki.Props{
						"width": 60,
					}},
				},
			}},
			{"SplitsSave", ki.Props{
				"label":   "Save",
				"submenu": &AvailSplitNames,
				"Args": ki.PropSlice{
					{"Split Name", ki.Props{
						"default-field": "Prefs.SplitName",
					}},
				},
			}},
			{"SplitsEdit", ki.Props{
				"label": "Edit...",
			}},
		}},
	},
	"MainMenu": ki.PropSlice{
		{"AppMenu", ki.BlankProp{}},
		{"File", ki.PropSlice{
			{"OpenRecent", ki.Props{
				"submenu": &SavedPaths,
				"Args": ki.PropSlice{
					{"File Name", ki.Props{}},
				},
			}},
			{"OpenProj", ki.Props{
				"shortcut": "Command+O",
				"label":    "Open Project...",
				"desc":     "open a gide project -- can be a .gide file or just a file or directory (projects are just directories with relevant files)",
				"Args": ki.PropSlice{
					{"File Name", ki.Props{
						"default-field": "ProjFilename",
						"ext":           ".gide",
					}},
				},
			}},
			{"OpenPath", ki.Props{
				"label": "Open Path...",
				"desc":  "open a gide project for a file or directory (projects are just directories with relevant files)",
				"Args": ki.PropSlice{
					{"Path", ki.Props{}},
				},
			}},
			{"New", ki.PropSlice{
				{"NewProj", ki.Props{
					"shortcut": "Command+N",
					"label":    "New Project...",
					"desc":     "Create a new project -- select a path for the parent folder, and a folder name for the new project -- all Gide projects are basically folders with files.  You can also specify the main language and {version control system for the project.  For other options, do <code>Proj Prefs</code> in the File menu of the new project.",
					"Args": ki.PropSlice{
						{"Parent Folder", ki.Props{
							"dirs-only":     true,
							"default-field": "ProjRoot",
						}},
						{"Folder", ki.Props{
							"width": 60,
						}},
						{"Main Lang", ki.Props{}},
						{"Version Ctrl", ki.Props{}},
					},
				}},
				{"NewFile", ki.Props{
					"label": "New File...",
					"desc":  "Create a new file in project -- to create in sub-folders, use context menu on folder in file browser",
					"Args": ki.PropSlice{
						{"File Name", ki.Props{
							"width": 60,
						}},
					},
				}},
			}},
			{"SaveProj", ki.Props{

				"label":    "Save Project",
				"updtfunc": GideInactiveEmptyFunc,
			}},
			{"SaveProjAs", ki.Props{

				"label":    "Save Project As...",
				"desc":     "Save project to given file name -- this is the .gide file containing preferences and current settings -- also saves all open files -- once saved, further saving is automatic",
				"updtfunc": GideInactiveEmptyFunc,
				"Args": ki.PropSlice{
					{"File Name", ki.Props{
						"default-field": "ProjFilename",
						"ext":           ".gide",
					}},
					{"SaveAll", ki.Props{
						"value": false,
					}},
				},
			}},
			{"sep-af", ki.BlankProp{}},
			{"ViewFile", ki.Props{
				"label": "Open File...",
				"shortcut-func": func(gei interface{}, act *gi.Action) key.Chord {
					return key.Chord(ChordForFun(KeyFunFileOpen).String())
				},
				"updtfunc": GideInactiveEmptyFunc,
				"Args": ki.PropSlice{
					{"File Name", ki.Props{}},
				},
			}},
			{"SaveActiveView", ki.Props{
				"label": "Save File",
				"shortcut-func": giv.ShortcutFunc(func(gei interface{}, act *gi.Action) key.Chord {
					return key.Chord(ChordForFun(KeyFunBufSave).String())
				}),
				"updtfunc": GideInactiveEmptyFunc,
			}},
			{"SaveActiveViewAs", ki.Props{
				"label":    "Save File As...",
				"updtfunc": GideInactiveEmptyFunc,
				"desc":     "save active text view file to a new filename",
				"shortcut-func": giv.ShortcutFunc(func(gei interface{}, act *gi.Action) key.Chord {
					return key.Chord(ChordForFun(KeyFunBufSaveAs).String())
				}),
				"Args": ki.PropSlice{
					{"File Name", ki.Props{
						"default-field": "ActiveFilename",
					}},
				},
			}},
			{"RevertActiveView", ki.Props{
				"desc":     "Revert active file to last saved version: this will lose all active changes -- are you sure?",
				"confirm":  true,
				"label":    "Revert File...",
				"updtfunc": GideInactiveEmptyFunc,
			}},
			{"CloseActiveView", ki.Props{
				"label":    "Close File",
				"updtfunc": GideInactiveEmptyFunc,
				"shortcut-func": giv.ShortcutFunc(func(gei interface{}, act *gi.Action) key.Chord {
					return key.Chord(ChordForFun(KeyFunBufClose).String())
				}),
			}},
			{"sep-prefs", ki.BlankProp{}},
			{"ProjPrefs", ki.Props{
				"label":    "Project Prefs...",
				"updtfunc": GideInactiveEmptyFunc,
			}},
			{"sep-close", ki.BlankProp{}},
			{"Close Window", ki.BlankProp{}},
		}},
		{"Edit", ki.PropSlice{
			{"Copy", ki.Props{
				"keyfun": gi.KeyFunCopy,
			}},
			{"Cut", ki.Props{
				"keyfun": gi.KeyFunCut,
			}},
			{"Paste", ki.Props{
				"keyfun": gi.KeyFunPaste,
			}},
			{"Paste History...", ki.Props{
				"keyfun": gi.KeyFunPasteHist,
			}},
			{"Registers", ki.PropSlice{
				{"RegisterCopy", ki.Props{
					"label": "Copy...",
					"desc":  "save currently-selected text to a named register, which can be pasted later -- persistent across sessions as well",
					"shortcut-func": giv.ShortcutFunc(func(gei interface{}, act *gi.Action) key.Chord {
						return key.Chord(ChordForFun(KeyFunRegCopy).String())
					}),
					"updtfunc": GideInactiveEmptyFunc,
					"Args": ki.PropSlice{
						{"Register Name", ki.Props{}},
					},
				}},
				{"RegisterPaste", ki.Props{
					"label": "Paste...",
					"desc":  "paste text from named register",
					"shortcut-func": giv.ShortcutFunc(func(gei interface{}, act *gi.Action) key.Chord {
						return key.Chord(ChordForFun(KeyFunRegPaste).String())
					}),
					"updtfunc": GideInactiveEmptyFunc,
					"Args": ki.PropSlice{
						{"Register Name", ki.Props{
							"default-field": "Prefs.Register",
						}},
					},
				}},
			}},
			{"sep-undo", ki.BlankProp{}},
			{"Undo", ki.Props{
				"keyfun": gi.KeyFunUndo,
			}},
			{"Redo", ki.Props{
				"keyfun": gi.KeyFunRedo,
			}},
			{"sep-find", ki.BlankProp{}},
			{"Find", ki.Props{
				"label":    "Find...",
				"shortcut": gi.KeyFunFind,
				"desc":     "Find / replace in all open folders in file browser",
				"updtfunc": GideInactiveEmptyFunc,
				"Args": ki.PropSlice{
					{"Search For", ki.Props{
						"default-field": "Prefs.Find.Find",
						"history-field": "Prefs.Find.FindHist",
						"width":         80,
					}},
					{"Replace With", ki.Props{
						"desc":          "Optional replace string -- replace will be controlled interactively in Find panel, including replace all",
						"default-field": "Prefs.Find.Replace",
						"history-field": "Prefs.Find.ReplHist",
						"width":         80,
					}},
					{"Ignore Case", ki.Props{
						"default-field": "Prefs.Find.IgnoreCase",
					}},
					{"Location", ki.Props{
						"desc":          "location to find in",
						"default-field": "Prefs.Find.Loc",
					}},
					{"Languages", ki.Props{
						"desc":          "restrict find to files associated with these languages -- leave empty for all files",
						"default-field": "Prefs.Find.Langs",
					}},
				},
			}},
			{"ReplaceInActive", ki.Props{
				"label":    "Replace In Active...",
				"shortcut": gi.KeyFunReplace,
				"desc":     "query-replace in current active text view only (use Find for multi-file)",
				"updtfunc": GideInactiveEmptyFunc,
			}},
			{"Spell", ki.Props{
				"label":    "Spelling...",
				"updtfunc": GideInactiveEmptyFunc,
			}},
			{"ShowCompletions", ki.Props{
				"keyfun":   gi.KeyFunComplete,
				"updtfunc": GideInactiveEmptyFunc,
			}},
			{"sep-adv", ki.BlankProp{}},
			{"CommentOut", ki.Props{
				"shortcut-func": giv.ShortcutFunc(func(gei interface{}, act *gi.Action) key.Chord {
					return key.Chord(ChordForFun(KeyFunCommentOut).String())
				}),
				"updtfunc": GideInactiveEmptyFunc,
			}},
			{"Indent", ki.Props{
				"shortcut-func": giv.ShortcutFunc(func(gei interface{}, act *gi.Action) key.Chord {
					return key.Chord(ChordForFun(KeyFunIndent).String())
				}),
				"updtfunc": GideInactiveEmptyFunc,
			}},
		}},
		{"View", ki.PropSlice{
			{"Panels", ki.PropSlice{
				{"FocusNextPanel", ki.Props{
					"label": "Focus Next",
					"shortcut-func": giv.ShortcutFunc(func(gei interface{}, act *gi.Action) key.Chord {
						return key.Chord(ChordForFun(KeyFunNextPanel).String())
					}),
					"updtfunc": GideInactiveEmptyFunc,
				}},
				{"FocusPrevPanel", ki.Props{
					"label": "Focus Prev",
					"shortcut-func": giv.ShortcutFunc(func(gei interface{}, act *gi.Action) key.Chord {
						return key.Chord(ChordForFun(KeyFunPrevPanel).String())
					}),
					"updtfunc": GideInactiveEmptyFunc,
				}},
				{"CloneActiveView", ki.Props{
					"label": "Clone Active",
					"shortcut-func": giv.ShortcutFunc(func(gei interface{}, act *gi.Action) key.Chord {
						return key.Chord(ChordForFun(KeyFunBufClone).String())
					}),
					"updtfunc": GideInactiveEmptyFunc,
				}},
			}},
			{"Splits", ki.PropSlice{
				{"SplitsSetView", ki.Props{
					"label":    "Set View",
					"submenu":  &AvailSplitNames,
					"updtfunc": GideInactiveEmptyFunc,
					"Args": ki.PropSlice{
						{"Split Name", ki.Props{}},
					},
				}},
				{"SplitsSaveAs", ki.Props{
					"label":    "Save As...",
					"desc":     "save current splitter values to a new named split configuration",
					"updtfunc": GideInactiveEmptyFunc,
					"Args": ki.PropSlice{
						{"Name", ki.Props{
							"width": 60,
						}},
						{"Desc", ki.Props{
							"width": 60,
						}},
					},
				}},
				{"SplitsSave", ki.Props{
					"label":    "Save",
					"submenu":  &AvailSplitNames,
					"updtfunc": GideInactiveEmptyFunc,
					"Args": ki.PropSlice{
						{"Split Name", ki.Props{}},
					},
				}},
				{"SplitsEdit", ki.Props{
					"updtfunc": GideInactiveEmptyFunc,
					"label":    "Edit...",
				}},
			}},
			{"OpenConsoleTab", ki.Props{
				"updtfunc": GideInactiveEmptyFunc,
			}},
		}},
		{"Navigate", ki.PropSlice{
			{"Cursor", ki.PropSlice{
				{"Back", ki.Props{
					"keyfun": gi.KeyFunHistPrev,
				}},
				{"Forward", ki.Props{
					"keyfun": gi.KeyFunHistNext,
				}},
				{"Jump To Line", ki.Props{
					"keyfun": gi.KeyFunJump,
				}},
			}},
		}},
		{"Command", ki.PropSlice{
			{"Build", ki.Props{
				"updtfunc": GideInactiveEmptyFunc,
				"shortcut-func": giv.ShortcutFunc(func(gei interface{}, act *gi.Action) key.Chord {
					return key.Chord(ChordForFun(KeyFunBuildProj).String())
				}),
			}},
			{"Run", ki.Props{
				"updtfunc": GideInactiveEmptyFunc,
				"shortcut-func": giv.ShortcutFunc(func(gei interface{}, act *gi.Action) key.Chord {
					return key.Chord(ChordForFun(KeyFunRunProj).String())
				}),
			}},
			{"Commit", ki.Props{
				"updtfunc": GideInactiveEmptyFunc,
			}},
			{"ExecCmdNameActive", ki.Props{
				"label":        "Exec Cmd",
				"submenu-func": giv.SubMenuFunc(GideExecCmds),
				"updtfunc":     GideInactiveEmptyFunc,
				"Args": ki.PropSlice{
					{"Cmd Name", ki.Props{}},
				},
			}},
			{"DiffFiles", ki.Props{
				"updtfunc": GideInactiveEmptyFunc,
				"Args": ki.PropSlice{
					{"File Name 1", ki.Props{}},
					{"File Name 2", ki.Props{}},
				},
			}},
		}},
		{"Window", "Windows"},
		{"Help", ki.PropSlice{
			{"HelpWiki", ki.Props{}},
		}},
	},
	"CallMethods": ki.PropSlice{
		{"NextViewFile", ki.Props{
			"Args": ki.PropSlice{
				{"File Name", ki.Props{
					"default-field": "ActiveFilename",
				}},
			},
		}},
		{"SplitsSetView", ki.Props{
			"Args": ki.PropSlice{
				{"Split Name", ki.Props{}},
			},
		}},
		{"ExecCmd", ki.Props{}},
	},
}
View Source
var KeyMapsProps = ki.Props{
	"MainMenu": ki.PropSlice{
		{"AppMenu", ki.BlankProp{}},
		{"File", ki.PropSlice{
			{"OpenPrefs", ki.Props{}},
			{"SavePrefs", ki.Props{
				"shortcut": "Command+S",
				"updtfunc": func(kmi interface{}, act *gi.Action) {
					act.SetActiveState(AvailKeyMapsChanged && kmi.(*KeyMaps) == &AvailKeyMaps)
				},
			}},
			{"sep-file", ki.BlankProp{}},
			{"OpenJSON", ki.Props{
				"label":    "Open from file",
				"desc":     "You can save and open key maps to / from files to share, experiment, transfer, etc",
				"shortcut": "Command+O",
				"Args": ki.PropSlice{
					{"File Name", ki.Props{
						"ext": ".json",
					}},
				},
			}},
			{"SaveJSON", ki.Props{
				"label": "Save to file",
				"desc":  "You can save and open key maps to / from files to share, experiment, transfer, etc",
				"Args": ki.PropSlice{
					{"File Name", ki.Props{
						"ext": ".json",
					}},
				},
			}},
			{"RevertToStd", ki.Props{
				"desc":    "This reverts the keymaps to using the StdKeyMaps that are compiled into the program and have all the lastest key functions defined.  If you have edited your maps, and are finding things not working, it is a good idea to save your current maps and try this, or at least do ViewStdMaps to see the current standards.  <b>Your current map edits will be lost if you proceed!</b>  Continue?",
				"confirm": true,
			}},
		}},
		{"Edit", "Copy Cut Paste Dupe"},
		{"Window", "Windows"},
	},
	"ToolBar": ki.PropSlice{
		{"SavePrefs", ki.Props{
			"desc": "saves KeyMaps to App standard prefs directory, in file key_maps_prefs.json, which will be loaded automatically at startup if prefs SaveKeyMaps is checked (should be if you're using custom keymaps)",
			"icon": "file-save",
			"updtfunc": func(kmi interface{}, act *gi.Action) {
				act.SetActiveState(AvailKeyMapsChanged && kmi.(*KeyMaps) == &AvailKeyMaps)
			},
		}},
		{"sep-file", ki.BlankProp{}},
		{"OpenJSON", ki.Props{
			"label": "Open from file",
			"icon":  "file-open",
			"desc":  "You can save and open key maps to / from files to share, experiment, transfer, etc",
			"Args": ki.PropSlice{
				{"File Name", ki.Props{
					"ext": ".json",
				}},
			},
		}},
		{"SaveJSON", ki.Props{
			"label": "Save to file",
			"icon":  "file-save",
			"desc":  "You can save and open key maps to / from files to share, experiment, transfer, etc",
			"Args": ki.PropSlice{
				{"File Name", ki.Props{
					"ext": ".json",
				}},
			},
		}},
		{"sep-std", ki.BlankProp{}},
		{"ViewStd", ki.Props{
			"desc":    "Shows the standard maps that are compiled into the program and have all the lastest key functions bound to standard key chords.  Useful for comparing against custom maps.",
			"confirm": true,
			"updtfunc": func(kmi interface{}, act *gi.Action) {
				act.SetActiveStateUpdt(kmi.(*KeyMaps) != &StdKeyMaps)
			},
		}},
		{"RevertToStd", ki.Props{
			"icon":    "update",
			"desc":    "This reverts the keymaps to using the StdKeyMaps that are compiled into the program and have all the lastest key functions bound to standard key chords.  If you have edited your maps, and are finding things not working, it is a good idea to save your current maps and try this, or at least do ViewStdMaps to see the current standards.  <b>Your current map edits will be lost if you proceed!</b>  Continue?",
			"confirm": true,
			"updtfunc": func(kmi interface{}, act *gi.Action) {
				act.SetActiveStateUpdt(kmi.(*KeyMaps) != &StdKeyMaps)
			},
		}},
	},
}

KeyMapsProps define the ToolBar and MenuBar for TableView of KeyMaps, e.g., giv.KeyMapsView

View Source
var KiT_ArgVarTypes = kit.Enums.AddEnumAltLower(ArgVarTypesN, false, nil, "ArgVar")
View Source
var KiT_CmdValueView = kit.Types.AddType(&CmdValueView{}, nil)
View Source
var KiT_Commands = kit.Types.AddType(&Commands{}, CommandsProps)
View Source
var KiT_Console = kit.Types.AddType(&Console{}, nil)
View Source
var KiT_FileNode = kit.Types.AddType(&FileNode{}, FileNodeProps)
View Source
var KiT_FileTreeView = kit.Types.AddType(&FileTreeView{}, nil)
View Source
var KiT_FindLoc = kit.Enums.AddEnumAltLower(FindLocN, false, nil, "FindLoc")
View Source
var KiT_FindView = kit.Types.AddType(&FindView{}, FindViewProps)
View Source
var KiT_Gide = kit.Types.AddType(&Gide{}, nil)
View Source
var KiT_KeyFuns = kit.Enums.AddEnumAltLower(KeyFunsN, false, nil, "KeyFun")
View Source
var KiT_KeyMapValueView = kit.Types.AddType(&KeyMapValueView{}, nil)
View Source
var KiT_KeyMaps = kit.Types.AddType(&KeyMaps{}, KeyMapsProps)
View Source
var KiT_LangValueView = kit.Types.AddType(&LangValueView{}, nil)
View Source
var KiT_Langs = kit.Types.AddType(&Langs{}, LangsProps)
View Source
var KiT_Preferences = kit.Types.AddType(&Preferences{}, PreferencesProps)
View Source
var KiT_ProjPrefs = kit.Types.AddType(&ProjPrefs{}, ProjPrefsProps)
View Source
var KiT_RegisterValueView = kit.Types.AddType(&RegisterValueView{}, nil)
View Source
var KiT_Registers = kit.Types.AddType(&Registers{}, RegistersProps)
View Source
var KiT_SpellView = kit.Types.AddType(&SpellView{}, SpellViewProps)
View Source
var KiT_SplitValueView = kit.Types.AddType(&SplitValueView{}, nil)
View Source
var KiT_Splits = kit.Types.AddType(&Splits{}, SplitsProps)
View Source
var KiT_VersCtrlValueView = kit.Types.AddType(&VersCtrlValueView{}, nil)
View Source
var LangsProps = ki.Props{
	"MainMenu": ki.PropSlice{
		{"AppMenu", ki.BlankProp{}},
		{"File", ki.PropSlice{
			{"OpenPrefs", ki.Props{}},
			{"SavePrefs", ki.Props{
				"shortcut": "Command+S",
				"updtfunc": giv.ActionUpdateFunc(func(lti interface{}, act *gi.Action) {
					act.SetActiveState(AvailLangsChanged && lti.(*Langs) == &AvailLangs)
				}),
			}},
			{"sep-file", ki.BlankProp{}},
			{"OpenJSON", ki.Props{
				"label":    "Open from file",
				"desc":     "You can save and open languages to / from files to share, experiment, transfer, etc",
				"shortcut": "Command+O",
				"Args": ki.PropSlice{
					{"File Name", ki.Props{
						"ext": ".json",
					}},
				},
			}},
			{"SaveJSON", ki.Props{
				"label": "Save to file",
				"desc":  "You can save and open languages to / from files to share, experiment, transfer, etc",
				"Args": ki.PropSlice{
					{"File Name", ki.Props{
						"ext": ".json",
					}},
				},
			}},
			{"RevertToStd", ki.Props{
				"desc":    "This reverts the languages to using the StdLangs that are compiled into the program and have all the lastest standards. <b>Your current edits will be lost if you proceed!</b>  Continue?",
				"confirm": true,
			}},
		}},
		{"Edit", "Copy Cut Paste Dupe"},
		{"Window", "Windows"},
	},
	"ToolBar": ki.PropSlice{
		{"SavePrefs", ki.Props{
			"desc": "saves Langs to App standard prefs directory, in file lang_prefs.json, which will be loaded automatically at startup if prefs SaveLangs is checked (should be if you're using custom languages)",
			"icon": "file-save",
			"updtfunc": giv.ActionUpdateFunc(func(lti interface{}, act *gi.Action) {
				act.SetActiveState(AvailLangsChanged && lti.(*Langs) == &AvailLangs)
			}),
		}},
		{"sep-file", ki.BlankProp{}},
		{"OpenJSON", ki.Props{
			"label": "Open from file",
			"icon":  "file-open",
			"desc":  "You can save and open languages to / from files to share, experiment, transfer, etc",
			"Args": ki.PropSlice{
				{"File Name", ki.Props{
					"ext": ".json",
				}},
			},
		}},
		{"SaveJSON", ki.Props{
			"label": "Save to file",
			"icon":  "file-save",
			"desc":  "You can save and open languages to / from files to share, experiment, transfer, etc",
			"Args": ki.PropSlice{
				{"File Name", ki.Props{
					"ext": ".json",
				}},
			},
		}},
		{"sep-std", ki.BlankProp{}},
		{"ViewStd", ki.Props{
			"desc": "Shows the standard languages that are compiled into the program and have all the latest changes.  Useful for comparing against custom langs.",
			"updtfunc": giv.ActionUpdateFunc(func(lti interface{}, act *gi.Action) {
				act.SetActiveState(lti.(*Langs) != &StdLangs)
			}),
		}},
		{"RevertToStd", ki.Props{
			"icon":    "update",
			"desc":    "This reverts the languages to using the StdLangs that are compiled into the program and have all the lastest standards.  <b>Your current edits will be lost if you proceed!</b>  Continue?",
			"confirm": true,
			"updtfunc": giv.ActionUpdateFunc(func(lti interface{}, act *gi.Action) {
				act.SetActiveState(lti.(*Langs) != &StdLangs)
			}),
		}},
	},
}

LangsProps define the ToolBar and MenuBar for TableView of Langs, e.g., giv.LangsView

View Source
var Needs2KeyMap gi.KeyMap

Needs2KeyMap is a map of the starting key sequences that require a second key -- auto-generated from active keymap

View Source
var PreferencesProps = ki.Props{
	"MainMenu": ki.PropSlice{
		{"AppMenu", ki.BlankProp{}},
		{"File", ki.PropSlice{
			{"Open", ki.Props{
				"shortcut": "Command+O",
			}},
			{"Save", ki.Props{
				"shortcut": "Command+S",
				"updtfunc": giv.ActionUpdateFunc(func(pfi interface{}, act *gi.Action) {
					pf := pfi.(*Preferences)
					act.SetActiveState(pf.Changed)
				}),
			}},
			{"sep-close", ki.BlankProp{}},
			{"Close Window", ki.BlankProp{}},
		}},
		{"Edit", "Copy Cut Paste"},
		{"Window", "Windows"},
	},
	"ToolBar": ki.PropSlice{
		{"Apply", ki.Props{
			"desc": "Applies current prefs settings so they affect actual functionality.",
			"icon": "update",
		}},
		{"Save", ki.Props{
			"desc": "Saves current preferences to standard prefs.json file, which is auto-loaded at startup.",
			"icon": "file-save",
			"updtfunc": giv.ActionUpdateFunc(func(pfi interface{}, act *gi.Action) {
				pf := pfi.(*Preferences)
				act.SetActiveStateUpdt(pf.Changed)
			}),
		}},
		{"VersionInfo", ki.Props{
			"desc":        "shows current Gide version information",
			"icon":        "info",
			"show-return": true,
		}},
		{"sep-key", ki.BlankProp{}},
		{"EditKeyMaps", ki.Props{
			"icon": "keyboard",
			"desc": "opens the KeyMapsView editor to create new keymaps / save / load from other files, etc.  Current keymaps are saved and loaded with preferences automatically if SaveKeyMaps is clicked (will be turned on automatically if you open this editor).",
		}},
		{"EditLangs", ki.Props{
			"icon": "file-text",
			"desc": "opens the LangsView editor to customize settings for each type of language / data / file type.  Current customized settings are saved and loaded with preferences automatically if SaveLangs is clicked (will be turned on automatically if you open this editor).",
		}},
		{"EditCmds", ki.Props{
			"icon": "file-binary",
			"desc": "opens the CmdsView editor to add custom commands you can run, in addition to standard commands built into the system.  Current customized settings are saved and loaded with preferences automatically if SaveCmds is clicked (will be turned on automatically if you open this editor).",
		}},
		{"EditSplits", ki.Props{
			"icon": "file-binary",
			"desc": "opens the SplitsView editor of saved named splitter settings.  Current customized settings are saved and loaded with preferences automatically.",
		}},
		{"EditRegisters", ki.Props{
			"icon": "file-binary",
			"desc": "opens the RegistersView editor of saved named text registers.  Current values are saved and loaded with preferences automatically.",
		}},
		{"EditHiStyles", ki.Props{
			"icon": "file-binary",
			"desc": "opens the HiStylesView editor of highlighting styles.",
		}},
	},
}

PreferencesProps define the ToolBar and MenuBar for StructView, e.g., giv.PrefsView

View Source
var Prefs = Preferences{}

Prefs are the overall Gide preferences

View Source
var PrefsCmdsFileName = "command_prefs.json"

PrefsCmdsFileName is the name of the preferences file in App prefs directory for saving / loading your CustomCmds commands list

View Source
var PrefsFileName = "gide_prefs.json"

PrefsFileName is the name of the preferences file in GoGi prefs directory

View Source
var PrefsKeyMapsFileName = "key_maps_prefs.json"

PrefsKeyMapsFileName is the name of the preferences file in App prefs directory for saving / loading the default AvailKeyMaps key maps list

View Source
var PrefsLangsFileName = "lang_prefs.json"

PrefsLangsFileName is the name of the preferences file in App prefs directory for saving / loading the default AvailLangs languages list

View Source
var PrefsRegistersFileName = "registers_prefs.json"

PrefsRegistersFileName is the name of the preferences file in App prefs directory for saving / loading the default AvailRegisters

View Source
var PrefsSplitsFileName = "splits_prefs.json"

PrefsSplitsFileName is the name of the preferences file in App prefs directory for saving / loading the default AvailSplits

View Source
var ProjPrefsProps = ki.Props{
	"MainMenu": ki.PropSlice{
		{"AppMenu", ki.BlankProp{}},
		{"File", ki.PropSlice{
			{"Close Window", ki.BlankProp{}},
		}},
		{"Edit", "Copy Cut Paste"},
		{"Window", "Windows"},
	},
}

ProjPrefsProps define the ToolBar and MenuBar for StructView, e.g., giv.PrefsView -- don't have a save option as that would save to regular prefs

View Source
var RegistersProps = ki.Props{
	"MainMenu": ki.PropSlice{
		{"AppMenu", ki.BlankProp{}},
		{"File", ki.PropSlice{
			{"OpenPrefs", ki.Props{}},
			{"SavePrefs", ki.Props{
				"shortcut": "Command+S",
				"updtfunc": giv.ActionUpdateFunc(func(ari interface{}, act *gi.Action) {
					act.SetActiveState(AvailRegistersChanged && ari.(*Registers) == &AvailRegisters)
				}),
			}},
			{"sep-file", ki.BlankProp{}},
			{"OpenJSON", ki.Props{
				"label":    "Open from file",
				"desc":     "You can save and open named registers to / from files to share, experiment, transfer, etc",
				"shortcut": "Command+O",
				"Args": ki.PropSlice{
					{"File Name", ki.Props{
						"ext": ".json",
					}},
				},
			}},
			{"SaveJSON", ki.Props{
				"label": "Save to file",
				"desc":  "You can save and open named registers to / from files to share, experiment, transfer, etc",
				"Args": ki.PropSlice{
					{"File Name", ki.Props{
						"ext": ".json",
					}},
				},
			}},
		}},
		{"Edit", "Copy Cut Paste Dupe"},
		{"Window", "Windows"},
	},
	"ToolBar": ki.PropSlice{
		{"SavePrefs", ki.Props{
			"desc": "saves Registers to App standard prefs directory, in file registers_prefs.json, which will be loaded automatically at startup)",
			"icon": "file-save",
			"updtfunc": giv.ActionUpdateFunc(func(ari interface{}, act *gi.Action) {
				act.SetActiveState(AvailRegistersChanged && ari.(*Registers) == &AvailRegisters)
			}),
		}},
		{"sep-file", ki.BlankProp{}},
		{"OpenJSON", ki.Props{
			"label": "Open from file",
			"icon":  "file-open",
			"desc":  "You can save and open named registers to / from files to share, experiment, transfer, etc",
			"Args": ki.PropSlice{
				{"File Name", ki.Props{
					"ext": ".json",
				}},
			},
		}},
		{"SaveJSON", ki.Props{
			"label": "Save to file",
			"icon":  "file-save",
			"desc":  "You can save and open named registers to / from files to share, experiment, transfer, etc",
			"Args": ki.PropSlice{
				{"File Name", ki.Props{
					"ext": ".json",
				}},
			},
		}},
	},
}

RegistersProps define the ToolBar and MenuBar for TableView of Registers

View Source
var SavedPaths gi.FilePaths
View Source
var SavedPathsFileName = "gide_saved_paths.json"

SavedPathsFileName is the name of the saved file paths file in GoGi prefs directory

View Source
var SpellViewProps = ki.Props{
	"background-color": &gi.Prefs.Colors.Background,
	"color":            &gi.Prefs.Colors.Font,
	"max-width":        -1,
	"max-height":       -1,
}
View Source
var SplitsProps = ki.Props{
	"MainMenu": ki.PropSlice{
		{"AppMenu", ki.BlankProp{}},
		{"File", ki.PropSlice{
			{"OpenPrefs", ki.Props{}},
			{"SavePrefs", ki.Props{
				"shortcut": "Command+S",
				"updtfunc": giv.ActionUpdateFunc(func(spi interface{}, act *gi.Action) {
					act.SetActiveState(AvailSplitsChanged && spi.(*Splits) == &AvailSplits)
				}),
			}},
			{"sep-file", ki.BlankProp{}},
			{"OpenJSON", ki.Props{
				"label":    "Open from file",
				"desc":     "You can save and open named splits to / from files to share, experiment, transfer, etc",
				"shortcut": "Command+O",
				"Args": ki.PropSlice{
					{"File Name", ki.Props{
						"ext": ".json",
					}},
				},
			}},
			{"SaveJSON", ki.Props{
				"label": "Save to file",
				"desc":  "You can save and open named splits to / from files to share, experiment, transfer, etc",
				"Args": ki.PropSlice{
					{"File Name", ki.Props{
						"ext": ".json",
					}},
				},
			}},
		}},
		{"Edit", "Copy Cut Paste Dupe"},
		{"Window", "Windows"},
	},
	"ToolBar": ki.PropSlice{
		{"SavePrefs", ki.Props{
			"desc": "saves Splits to App standard prefs directory, in file splits_prefs.json, which will be loaded automatically at startup)",
			"icon": "file-save",
			"updtfunc": giv.ActionUpdateFunc(func(spi interface{}, act *gi.Action) {
				act.SetActiveState(AvailSplitsChanged && spi.(*Splits) == &AvailSplits)
			}),
		}},
		{"sep-file", ki.BlankProp{}},
		{"OpenJSON", ki.Props{
			"label": "Open from file",
			"icon":  "file-open",
			"desc":  "You can save and open named splits to / from files to share, experiment, transfer, etc",
			"Args": ki.PropSlice{
				{"File Name", ki.Props{
					"ext": ".json",
				}},
			},
		}},
		{"SaveJSON", ki.Props{
			"label": "Save to file",
			"icon":  "file-save",
			"desc":  "You can save and open named splits to / from files to share, experiment, transfer, etc",
			"Args": ki.PropSlice{
				{"File Name", ki.Props{
					"ext": ".json",
				}},
			},
		}},
	},
}

SplitsProps define the ToolBar and MenuBar for TableView of Splits

View Source
var StdCmds = Commands{
	{"Run Proj", "run RunExec executable set in project", nil,
		[]CmdAndArgs{CmdAndArgs{"{RunExecPath}", nil}}, "{RunExecDirPath}", false, false, false},
	{"Run Prompt", "run any command you enter at the prompt", nil,
		[]CmdAndArgs{CmdAndArgs{"{PromptString1}", nil}}, "{FileDirPath}", false, false, false},

	{"Make", "run make with no args", nil,
		[]CmdAndArgs{CmdAndArgs{"make", nil}}, "{FileDirPath}", false, false, false},
	{"Make Prompt", "run make with prompted make target", nil,
		[]CmdAndArgs{CmdAndArgs{"make", []string{"{PromptString1}"}}}, "{FileDirPath}", false, false, false},

	{"Imports Go File", "run goimports on file", LangNames{"Go"},
		[]CmdAndArgs{CmdAndArgs{"goimports", []string{"-w", "{FilePath}"}}}, "{FileDirPath}", true, false, false},
	{"Fmt Go File", "run go fmt on file", LangNames{"Go"},
		[]CmdAndArgs{CmdAndArgs{"gofmt", []string{"-w", "{FilePath}"}}}, "{FileDirPath}", true, false, false},
	{"Build Go Dir", "run go build to build in current dir", LangNames{"Go"},
		[]CmdAndArgs{CmdAndArgs{"go", []string{"build", "-v"}}}, "{FileDirPath}", false, false, false},
	{"Build Go Proj", "run go build for project BuildDir", LangNames{"Go"},
		[]CmdAndArgs{CmdAndArgs{"go", []string{"build", "-v"}}}, "{BuildDir}", false, false, false},
	{"Install Go Proj", "run go install for project BuildDir", LangNames{"Go"},
		[]CmdAndArgs{CmdAndArgs{"go", []string{"install", "-v"}}}, "{BuildDir}", false, false, false},
	{"Generate Go", "run go generate in current dir", LangNames{"Go"},
		[]CmdAndArgs{CmdAndArgs{"go", []string{"generate"}}}, "{FileDirPath}", false, false, false},
	{"Test Go", "run go test in current dir", LangNames{"Go"},
		[]CmdAndArgs{CmdAndArgs{"go", []string{"test", "-v"}}}, "{FileDirPath}", false, false, false},
	{"Vet Go", "run go vet in current dir", LangNames{"Go"},
		[]CmdAndArgs{CmdAndArgs{"go", []string{"vet"}}}, "{FileDirPath}", false, false, false},
	{"Get Go", "run go get on package you enter at prompt", LangNames{"Go"},
		[]CmdAndArgs{CmdAndArgs{"go", []string{"get", "{PromptString1}"}}}, "{FileDirPath}", false, false, false},
	{"Get Go Updt", "run go get -u (updt) on package you enter at prompt", LangNames{"Go"},
		[]CmdAndArgs{CmdAndArgs{"go", []string{"get", "{PromptString1}"}}}, "{FileDirPath}", false, false, false},

	{"Add Git", "git add file", nil,
		[]CmdAndArgs{CmdAndArgs{"git", []string{"add", "{FilePath}"}}}, "{FileDirPath}", false, false, false},
	{"Checkout Git", "git checkout file or directory -- WARNING will overwrite local changes!", nil,
		[]CmdAndArgs{CmdAndArgs{"git", []string{"checkout", "{FilePath}"}}}, "{FileDirPath}", false, false, true},
	{"Status Git", "git status", nil,
		[]CmdAndArgs{CmdAndArgs{"git", []string{"status"}}}, "{FileDirPath}", false, false, false},
	{"Diff Git", "git diff -- see changes since last checkin", nil,
		[]CmdAndArgs{CmdAndArgs{"git", []string{"diff"}}}, "{FileDirPath}", false, false, false},
	{"Log Git", "git log", nil,
		[]CmdAndArgs{CmdAndArgs{"git", []string{"log"}}}, "{FileDirPath}", false, false, false},
	{"Commit Git", "git commit", nil,
		[]CmdAndArgs{CmdAndArgs{"git", []string{"commit", "-am", "{PromptString1}"}}}, "{FileDirPath}", true, false, false},
	{"Pull Git ", "git pull", nil,
		[]CmdAndArgs{CmdAndArgs{"git", []string{"pull"}}}, "{FileDirPath}", false, false, false},
	{"Push Git ", "git push", nil,
		[]CmdAndArgs{CmdAndArgs{"git", []string{"push"}}}, "{FileDirPath}", false, false, false},

	{"Add SVN", "svn add file", nil,
		[]CmdAndArgs{CmdAndArgs{"svn", []string{"add", "{FilePath}"}}}, "{FileDirPath}", false, false, false},
	{"Status SVN", "svn status", nil,
		[]CmdAndArgs{CmdAndArgs{"svn", []string{"status"}}}, "{FileDirPath}", false, false, false},
	{"Info SVN", "svn info", nil,
		[]CmdAndArgs{CmdAndArgs{"svn", []string{"info"}}}, "{FileDirPath}", false, false, false},
	{"Log SVN", "svn log", nil,
		[]CmdAndArgs{CmdAndArgs{"svn", []string{"log", "-v"}}}, "{FileDirPath}", false, false, false},
	{"Commit SVN", "svn commit", nil,
		[]CmdAndArgs{CmdAndArgs{"svn", []string{"commit", "-m", "{PromptString1}"}}}, "{FileDirPath}", true, false, false},
	{"Update SVN", "svn update", nil,
		[]CmdAndArgs{CmdAndArgs{"svn", []string{"update"}}}, "{FileDirPath}", false, false, false},

	{"LaTeX PDF", "run PDFLaTeX on file", LangNames{"LaTeX"},
		[]CmdAndArgs{CmdAndArgs{"pdflatex", []string{"-file-line-error", "-interaction=nonstopmode", "{FilePath}"}}}, "{FileDirPath}", false, false, false},

	{"Open File", "open file using OS 'open' command", nil,
		[]CmdAndArgs{CmdAndArgs{"open", []string{"{FilePath}"}}}, "{FileDirPath}", false, false, false},
	{"Open Target File", "open project target file using OS 'open' command", nil,
		[]CmdAndArgs{CmdAndArgs{"open", []string{"{RunExecPath}"}}}, "{FileDirPath}", false, false, false},

	{"List Dir", "list current dir", nil,
		[]CmdAndArgs{CmdAndArgs{"ls", []string{"-la"}}}, "{FileDirPath}", false, false, false},
	{"Grep", "recursive grep of all files for prompted value", nil,
		[]CmdAndArgs{CmdAndArgs{"grep", []string{"-R", "-e", "{PromptString1}", "{FileDirPath}"}}}, "{FileDirPath}", false, false, false},
}

StdCmds is the original compiled-in set of standard commands.

View Source
var StdKeyMaps = KeyMaps{
	{"MacStd", "Standard Mac KeyMap", KeySeqMap{
		KeySeq{"Control+Tab", ""}:        KeyFunNextPanel,
		KeySeq{"Shift+Control+Tab", ""}:  KeyFunPrevPanel,
		KeySeq{"Control+M", "o"}:         KeyFunNextPanel,
		KeySeq{"Control+M", "Control+O"}: KeyFunNextPanel,
		KeySeq{"Control+M", "p"}:         KeyFunPrevPanel,
		KeySeq{"Control+M", "Control+P"}: KeyFunPrevPanel,
		KeySeq{"Control+O", ""}:          KeyFunFileOpen,
		KeySeq{"Control+M", "f"}:         KeyFunFileOpen,
		KeySeq{"Control+M", "Control+F"}: KeyFunFileOpen,
		KeySeq{"Control+M", "b"}:         KeyFunBufSelect,
		KeySeq{"Control+M", "Control+B"}: KeyFunBufSelect,
		KeySeq{"Control+S", ""}:          KeyFunBufSave,
		KeySeq{"Shift+Control+S", ""}:    KeyFunBufSaveAs,
		KeySeq{"Control+M", "s"}:         KeyFunBufSave,
		KeySeq{"Control+M", "Control+S"}: KeyFunBufSave,
		KeySeq{"Control+M", "w"}:         KeyFunBufSaveAs,
		KeySeq{"Control+M", "Control+W"}: KeyFunBufSaveAs,
		KeySeq{"Control+M", "k"}:         KeyFunBufClose,
		KeySeq{"Control+M", "Control+K"}: KeyFunBufClose,
		KeySeq{"Control+M", "c"}:         KeyFunExecCmd,
		KeySeq{"Control+M", "Control+C"}: KeyFunExecCmd,
		KeySeq{"Control+M", "n"}:         KeyFunBufClone,
		KeySeq{"Control+M", "Control+N"}: KeyFunBufClone,
		KeySeq{"Control+M", "x"}:         KeyFunRegCopy,
		KeySeq{"Control+M", "g"}:         KeyFunRegPaste,
		KeySeq{"Control+/", ""}:          KeyFunCommentOut,
		KeySeq{"Control+M", "t"}:         KeyFunCommentOut,
		KeySeq{"Control+M", "Control+T"}: KeyFunCommentOut,
		KeySeq{"Control+M", "i"}:         KeyFunIndent,
		KeySeq{"Control+M", "Control+I"}: KeyFunIndent,
		KeySeq{"Control+M", "j"}:         KeyFunJump,
		KeySeq{"Control+M", "Control+J"}: KeyFunJump,
		KeySeq{"Control+M", "v"}:         KeyFunSetSplit,
		KeySeq{"Control+M", "Control+V"}: KeyFunSetSplit,
		KeySeq{"Control+M", "m"}:         KeyFunBuildProj,
		KeySeq{"Control+M", "Control+M"}: KeyFunBuildProj,
		KeySeq{"Control+M", "r"}:         KeyFunRunProj,
		KeySeq{"Control+M", "Control+R"}: KeyFunRunProj,
	}},
	{"MacEmacs", "Mac with emacs-style navigation -- emacs wins in conflicts", KeySeqMap{
		KeySeq{"Control+Tab", ""}:        KeyFunNextPanel,
		KeySeq{"Shift+Control+Tab", ""}:  KeyFunPrevPanel,
		KeySeq{"Control+X", "o"}:         KeyFunNextPanel,
		KeySeq{"Control+X", "Control+O"}: KeyFunNextPanel,
		KeySeq{"Control+X", "p"}:         KeyFunPrevPanel,
		KeySeq{"Control+X", "Control+P"}: KeyFunPrevPanel,
		KeySeq{"Control+X", "f"}:         KeyFunFileOpen,
		KeySeq{"Control+X", "Control+F"}: KeyFunFileOpen,
		KeySeq{"Control+X", "b"}:         KeyFunBufSelect,
		KeySeq{"Control+X", "Control+B"}: KeyFunBufSelect,
		KeySeq{"Control+X", "s"}:         KeyFunBufSave,
		KeySeq{"Control+X", "Control+S"}: KeyFunBufSave,
		KeySeq{"Control+X", "w"}:         KeyFunBufSaveAs,
		KeySeq{"Control+X", "Control+W"}: KeyFunBufSaveAs,
		KeySeq{"Control+X", "k"}:         KeyFunBufClose,
		KeySeq{"Control+X", "Control+K"}: KeyFunBufClose,
		KeySeq{"Control+X", "c"}:         KeyFunExecCmd,
		KeySeq{"Control+X", "Control+C"}: KeyFunExecCmd,
		KeySeq{"Control+C", "c"}:         KeyFunExecCmd,
		KeySeq{"Control+C", "Control+C"}: KeyFunExecCmd,
		KeySeq{"Control+C", "o"}:         KeyFunBufClone,
		KeySeq{"Control+C", "Control+O"}: KeyFunBufClone,
		KeySeq{"Control+X", "x"}:         KeyFunRegCopy,
		KeySeq{"Control+X", "g"}:         KeyFunRegPaste,
		KeySeq{"Control+C", "k"}:         KeyFunCommentOut,
		KeySeq{"Control+C", "Control+K"}: KeyFunCommentOut,
		KeySeq{"Control+X", "i"}:         KeyFunIndent,
		KeySeq{"Control+X", "Control+I"}: KeyFunIndent,
		KeySeq{"Control+X", "j"}:         KeyFunJump,
		KeySeq{"Control+X", "Control+J"}: KeyFunJump,
		KeySeq{"Control+X", "v"}:         KeyFunSetSplit,
		KeySeq{"Control+X", "Control+V"}: KeyFunSetSplit,
		KeySeq{"Control+X", "m"}:         KeyFunBuildProj,
		KeySeq{"Control+X", "Control+M"}: KeyFunBuildProj,
		KeySeq{"Control+X", "r"}:         KeyFunRunProj,
		KeySeq{"Control+X", "Control+R"}: KeyFunRunProj,
	}},
	{"LinuxEmacs", "Linux with emacs-style navigation -- emacs wins in conflicts", KeySeqMap{
		KeySeq{"Control+Tab", ""}:        KeyFunNextPanel,
		KeySeq{"Shift+Control+Tab", ""}:  KeyFunPrevPanel,
		KeySeq{"Control+X", "o"}:         KeyFunNextPanel,
		KeySeq{"Control+X", "Control+O"}: KeyFunNextPanel,
		KeySeq{"Control+X", "p"}:         KeyFunPrevPanel,
		KeySeq{"Control+X", "Control+P"}: KeyFunPrevPanel,
		KeySeq{"Control+X", "f"}:         KeyFunFileOpen,
		KeySeq{"Control+X", "Control+F"}: KeyFunFileOpen,
		KeySeq{"Control+X", "b"}:         KeyFunBufSelect,
		KeySeq{"Control+X", "Control+B"}: KeyFunBufSelect,
		KeySeq{"Control+X", "s"}:         KeyFunBufSave,
		KeySeq{"Control+X", "Control+S"}: KeyFunBufSave,
		KeySeq{"Control+X", "w"}:         KeyFunBufSaveAs,
		KeySeq{"Control+X", "Control+W"}: KeyFunBufSaveAs,
		KeySeq{"Control+X", "k"}:         KeyFunBufClose,
		KeySeq{"Control+X", "Control+K"}: KeyFunBufClose,
		KeySeq{"Control+X", "c"}:         KeyFunExecCmd,
		KeySeq{"Control+X", "Control+C"}: KeyFunExecCmd,
		KeySeq{"Control+C", "c"}:         KeyFunExecCmd,
		KeySeq{"Control+C", "Control+C"}: KeyFunExecCmd,
		KeySeq{"Control+C", "o"}:         KeyFunBufClone,
		KeySeq{"Control+C", "Control+O"}: KeyFunBufClone,
		KeySeq{"Control+X", "x"}:         KeyFunRegCopy,
		KeySeq{"Control+X", "g"}:         KeyFunRegPaste,
		KeySeq{"Control+C", "k"}:         KeyFunCommentOut,
		KeySeq{"Control+C", "Control+K"}: KeyFunCommentOut,
		KeySeq{"Control+X", "i"}:         KeyFunIndent,
		KeySeq{"Control+X", "Control+I"}: KeyFunIndent,
		KeySeq{"Control+X", "j"}:         KeyFunJump,
		KeySeq{"Control+X", "Control+J"}: KeyFunJump,
		KeySeq{"Control+X", "v"}:         KeyFunSetSplit,
		KeySeq{"Control+X", "Control+V"}: KeyFunSetSplit,
		KeySeq{"Control+M", "m"}:         KeyFunBuildProj,
		KeySeq{"Control+M", "Control+M"}: KeyFunBuildProj,
		KeySeq{"Control+M", "r"}:         KeyFunRunProj,
		KeySeq{"Control+M", "Control+R"}: KeyFunRunProj,
	}},
	{"LinuxStd", "Standard Linux KeySeqMap", KeySeqMap{
		KeySeq{"Control+Tab", ""}:        KeyFunNextPanel,
		KeySeq{"Shift+Control+Tab", ""}:  KeyFunPrevPanel,
		KeySeq{"Control+M", "o"}:         KeyFunNextPanel,
		KeySeq{"Control+M", "Control+O"}: KeyFunNextPanel,
		KeySeq{"Control+M", "p"}:         KeyFunPrevPanel,
		KeySeq{"Control+M", "Control+P"}: KeyFunPrevPanel,
		KeySeq{"Control+O", ""}:          KeyFunFileOpen,
		KeySeq{"Control+M", "f"}:         KeyFunFileOpen,
		KeySeq{"Control+M", "Control+F"}: KeyFunFileOpen,
		KeySeq{"Control+M", "b"}:         KeyFunBufSelect,
		KeySeq{"Control+M", "Control+B"}: KeyFunBufSelect,
		KeySeq{"Control+S", ""}:          KeyFunBufSave,
		KeySeq{"Shift+Control+S", ""}:    KeyFunBufSaveAs,
		KeySeq{"Control+M", "s"}:         KeyFunBufSave,
		KeySeq{"Control+M", "Control+S"}: KeyFunBufSave,
		KeySeq{"Control+M", "w"}:         KeyFunBufSaveAs,
		KeySeq{"Control+M", "Control+W"}: KeyFunBufSaveAs,
		KeySeq{"Control+M", "k"}:         KeyFunBufClose,
		KeySeq{"Control+M", "Control+K"}: KeyFunBufClose,
		KeySeq{"Control+M", "c"}:         KeyFunExecCmd,
		KeySeq{"Control+M", "Control+C"}: KeyFunExecCmd,
		KeySeq{"Control+M", "n"}:         KeyFunBufClone,
		KeySeq{"Control+M", "Control+N"}: KeyFunBufClone,
		KeySeq{"Control+M", "x"}:         KeyFunRegCopy,
		KeySeq{"Control+M", "g"}:         KeyFunRegPaste,
		KeySeq{"Control+/", ""}:          KeyFunCommentOut,
		KeySeq{"Control+M", "t"}:         KeyFunCommentOut,
		KeySeq{"Control+M", "Control+T"}: KeyFunCommentOut,
		KeySeq{"Control+M", "i"}:         KeyFunIndent,
		KeySeq{"Control+M", "Control+I"}: KeyFunIndent,
		KeySeq{"Control+M", "j"}:         KeyFunJump,
		KeySeq{"Control+M", "Control+J"}: KeyFunJump,
		KeySeq{"Control+M", "v"}:         KeyFunSetSplit,
		KeySeq{"Control+M", "Control+V"}: KeyFunSetSplit,
		KeySeq{"Control+M", "m"}:         KeyFunBuildProj,
		KeySeq{"Control+M", "Control+M"}: KeyFunBuildProj,
		KeySeq{"Control+M", "r"}:         KeyFunRunProj,
		KeySeq{"Control+M", "Control+R"}: KeyFunRunProj,
	}},
	{"WindowsStd", "Standard Windows KeySeqMap", KeySeqMap{
		KeySeq{"Control+Tab", ""}:        KeyFunNextPanel,
		KeySeq{"Shift+Control+Tab", ""}:  KeyFunPrevPanel,
		KeySeq{"Control+M", "o"}:         KeyFunNextPanel,
		KeySeq{"Control+M", "Control+O"}: KeyFunNextPanel,
		KeySeq{"Control+M", "p"}:         KeyFunPrevPanel,
		KeySeq{"Control+M", "Control+P"}: KeyFunPrevPanel,
		KeySeq{"Control+O", ""}:          KeyFunFileOpen,
		KeySeq{"Control+M", "f"}:         KeyFunFileOpen,
		KeySeq{"Control+M", "Control+F"}: KeyFunFileOpen,
		KeySeq{"Control+M", "b"}:         KeyFunBufSelect,
		KeySeq{"Control+M", "Control+B"}: KeyFunBufSelect,
		KeySeq{"Control+S", ""}:          KeyFunBufSave,
		KeySeq{"Shift+Control+S", ""}:    KeyFunBufSaveAs,
		KeySeq{"Control+M", "s"}:         KeyFunBufSave,
		KeySeq{"Control+M", "Control+S"}: KeyFunBufSave,
		KeySeq{"Control+M", "w"}:         KeyFunBufSaveAs,
		KeySeq{"Control+M", "Control+W"}: KeyFunBufSaveAs,
		KeySeq{"Control+M", "k"}:         KeyFunBufClose,
		KeySeq{"Control+M", "Control+K"}: KeyFunBufClose,
		KeySeq{"Control+M", "c"}:         KeyFunExecCmd,
		KeySeq{"Control+M", "Control+C"}: KeyFunExecCmd,
		KeySeq{"Control+M", "n"}:         KeyFunBufClone,
		KeySeq{"Control+M", "Control+N"}: KeyFunBufClone,
		KeySeq{"Control+M", "x"}:         KeyFunRegCopy,
		KeySeq{"Control+M", "g"}:         KeyFunRegPaste,
		KeySeq{"Control+/", ""}:          KeyFunCommentOut,
		KeySeq{"Control+M", "t"}:         KeyFunCommentOut,
		KeySeq{"Control+M", "Control+T"}: KeyFunCommentOut,
		KeySeq{"Control+M", "i"}:         KeyFunIndent,
		KeySeq{"Control+M", "Control+I"}: KeyFunIndent,
		KeySeq{"Control+M", "j"}:         KeyFunJump,
		KeySeq{"Control+M", "Control+J"}: KeyFunJump,
		KeySeq{"Control+M", "v"}:         KeyFunSetSplit,
		KeySeq{"Control+M", "Control+V"}: KeyFunSetSplit,
		KeySeq{"Control+M", "m"}:         KeyFunBuildProj,
		KeySeq{"Control+M", "Control+M"}: KeyFunBuildProj,
		KeySeq{"Control+M", "r"}:         KeyFunRunProj,
		KeySeq{"Control+M", "Control+R"}: KeyFunRunProj,
	}},
	{"ChromeStd", "Standard chrome-browser and linux-under-chrome bindings", KeySeqMap{
		KeySeq{"Control+Tab", ""}:        KeyFunNextPanel,
		KeySeq{"Shift+Control+Tab", ""}:  KeyFunPrevPanel,
		KeySeq{"Control+M", "o"}:         KeyFunNextPanel,
		KeySeq{"Control+M", "Control+O"}: KeyFunNextPanel,
		KeySeq{"Control+M", "p"}:         KeyFunPrevPanel,
		KeySeq{"Control+M", "Control+P"}: KeyFunPrevPanel,
		KeySeq{"Control+O", ""}:          KeyFunFileOpen,
		KeySeq{"Control+M", "f"}:         KeyFunFileOpen,
		KeySeq{"Control+M", "Control+F"}: KeyFunFileOpen,
		KeySeq{"Control+M", "b"}:         KeyFunBufSelect,
		KeySeq{"Control+M", "Control+B"}: KeyFunBufSelect,
		KeySeq{"Control+S", ""}:          KeyFunBufSave,
		KeySeq{"Shift+Control+S", ""}:    KeyFunBufSaveAs,
		KeySeq{"Control+M", "s"}:         KeyFunBufSave,
		KeySeq{"Control+M", "Control+S"}: KeyFunBufSave,
		KeySeq{"Control+M", "w"}:         KeyFunBufSaveAs,
		KeySeq{"Control+M", "Control+W"}: KeyFunBufSaveAs,
		KeySeq{"Control+M", "k"}:         KeyFunBufClose,
		KeySeq{"Control+M", "Control+K"}: KeyFunBufClose,
		KeySeq{"Control+M", "c"}:         KeyFunExecCmd,
		KeySeq{"Control+M", "Control+C"}: KeyFunExecCmd,
		KeySeq{"Control+M", "n"}:         KeyFunBufClone,
		KeySeq{"Control+M", "Control+N"}: KeyFunBufClone,
		KeySeq{"Control+M", "x"}:         KeyFunRegCopy,
		KeySeq{"Control+M", "g"}:         KeyFunRegPaste,
		KeySeq{"Control+/", ""}:          KeyFunCommentOut,
		KeySeq{"Control+M", "t"}:         KeyFunCommentOut,
		KeySeq{"Control+M", "Control+T"}: KeyFunCommentOut,
		KeySeq{"Control+M", "i"}:         KeyFunIndent,
		KeySeq{"Control+M", "Control+I"}: KeyFunIndent,
		KeySeq{"Control+M", "j"}:         KeyFunJump,
		KeySeq{"Control+M", "Control+J"}: KeyFunJump,
		KeySeq{"Control+M", "v"}:         KeyFunSetSplit,
		KeySeq{"Control+M", "Control+V"}: KeyFunSetSplit,
		KeySeq{"Control+M", "m"}:         KeyFunBuildProj,
		KeySeq{"Control+M", "Control+M"}: KeyFunBuildProj,
		KeySeq{"Control+M", "r"}:         KeyFunRunProj,
		KeySeq{"Control+M", "Control+R"}: KeyFunRunProj,
	}},
}

StdKeyMaps is the original compiled-in set of standard keymaps that have the lastest key functions bound to standard key chords.

View Source
var StdLangs = Langs{
	{"C", "C code", []string{".c", ".h"}, nil, "// "},
	{"C++", "C++ code", []string{".cpp", ".cxx", ".cc", ".h", ".hh", ".hpp"}, nil, "// "},
	{"Go", "Go code", []string{".go"}, CmdNames{"Imports Go File"}, "// "},
	{"HTML", "HTML document", []string{".html", ".htm"}, nil, "<-- "},
	{"LaTeX", "LaTeX document", []string{".tex"}, CmdNames{"LaTeX PDF"}, "% "},
	{"Markdown", "Markdown document", []string{".md"}, nil, "<--- "},
	{"PDF", "PDF document", []string{".pdf"}, CmdNames{"Open File"}, ""},
	{"Python", "Python code", []string{".py"}, nil, "# "},
}

StdLangs is the original compiled-in set of standard languages.

View Source
var StdSplits = Splits{
	{"Code", "2 text views, main tabs, no vis tabs", []float32{.1, .325, .325, .25, 0}},
	{"Vis", "1 text view, main and vis tabs", []float32{.1, .3, 0, .3, .3}},
	{"Small", "1 text view, and main tabs", []float32{.1, .5, 0, .4, 0}},
	{"All", "All panels open", []float32{.1, .25, .25, .2, .2}},
}

StdSplits is the original compiled-in set of standard named splits.

View Source
var VersCtrlFiles = map[string]string{
	"Git": ".git",
	"SVN": ".svn",
}

VersCtrlFiles is a map of signature files that indicate which VC is in use

View Source
var VersCtrlSystems = []string{"Git", "SVN"}

VersCtrlSystems is a list of supported Version Control Systems -- use these names in commands to select commands for the current VCS for this project (i.e., use shortest version of name, typically three letters)

Functions

func ArgVarKeys

func ArgVarKeys() []string

func ArgVarPrompts

func ArgVarPrompts(arg string) (map[string]struct{}, bool)

ArgVarPrompts returns any Prompt* variables required by this string, false if none

func BindArgVars

func BindArgVars(arg string) string

BindArgVars replaces the variables in the given arg string with their values

func CheckForProjAtPath

func CheckForProjAtPath(path string) (string, bool)

CheckForProjAtPath checks if there is a .gide project at the given path returns project path and true if found, otherwise false

func CmdsView

func CmdsView(pt *Commands)

CmdsView opens a view of a commands table

func CompleteArg

func CompleteArg(data interface{}, text string, pos token.Position) (md complete.MatchData)

CompleteArg supplies directory variables to the completer

func CompleteArgEdit

func CompleteArgEdit(data interface{}, text string, cursorPos int, c complete.Completion, seed string) (ed complete.EditData)

CompleteArgEdit edits completer text field after the user chooses from the candidate completions

func FileTreeViewExecCmds

func FileTreeViewExecCmds(it interface{}, vp *gi.Viewport2D) []string

FileTreeViewExecCmds gets list of available commands for given file node, as a submenu-func

func GideExecCmds

func GideExecCmds(it interface{}, vp *gi.Viewport2D) []string

GideExecCmds gets list of available commands for current active file, as a submenu-func

func GideOpenNodes

func GideOpenNodes(it interface{}, vp *gi.Viewport2D) []string

GideOpenNodes gets list of open nodes for submenu-func

func InitPrefs

func InitPrefs()

InitPrefs must be called at startup in mainrun()

func KeyMapsView

func KeyMapsView(km *KeyMaps)

KeyMapsView opens a view of a key maps table

func LangNamesMatchFilename

func LangNamesMatchFilename(filename string, langs LangNames) bool

LangNamesMatchFilename returns true if given filename is one of langauges in langs name -- if langs is empty then EVERYTHING matches.

func LangsView

func LangsView(pt *Langs)

LangsView opens a view of a languages table

func MarkupCmdOutput

func MarkupCmdOutput(out []byte) []byte

MarkupCmdOutput applies links to the first element in command output line if it looks like a file name / position

func MergeAvailCmds

func MergeAvailCmds()

MergeAvailCmds updates the AvailCmds list from CustomCmds and StdCmds

func OpenIcons

func OpenIcons() error

OpenIcons loads the gide icons into the current icon set

func OpenPaths

func OpenPaths()

OpenPaths loads the active SavedPaths from prefs dir

func PrefsView

func PrefsView(pf *Preferences) (*giv.StructView, *gi.Window)

PrefsView opens a view of user preferences, returns structview and window

func ProjPathParse

func ProjPathParse(path string) (root, projnm, fnm string, ok bool)

ProjPathParse parses given project path into a root directory (which could be the path or just the directory portion of the path, depending in whether the path is a directory or not), and a bool if all is good (otherwise error message has been reported). projnm is always the last directory of the path.

func ProjPrefsView

func ProjPrefsView(pf *ProjPrefs) (*giv.StructView, *gi.Window)

ProjPrefsView opens a view of project preferences (settings), returns structview and window

func QuitReq

func QuitReq() bool

QuitReq is called when user tries to quit the app -- we go through all open main windows and look for gide windows and call their CloseWindowReq functions!

func RegistersView

func RegistersView(pt *Registers)

RegistersView opens a view of a commands table

func SavePaths

func SavePaths()

SavePaths saves the active SavedPaths to prefs dir

func SetActiveKeyMap

func SetActiveKeyMap(km *KeySeqMap, kmName KeyMapName)

SetActiveKeyMap sets the current ActiveKeyMap, calling Update on the map prior to setting it to ensure that it is a valid, complete map

func SetActiveKeyMapName

func SetActiveKeyMapName(mapnm KeyMapName)

SetActiveKeyMapName sets the current ActiveKeyMap by name from those defined in AvailKeyMaps, calling Update on the map prior to setting it to ensure that it is a valid, complete map

func SetArgVarVals

func SetArgVarVals(avp *map[string]string, fpath string, ppref *ProjPrefs, tv *giv.TextView)

SetArgVarVals sets the current values for arg variables -- prompts must be already set!

func SplitsView

func SplitsView(pt *Splits)

SplitsView opens a view of a commands table

func TextLinkHandler

func TextLinkHandler(tl gi.TextLink) bool

TextLinkHandler is the Gide handler for text links -- preferred one b/c directly connects to correct Gide project

func UpdtExtToLangMap

func UpdtExtToLangMap()

UpdtExtToLangMap updates the map from current avail langs list

func VersCtrlCmdNames

func VersCtrlCmdNames(vcnm VersCtrlName, cmds []string) []string

VersCtrlCmdNames returns a slice of commands that contain in their name the specific version control name, but NOT the others -- takes the output of LangCmdNames

Types

type ArgVarInfo

type ArgVarInfo struct {
	Desc string      `desc:"description of arg var"`
	Type ArgVarTypes `desc:"type of variable -- used for checking usage and other special features such as prompting"`
}

ArgVarInfo has info about argument variables that fill in relevant values for commands, used in ArgVars list of variables

type ArgVarTypes

type ArgVarTypes int32

ArgVarTypes describe the type of information in the arg var -- used for checking usage and special features.

const (
	// ArgVarFile is a file name, not a directory
	ArgVarFile ArgVarTypes = iota

	// ArgVarDir is a directory name, not a file
	ArgVarDir

	// ArgVarExt is a file extension
	ArgVarExt

	// ArgVarPos is a text position
	ArgVarPos

	// ArgVarText is text from a buffer
	ArgVarText

	// ArgVarPrompt is a user-prompted variable
	ArgVarPrompt

	ArgVarTypesN
)

func (*ArgVarTypes) FromString

func (i *ArgVarTypes) FromString(s string) error

func (ArgVarTypes) MarshalJSON

func (kf ArgVarTypes) MarshalJSON() ([]byte, error)

func (ArgVarTypes) String

func (i ArgVarTypes) String() string

func (*ArgVarTypes) UnmarshalJSON

func (kf *ArgVarTypes) UnmarshalJSON(b []byte) error

type ChangeLog

type ChangeLog []ChangeRec

ChangeLog is a record of changes committed from within the Gide system to the version control system for this project. Use the Log command for your VCS to see all changes.

func (*ChangeLog) Add

func (cl *ChangeLog) Add(cr ChangeRec)

Add adds a record to the change log, at the top of the log

type ChangeRec

type ChangeRec struct {
	Date     giv.FileTime `desc:"date/time when change made"`
	CommitID string       `desc:"unique identifier for the commit (git SHA, svn rev)"`
	Author   string       `desc:"author name"`
	Email    string       `desc:"author email"`
	Message  string       `desc:"commit message summarizing changes"`
	Files    string       `desc:"files changed in this commit"`
}

ChangeRec is version control change-log record

type CmdAndArgs

type CmdAndArgs struct {
	Cmd  string  `` /* 145-byte string literal not displayed */
	Args CmdArgs `` /* 336-byte string literal not displayed */
}

CmdAndArgs contains the name of an external program to execute and args to pass to that program

func (*CmdAndArgs) BindArgs

func (cm *CmdAndArgs) BindArgs() []string

BindArgs replaces any variables in the args with their values, and returns resulting args

func (*CmdAndArgs) HasPrompts

func (cm *CmdAndArgs) HasPrompts() (map[string]struct{}, bool)

HasPrompts returns true if any prompts are required before running command, and the set of such args

func (CmdAndArgs) Label

func (cm CmdAndArgs) Label() string

Label satisfies the Labeler interface

func (*CmdAndArgs) PrepCmd

func (cm *CmdAndArgs) PrepCmd() (*exec.Cmd, string)

PrepCmd prepares to run command, returning *exec.Cmd and a string of the full command

type CmdArgs

type CmdArgs []string

CmdArgs is a slice of arguments for a command

func (*CmdArgs) SetCompleter

func (cm *CmdArgs) SetCompleter(tf *gi.TextField, id string)

type CmdName

type CmdName string

CmdName has an associated ValueView for selecting from the list of available command names, for use in preferences etc.

func (CmdName) Command

func (cn CmdName) Command() (*Command, bool)

Command returns command associated with command name in AvailCmds, and false if it doesn't exist

func (CmdName) IsValid

func (cn CmdName) IsValid() bool

IsValid checks if command name exists on AvailCmds list

func (CmdName) ValueView

func (kn CmdName) ValueView() giv.ValueView

ValueView registers CmdValueView as the viewer of CmdName

type CmdNames

type CmdNames []CmdName

CmdNames is a slice of command names

func (*CmdNames) Add

func (cn *CmdNames) Add(cmd CmdName)

Add adds a name to the list

type CmdRun

type CmdRun struct {
	Name    string      `desc:"Name of command being run -- same as Command.Name"`
	CmdStr  string      `desc:"command string"`
	CmdArgs *CmdAndArgs `desc:"Details of the command and args"`
	Exec    *exec.Cmd   `desc:"exec.Cmd for the command"`
}

CmdRun tracks running commands

func (*CmdRun) Kill

func (cm *CmdRun) Kill()

Kill kills the process

type CmdRuns

type CmdRuns []*CmdRun

CmdRuns is a slice list of running commands

func (*CmdRuns) Add

func (rc *CmdRuns) Add(cm *CmdRun)

Add adds a new running command

func (*CmdRuns) AddCmd

func (rc *CmdRuns) AddCmd(name, cmdstr string, cmdargs *CmdAndArgs, ex *exec.Cmd)

AddCmd adds a new running command, creating CmdRun via args

func (*CmdRuns) ByName

func (rc *CmdRuns) ByName(name string) (*CmdRun, int)

ByName returns command with given name

func (*CmdRuns) DeleteByName

func (rc *CmdRuns) DeleteByName(name string) bool

DeleteByName deletes command by name

func (*CmdRuns) DeleteIdx

func (rc *CmdRuns) DeleteIdx(idx int)

DeleteIdx delete command at given index

func (*CmdRuns) KillByName

func (rc *CmdRuns) KillByName(name string) bool

KillByName kills a running process by name, and removes it from the list of running commands

type CmdValueView

type CmdValueView struct {
	giv.ValueViewBase
}

CmdValueView presents an action for displaying an CmdName and selecting

func (*CmdValueView) Activate

func (vv *CmdValueView) Activate(vp *gi.Viewport2D, dlgRecv ki.Ki, dlgFunc ki.RecvFunc)

func (*CmdValueView) ConfigWidget

func (vv *CmdValueView) ConfigWidget(widg gi.Node2D)

func (*CmdValueView) HasAction

func (vv *CmdValueView) HasAction() bool

func (*CmdValueView) UpdateWidget

func (vv *CmdValueView) UpdateWidget()

func (*CmdValueView) WidgetType

func (vv *CmdValueView) WidgetType() reflect.Type

type Command

type Command struct {
	Name    string       `width:"20" desc:"name of this command (must be unique in list of commands)"`
	Desc    string       `width:"40" desc:"brief description of this command"`
	Langs   LangNames    `` /* 149-byte string literal not displayed */
	Cmds    []CmdAndArgs `tableview-select:"-" desc:"sequence of commands to run for this overall command."`
	Dir     string       `` /* 258-byte string literal not displayed */
	Wait    bool         `` /* 206-byte string literal not displayed */
	Focus   bool         `desc:"if true, keyboard focus is directed to the command output tab panel after the command runs."`
	Confirm bool         `desc:"if true, command requires Ok / Cancel confirmation dialog -- only needed for non-prompt commands"`
}

Command defines different types of commands that can be run in the project. The output of the commands shows up in an associated tab.

func (*Command) AppendCmdOut

func (cm *Command) AppendCmdOut(ge *Gide, buf *giv.TextBuf, out []byte)

AppendCmdOut appends command output to buffer, applying markup for links

func (*Command) HasPrompts

func (cm *Command) HasPrompts() (map[string]struct{}, bool)

HasPrompts returns true if any prompts are required before running command, and the set of such args

func (Command) Label

func (cm Command) Label() string

Label satisfies the Labeler interface

func (*Command) LangMatch

func (cm *Command) LangMatch(langs LangNames) bool

LangMatch returns true if the given languages match those of the command, or command has no language restrictions

func (*Command) PromptUser

func (cm *Command) PromptUser(ge *Gide, buf *giv.TextBuf, pvals map[string]struct{})

PromptUser prompts for values that need prompting for, and then runs RunAfterPrompts if not otherwise cancelled by user

func (*Command) Run

func (cm *Command) Run(ge *Gide, buf *giv.TextBuf)

Run runs the command and saves the output in the Buf if it is non-nil, which can be displayed -- if !wait, then Buf is updated online as output occurs. Status is updated with status of command exec. User is prompted for any values that might be needed for command.

func (*Command) RunAfterPrompts

func (cm *Command) RunAfterPrompts(ge *Gide, buf *giv.TextBuf)

RunAfterPrompts runs after any prompts have been set, if needed

func (*Command) RunBuf

func (cm *Command) RunBuf(ge *Gide, buf *giv.TextBuf, cma *CmdAndArgs) bool

RunBuf runs a command with output to the buffer, incrementally updating the buffer with new results line-by-line as they come in

func (*Command) RunBufWait

func (cm *Command) RunBufWait(ge *Gide, buf *giv.TextBuf, cma *CmdAndArgs) bool

RunBufWait runs a command with output to the buffer, using CombinedOutput so it waits for completion -- returns overall command success, and logs one line of the command output to gide statusbar

func (*Command) RunNoBuf

func (cm *Command) RunNoBuf(ge *Gide, cma *CmdAndArgs) bool

RunNoBuf runs a command without any output to the buffer -- can call using go as a goroutine for no-wait case -- returns overall command success, and logs one line of the command output to gide statusbar

func (*Command) RunStatus

func (cm *Command) RunStatus(ge *Gide, buf *giv.TextBuf, cmdstr string, err error, out []byte) bool

RunStatus reports the status of the command run (given in cmdstr) to ge.StatusBar -- returns true if there are no errors, and false if there were errors

func (*Command) SetCompleter

func (cmd *Command) SetCompleter(tf *gi.TextField, id string)

SetCompleter adds a completer to the textfield - each field can have its own match and edit functions For this to be called add a "complete" tag to the struct field

type Commands

type Commands []*Command

Commands is a list of different commands

var AvailCmds Commands

AvailCmds is the current list of ALL available commands for use -- it combines StdCmds and CustomCmds. Custom overrides Std items with the same names.

var CustomCmds Commands

CustomCmds is user-specific list of commands saved in preferences available for all Gide projects. These will override StdCmds with the same names.

func (*Commands) CmdByName

func (cm *Commands) CmdByName(name CmdName, msg bool) (*Command, int, bool)

CmdByName returns a command and index by name -- returns false and emits a message to log if not found if msg is true

func (*Commands) CopyFrom

func (cm *Commands) CopyFrom(cp Commands)

CopyFrom copies commands from given other map

func (*Commands) FilterCmdNames

func (cm *Commands) FilterCmdNames(langs LangNames, vcnm VersCtrlName) []string

FilterCmdNames returns a slice of commands that are compatible with given language(s) and version control system.

func (*Commands) LangCmdNames

func (cm *Commands) LangCmdNames(langs LangNames) []string

LangCmdNames returns a slice of commands that are compatible with given language(s).

func (*Commands) OpenJSON

func (cm *Commands) OpenJSON(filename gi.FileName) error

OpenJSON opens commands from a JSON-formatted file.

func (*Commands) OpenPrefs

func (cm *Commands) OpenPrefs() error

OpenPrefs opens custom Commands from App standard prefs directory, using PrefsCmdsFileName

func (*Commands) SaveJSON

func (cm *Commands) SaveJSON(filename gi.FileName) error

SaveJSON saves commands to a JSON-formatted file.

func (*Commands) SavePrefs

func (cm *Commands) SavePrefs() error

SavePrefs saves custom Commands to App standard prefs directory, using PrefsCmdsFileName

func (*Commands) ViewStd

func (cm *Commands) ViewStd()

ViewStd shows the standard types that are compiled into the program and have all the lastest standards. Useful for comparing against custom lists.

type Console

type Console struct {
	StdoutWrite *os.File     `json:"-" xml:"-" desc:"std out writer -- set to os.Stdout"`
	StdoutRead  *os.File     `json:"-" xml:"-" desc:"std out reader -- used to read os.Stdout"`
	StderrWrite *os.File     `json:"-" xml:"-" desc:"std err writer -- set to os.Stderr"`
	StderrRead  *os.File     `json:"-" xml:"-" desc:"std err reader -- used to read os.Stderr"`
	Buf         *giv.TextBuf `json:"-" xml:"-" desc:"text buffer holding all output"`
	Cancel      bool         `json:"-" xml:"-" desc:"set to true to cancel monitoring"`
	Mu          sync.Mutex   `json:"-" xml:"-" desc:"mutex protecting updating of buffer between out / err"`
	OrgoutWrite *os.File     `json:"-" xml:"-" desc:"original os.Stdout writer"`
	OrgerrWrite *os.File     `json:"-" xml:"-" desc:"original os.Stderr writer"`
}

Console redirects our os.Stdout and os.Stderr to a buffer for display within app

var TheConsole Console

func (*Console) Init

func (cn *Console) Init()

Init initializes the console -- sets up the capture, Buf, and starts the routine that monitors output

func (*Console) MonitorErr

func (cn *Console) MonitorErr()

MonitorErr monitors std error and appends it to the buffer should be in a separate routine

func (*Console) MonitorOut

func (cn *Console) MonitorOut()

MonitorOut monitors std output and appends it to the buffer should be in a separate routine

type EditorPrefs

type EditorPrefs struct {
	TabSize      int  `desc:"size of a tab, in chars -- also determines indent level for space indent"`
	SpaceIndent  bool `desc:"use spaces for indentation, otherwise tabs"`
	WordWrap     bool `desc:"wrap lines at word boundaries -- otherwise long lines scroll off the end"`
	LineNos      bool `desc:"show line numbers"`
	Completion   bool `desc:"use the completion system to suggest options while typing"`
	SpellCorrect bool `desc:"suggest corrections for unknown words while typing"`
	AutoIndent   bool `desc:"automatically indent lines when enter, tab, }, etc pressed"`
	EmacsUndo    bool `` /* 165-byte string literal not displayed */
}

EditorPrefs contains editor preferences

func (*EditorPrefs) Defaults

func (pf *EditorPrefs) Defaults()

type FileNode

type FileNode struct {
	giv.FileNode
}

FileNode is Gide version of FileNode for FileTree view

func (*FileNode) ExecCmdFile

func (fn *FileNode) ExecCmdFile()

ExecCmdFile pops up a menu to select a command appropriate for the given node, and shows output in MainTab with name of command

func (*FileNode) ExecCmdNameFile

func (fn *FileNode) ExecCmdNameFile(cmdNm string)

ExecCmdNameFile executes given command name on node

func (*FileNode) ViewFile

func (fn *FileNode) ViewFile()

ViewFile pulls up this file in Gide

type FilePrefs

type FilePrefs struct {
	DirsOnTop bool `desc:"if true, then all directories are placed at the top of the tree view -- otherwise everything is alpha sorted"`
}

FilePrefs contains file view preferences

func (*FilePrefs) Defaults

func (pf *FilePrefs) Defaults()

type FileSearchResults

type FileSearchResults struct {
	Node    *giv.FileNode
	Count   int
	Matches []giv.FileSearchMatch
}

FileSearchResults is used to report search results

func FileTreeSearch

func FileTreeSearch(start *giv.FileNode, find string, ignoreCase bool, loc FindLoc, activeDir string, langs LangNames) []FileSearchResults

FileTreeSearch returns list of all nodes starting at given node of given language(s) that contain the given string (non regexp version), sorted in descending order by number of occurrences -- ignoreCase transforms everything into lowercase

type FileTreeView

type FileTreeView struct {
	giv.FileTreeView
}

FileTreeView is a TreeView that knows how to operate on FileNode nodes

func (*FileTreeView) ExecCmdFiles

func (ft *FileTreeView) ExecCmdFiles(cmdNm string)

ExecCmdFiles calls given command on selected files

func (*FileTreeView) FileNode

func (ft *FileTreeView) FileNode() *FileNode

FileNode returns the SrcNode as a *gide* FileNode

func (*FileTreeView) ViewFiles

func (ft *FileTreeView) ViewFiles()

ViewFiles calls ViewFile on selected files

type FindLoc

type FindLoc int
const (
	// FindLocAll finds in all open folders in the left file browser
	FindLocAll FindLoc = iota

	// FindLocFile only finds in the current active file
	FindLocFile

	// FindLocDir only finds in the directory of the current active file
	FindLocDir

	// FindLocNotTop finds in all open folders *except* the top-level folder
	FindLocNotTop

	FindLocN
)

func (*FindLoc) FromString

func (i *FindLoc) FromString(s string) error

func (FindLoc) MarshalJSON

func (ev FindLoc) MarshalJSON() ([]byte, error)

func (FindLoc) String

func (i FindLoc) String() string

func (*FindLoc) UnmarshalJSON

func (ev *FindLoc) UnmarshalJSON(b []byte) error

type FindParams

type FindParams struct {
	Find       string    `desc:"find string"`
	Replace    string    `desc:"replace string"`
	IgnoreCase bool      `desc:"ignore case"`
	Langs      LangNames `desc:"languages for files to search"`
	Loc        FindLoc   `desc:"locations to search in"`
	FindHist   []string  `desc:"history of finds"`
	ReplHist   []string  `desc:"history of replaces"`
}

FindParams are parameters for find / replace

type FindView

type FindView struct {
	gi.Layout
	Gide   *Gide         `json:"-" xml:"-" desc:"parent gide project"`
	LangVV giv.ValueView `desc:"langs value view"`
	Time   time.Time     `desc:"time of last find"`
}

FindView is a find / replace widget that displays results in a TextView and has a toolbar for controlling find / replace process.

func (*FindView) ConfigToolbar

func (fv *FindView) ConfigToolbar()

ConfigToolbar adds toolbar.

func (*FindView) CurDirBox

func (fv *FindView) CurDirBox() *gi.CheckBox

CurDirBox returns the cur file checkbox in toolbar

func (*FindView) FindAction

func (fv *FindView) FindAction()

FindAction runs a new find with current params

func (*FindView) FindBar

func (fv *FindView) FindBar() *gi.ToolBar

FindBar returns the find toolbar

func (*FindView) FindNextAct

func (fv *FindView) FindNextAct() *gi.Action

FindNextAct returns the find next action in toolbar -- selected first

func (*FindView) FindText

func (fv *FindView) FindText() *gi.ComboBox

FindText returns the find textfield in toolbar

func (*FindView) HighlightFinds

func (fv *FindView) HighlightFinds(tv, ftv *giv.TextView, fbStLn, fCount int, find string)

HighlightFinds highlights all the find results in ftv buffer

func (*FindView) IgnoreBox

func (fv *FindView) IgnoreBox() *gi.CheckBox

IgnoreBox returns the ignore case checkbox in toolbar

func (*FindView) LocCombo

func (fv *FindView) LocCombo() *gi.ComboBox

LocCombo returns the loc combobox

func (*FindView) NextFind

func (fv *FindView) NextFind()

NextFind shows next find result

func (*FindView) OpenFindURL

func (fv *FindView) OpenFindURL(ur string, ftv *giv.TextView) bool

OpenFindURL opens given find:/// url from Find

func (*FindView) Params

func (fv *FindView) Params() *FindParams

Params returns the find params

func (*FindView) PrevFind

func (fv *FindView) PrevFind()

PrevFind shows previous find result

func (*FindView) ReplBar

func (fv *FindView) ReplBar() *gi.ToolBar

ReplBar returns the replace toolbar

func (*FindView) ReplText

func (fv *FindView) ReplText() *gi.ComboBox

ReplText returns the replace textfield in toolbar

func (*FindView) ReplaceAction

func (fv *FindView) ReplaceAction() bool

ReplaceAction performs the replace

func (*FindView) ReplaceAllAction

func (fv *FindView) ReplaceAllAction()

ReplaceAllAction performs replace all

func (*FindView) SaveFindString

func (fv *FindView) SaveFindString(find string)

SaveFindString saves the given find string to the find params history and current str

func (*FindView) SaveReplString

func (fv *FindView) SaveReplString(repl string)

SaveReplString saves the given replace string to the find params history and current str

func (*FindView) StdConfig

func (fv *FindView) StdConfig() kit.TypeAndNameList

StdConfig returns a TypeAndNameList for configuring a standard Frame -- can modify as desired before calling ConfigChildren on Frame using this

func (*FindView) StdFindConfig

func (fv *FindView) StdFindConfig() (mods, updt bool)

StdFindConfig configures a standard setup of the overall layout -- returns mods, updt from ConfigChildren and does NOT call UpdateEnd

func (*FindView) TextView

func (fv *FindView) TextView() *giv.TextView

TextView returns the find results TextView

func (*FindView) TextViewLay

func (fv *FindView) TextViewLay() *gi.Layout

TextViewLay returns the find results TextView layout

func (*FindView) UpdateView

func (fv *FindView) UpdateView(ge *Gide)

UpdateView updates view with current settings

type Gide

type Gide struct {
	gi.Frame
	ProjRoot          gi.FileName             `` /* 217-byte string literal not displayed */
	ProjFilename      gi.FileName             `` /* 131-byte string literal not displayed */
	ActiveFilename    gi.FileName             `desc:"filename of the currently-active textview"`
	ActiveLangs       LangNames               `desc:"languages for current active filename"`
	Changed           bool                    `json:"-" desc:"has the root changed?  we receive update signals from root for changes"`
	Files             giv.FileTree            `desc:"all the files in the project directory and subdirectories"`
	ActiveTextViewIdx int                     `json:"-" desc:"index of the currently-active textview -- new files will be viewed in other views if available"`
	OpenNodes         OpenNodes               `json:"-" desc:"list of open nodes, most recent first"`
	CmdBufs           map[string]*giv.TextBuf `json:"-" desc:"the command buffers for commands run in this project"`
	CmdHistory        CmdNames                `json:"-" desc:"history of commands executed in this session"`
	RunningCmds       CmdRuns                 `json:"-" xml:"-" desc:"currently running commands in this project"`
	Prefs             ProjPrefs               `desc:"preferences for this project -- this is what is saved in a .gide project file"`
	KeySeq1           key.Chord               `desc:"first key in sequence if needs2 key pressed"`
	UpdtMu            sync.Mutex              `desc:"mutex for protecting overall updates to Gide"`
}

Gide is the core editor and tab viewer framework for the Gide system. The default view has a tree browser of files on the left, editor panels in the middle, and a tabbed viewer on the right.

func NewGideProjPath

func NewGideProjPath(path string) (*gi.Window, *Gide)

NewGideProjPath creates a new Gide window with a new Gide project for given path, returning the window and the path

func NewGideWindow

func NewGideWindow(path, projnm string, doPath bool) (*gi.Window, *Gide)

NewGideWindow is common code for Open GideWindow from Proj or Path

func OpenGideProj

func OpenGideProj(projfile string) (*gi.Window, *Gide)

OpenGideProj creates a new Gide window opened to given Gide project, returning the window and the path

func (*Gide) ActiveTextView

func (ge *Gide) ActiveTextView() *giv.TextView

ActiveTextView returns the currently-active TextView

func (*Gide) ApplyPrefs

func (ge *Gide) ApplyPrefs()

ApplyPrefs applies current project preference settings into places where they are used -- only for those done prior to loading

func (*Gide) ApplyPrefsAction

func (ge *Gide) ApplyPrefsAction()

ApplyPrefsAction applies current preferences to the project, and updates the project

func (*Gide) AutoSaveCheck

func (ge *Gide) AutoSaveCheck(tv *giv.TextView, vidx int, fn *giv.FileNode) bool

AutoSaveCheck checks for an autosave file and prompts user about opening it -- returns true if autosave file does exist for a file that currently unchanged (means just opened)

func (*Gide) Build

func (ge *Gide) Build()

Build runs the BuildCmds set for this project

func (*Gide) CloneActiveView

func (ge *Gide) CloneActiveView() (*giv.TextView, int)

CloneActiveView sets the next text view to view the same file currently being vieweds in the active view. returns text view and index

func (*Gide) CloseActiveView

func (ge *Gide) CloseActiveView()

CloseActiveView closes the buffer associated with active view

func (*Gide) CloseWindowReq

func (ge *Gide) CloseWindowReq() bool

CurPanel returns the splitter panel that currently has keyboard focus CloseWindowReq is called when user tries to close window -- we automatically save the project if it already exists (no harm), and prompt to save open files -- if this returns true, then it is OK to close -- otherwise not

func (*Gide) CommentOut

func (ge *Gide) CommentOut() bool

CommentOut comments-out selected lines in active text view and uncomments if already commented If multiple lines are selected and any line is uncommented all will be commented

func (*Gide) Commit

func (ge *Gide) Commit()

Commit commits the current changes using relevant VCS tool, and updates the changelog. Checks for VCS setting and

func (*Gide) CommitNoChecks

func (ge *Gide) CommitNoChecks()

CommitNoChecks does the commit without any further checks for VCS, and unsaved files

func (*Gide) CommitUpdtLog

func (ge *Gide) CommitUpdtLog(cmdnm string)

CommitUpdtLog grabs info from buffer in main tabs about the commit, and updates the changelog record

func (*Gide) ConfigOutputTextView

func (ge *Gide) ConfigOutputTextView(ly *gi.Layout) *giv.TextView

ConfigOutputTextView configures a command-output textview within given parent layout

func (*Gide) ConfigSplitView

func (ge *Gide) ConfigSplitView()

ConfigSplitView configures the SplitView.

func (*Gide) ConfigStatusBar

func (ge *Gide) ConfigStatusBar()

ConfigStatusBar configures statusbar with label

func (*Gide) ConfigTextBuf

func (ge *Gide) ConfigTextBuf(tb *giv.TextBuf)

ConfigTextBuf configures the text buf according to prefs

func (*Gide) ConfigToolbar

func (ge *Gide) ConfigToolbar()

ConfigToolbar adds a Gide toolbar.

func (*Gide) ConnectEvents2D

func (ge *Gide) ConnectEvents2D()

func (*Gide) CurPanel

func (ge *Gide) CurPanel() int

CurPanel returns the splitter panel that currently has keyboard focus

func (*Gide) CursorToHistNext

func (ge *Gide) CursorToHistNext() bool

CursorToHistNext moves cursor to next position on history list -- returns true if moved

func (*Gide) CursorToHistPrev

func (ge *Gide) CursorToHistPrev() bool

CursorToHistPrev moves cursor to previous position on history list -- returns true if moved

func (*Gide) Defaults

func (ge *Gide) Defaults()

Defaults sets new project defaults based on overall preferences

func (*Gide) DiffFileNode

func (ge *Gide) DiffFileNode(fnm gi.FileName, fn *giv.FileNode)

DiffFileNode shows the differences between two given files (currently outputs a context diff but will show a side-by-side view soon..

func (*Gide) DiffFiles

func (ge *Gide) DiffFiles(fnm1, fnm2 gi.FileName)

DiffFiles shows the differences between two given files (currently outputs a context diff but will show a side-by-side view soon..

func (*Gide) ExecCmd

func (ge *Gide) ExecCmd()

ExecCmd pops up a menu to select a command appropriate for the current active text view, and shows output in MainTab with name of command

func (*Gide) ExecCmdFileNode

func (ge *Gide) ExecCmdFileNode(fn *giv.FileNode)

ExecCmdFileNode pops up a menu to select a command appropriate for the given node, and shows output in MainTab with name of command

func (*Gide) ExecCmdName

func (ge *Gide) ExecCmdName(cmdNm CmdName, sel bool, clearBuf bool)

ExecCmdName executes command of given name -- this is the final common pathway for all command invokation except on a node. if sel, select tab. if clearBuf, clear the buffer prior to command

func (*Gide) ExecCmdNameActive

func (ge *Gide) ExecCmdNameActive(cmdNm string)

ExecCmdNameActive calls given command on current active textview

func (*Gide) ExecCmdNameFileNode

func (ge *Gide) ExecCmdNameFileNode(fn *giv.FileNode, cmdNm CmdName, sel bool, clearBuf bool)

ExecCmdNameFileNode executes command of given name on given node

func (*Gide) ExecCmds

func (ge *Gide) ExecCmds(cmdNms CmdNames, sel bool, clearBuf bool)

ExecCmds executes a sequence of commands, sel = select tab, clearBuf = clear buffer

func (*Gide) ExecCmdsFileNode

func (ge *Gide) ExecCmdsFileNode(fn *giv.FileNode, cmdNms CmdNames, sel bool, clearBuf bool)

ExecCmdsFileNode executes a sequence of commands on file node, sel = select tab, clearBuf = clear buffer

func (*Gide) FileNodeClosed

func (ge *Gide) FileNodeClosed(fn *giv.FileNode, tvn *FileTreeView)

FileNodeClosed is called whenever file tree browser node is closed

func (*Gide) FileNodeOpened

func (ge *Gide) FileNodeOpened(fn *giv.FileNode, tvn *FileTreeView)

FileNodeOpened is called whenever file node is double-clicked in file tree

func (*Gide) FileNodeSelected

func (ge *Gide) FileNodeSelected(fn *giv.FileNode, tvn *FileTreeView)

FileNodeSelected is called whenever tree browser has file node selected

func (*Gide) FileTree

func (ge *Gide) FileTree() *giv.TreeView

FileTree returns the main FileTree

func (*Gide) Find

func (ge *Gide) Find(find, repl string, ignoreCase bool, loc FindLoc, langs LangNames)

Find does Find / Replace in files, using given options and filters -- opens up a main tab with the results and further controls.

func (*Gide) FindOrMakeCmdBuf

func (ge *Gide) FindOrMakeCmdBuf(cmdNm string, clear bool) (*giv.TextBuf, bool)

FindOrMakeCmdBuf creates the buffer for command output, or returns existing. If clear is true, then any existing buffer is cleared. Returns true if new buffer created.

func (*Gide) FindOrMakeCmdTab

func (ge *Gide) FindOrMakeCmdTab(cmdNm string, sel bool, clearBuf bool) (*giv.TextBuf, *giv.TextView, int, bool)

FindOrMakeCmdTab creates the tab to show command output, including making a buffer object to save output from the command. returns true if a new buffer was created, false if one already existed. if sel, select tab. if clearBuf, then any existing buffer is cleared. Also returns index of tab.

func (*Gide) FindOrMakeMainTab

func (ge *Gide) FindOrMakeMainTab(label string, typ reflect.Type, sel bool) (gi.Node2D, int)

FindOrMakeMainTab returns a MainTabs (first set of tabs) tab with given name, first by looking for an existing one, and if not found, making a new one with widget of given type. if sel, then select it. returns widget and tab index.

func (*Gide) FindOrMakeMainTabTextView

func (ge *Gide) FindOrMakeMainTabTextView(label string, sel bool) (*giv.TextView, int)

FindOrMakeMainTabTextView returns a MainTabs (first set of tabs) tab with given name, first by looking for an existing one, and if not found, making a new one with a Layout and then a TextView in it. if sel, then select it. returns widget and tab index.

func (*Gide) FocusNextPanel

func (ge *Gide) FocusNextPanel()

FocusNextPanel moves the keyboard focus to the next panel to the right

func (*Gide) FocusOnPanel

func (ge *Gide) FocusOnPanel(panel int) bool

FocusOnPanel moves keyboard focus to given panel -- returns false if nothing at that tab

func (*Gide) FocusPrevPanel

func (ge *Gide) FocusPrevPanel()

FocusPrevPanel moves the keyboard focus to the previous panel to the left

func (*Gide) GideKeys

func (ge *Gide) GideKeys(kt *key.ChordEvent)

func (*Gide) GrabPrefs

func (ge *Gide) GrabPrefs()

GrabPrefs grabs the current project preference settings from various places, e.g., prior to saving or editing.

func (*Gide) GuessMainLang

func (ge *Gide) GuessMainLang() bool

GuessMainLang guesses the main language in the project -- returns true if successful

func (*Gide) GuessVersCtrl

func (ge *Gide) GuessVersCtrl() bool

GuessVersCtrl guesses the version control system in use

func (*Gide) HelpWiki

func (ge *Gide) HelpWiki()

HelpWiki opens wiki page for gide on github

func (*Gide) Indent

func (ge *Gide) Indent() bool

Indent indents selected lines in active view

func (*Gide) IsEmpty

func (ge *Gide) IsEmpty() bool

func (*Gide) KeyChordEvent

func (ge *Gide) KeyChordEvent()

func (*Gide) LangDefaults

func (ge *Gide) LangDefaults() bool

LangDefaults applies default language settings based on MainLang

func (*Gide) LinkViewFile

func (ge *Gide) LinkViewFile(fnm gi.FileName) (*giv.TextView, int, bool)

LinkViewFile opens the file in the 2nd textview, which is next to the tabs where links are clicked, if it is not collapsed -- else 1st

func (*Gide) LinkViewFileNode

func (ge *Gide) LinkViewFileNode(fn *giv.FileNode) (*giv.TextView, int)

LinkViewFileNode opens the file node in the 2nd textview, which is next to the tabs where links are clicked, if it is not collapsed -- else 1st

func (*Gide) MainTabByName

func (ge *Gide) MainTabByName(label string) (gi.Node2D, int, bool)

MainTabByName returns a MainTabs (first set of tabs) tab with given name, and its index -- returns false if not found

func (*Gide) MainTabDeleted

func (ge *Gide) MainTabDeleted(tabnm string)

MainTabDeleted is called when a main tab is deleted -- we cancel any running commmands

func (*Gide) MainTabs

func (ge *Gide) MainTabs() *gi.TabView

MainTabs returns the main TabView

func (*Gide) NChangedFiles

func (ge *Gide) NChangedFiles() int

NChangedFiles returns number of opened files with unsaved changes

func (*Gide) NewFile

func (ge *Gide) NewFile(filename string)

NewFile creates a new file in the project

func (*Gide) NewProj

func (ge *Gide) NewProj(path gi.FileName, folder string, mainLang LangName, versCtrl VersCtrlName) (*gi.Window, *Gide)

NewProj creates a new project at given path, making a new folder in that path -- all Gide projects are essentially defined by a path to a folder containing files. If the folder already exists, then use OpenPath. Can also specify main language and version control type

func (*Gide) NextTextView

func (ge *Gide) NextTextView() (*giv.TextView, int)

NextTextView returns the next text view available for viewing a file and its index -- if the active text view is empty, then it is used, otherwise it is the next one (if visible)

func (*Gide) NextViewFile

func (ge *Gide) NextViewFile(fnm gi.FileName) (*giv.TextView, int, bool)

NextViewFile sets the next text view to view given file name -- include as much of name as possible to disambiguate -- will use the first matching -- if already being viewed, that is activated -- returns textview and its index, false if not found

func (*Gide) NextViewFileNode

func (ge *Gide) NextViewFileNode(fn *giv.FileNode) (*giv.TextView, int)

NextViewFileNode sets the next text view to view file in given node (opens buffer if not already opened) -- if already being viewed, that is activated, returns text view and index

func (*Gide) OpenConsoleTab

func (ge *Gide) OpenConsoleTab()

OpenConsoleTab opens a main tab displaying console output (stdout, stderr)

func (*Gide) OpenFileNode

func (ge *Gide) OpenFileNode(fn *giv.FileNode) (bool, error)

OpenFileNode opens file for file node -- returns new bool and error

func (*Gide) OpenFileURL

func (ge *Gide) OpenFileURL(ur string) bool

OpenFileURL opens given file:/// url

func (*Gide) OpenFindURL

func (ge *Gide) OpenFindURL(ur string, ftv *giv.TextView) bool

OpenFindURL opens given find:/// url from Find -- delegates to FindView

func (*Gide) OpenNodeForTextView

func (ge *Gide) OpenNodeForTextView(tv *giv.TextView) (*giv.FileNode, int, bool)

OpenNodeForTextView finds the FileNode that a given TextView is viewing, returning its index within OpenNodes list, or false if not found

func (*Gide) OpenPath

func (ge *Gide) OpenPath(path gi.FileName) (*gi.Window, *Gide)

OpenPath creates a new project by opening given path, which can either be a specific file or a folder containing multiple files of interest -- opens in current Gide object if it is empty, or otherwise opens a new window.

func (*Gide) OpenProj

func (ge *Gide) OpenProj(filename gi.FileName) (*gi.Window, *Gide)

OpenProj opens .gide project file and its settings from given filename, in a standard JSON-formatted file

func (*Gide) OpenRecent

func (ge *Gide) OpenRecent(filename gi.FileName)

OpenRecent opens a recently-used file

func (*Gide) OpenSpellURL

func (ge *Gide) OpenSpellURL(ur string, stv *giv.TextView) bool

OpenSpellURL opens given spell:/// url from Spell -- delegates to SpellView

func (*Gide) PanelIsOpen

func (ge *Gide) PanelIsOpen(panel int) bool

PanelIsOpen returns true if the given panel has not been collapsed and is avail and visible for displaying something

func (*Gide) ParseOpenFindURL

func (ge *Gide) ParseOpenFindURL(ur string, ftv *giv.TextView) (tv *giv.TextView, reg giv.TextRegion, findBufStLn, findCount int, ok bool)

ParseOpenFindURL parses and opens given find:/// url from Find, return text region encoded in url, and starting line of results in find buffer, and number of results returned -- for parsing all the find results

func (*Gide) ProjPrefs

func (ge *Gide) ProjPrefs()

ProjPrefs allows editing of project preferences (settings specific to this project)

func (*Gide) RegisterCopy

func (ge *Gide) RegisterCopy(name string) bool

RegisterCopy saves current selection in active text view to register of given name returns true if saved

func (*Gide) RegisterPaste

func (ge *Gide) RegisterPaste(name RegisterName) bool

RegisterPaste pastes register of given name into active text view returns true if pasted

func (*Gide) Render2D

func (ge *Gide) Render2D()

func (*Gide) ReplaceInActive

func (ge *Gide) ReplaceInActive()

ReplaceInActive does query-replace in active file only

func (*Gide) RevertActiveView

func (ge *Gide) RevertActiveView()

RevertActiveView revert active view to saved version

func (*Gide) Run

func (ge *Gide) Run()

Run runs the RunCmds set for this project

func (*Gide) RunPostCmdsActiveView

func (ge *Gide) RunPostCmdsActiveView() bool

RunPostCmdsActiveView runs any registered post commands on the active view -- returns true if commands were run and file was reverted after that -- uses MainLang to disambiguate if multiple languages associated with extension.

func (*Gide) RunPostCmdsFileNode

func (ge *Gide) RunPostCmdsFileNode(fn *giv.FileNode) bool

RunPostCmdsFileNode runs any registered post commands on the given file node -- returns true if commands were run and file was reverted after that -- uses MainLang to disambiguate if multiple languages associated with extension.

func (*Gide) SaveActiveView

func (ge *Gide) SaveActiveView()

SaveActiveView saves the contents of the currently-active textview

func (*Gide) SaveActiveViewAs

func (ge *Gide) SaveActiveViewAs(filename gi.FileName)

SaveActiveViewAs save with specified filename the contents of the currently-active textview

func (*Gide) SaveAllCheck

func (ge *Gide) SaveAllCheck(cancelOpt bool, fun func(ge *Gide)) bool

SaveAllCheck -- check if any files have not been saved, and prompt to save them returns true if there were unsaved files, false otherwise. cancelOpt presents an option to cancel current command, in which case function is not called. if function is passed, then it is called in all cases except if the user selects cancel.

func (*Gide) SaveAllOpenNodes

func (ge *Gide) SaveAllOpenNodes()

SaveAllOpenNodes saves all of the open filenodes to their current file names

func (*Gide) SaveProj

func (ge *Gide) SaveProj()

SaveProj saves project file containing custom project settings, in a standard JSON-formatted file

func (*Gide) SaveProjAs

func (ge *Gide) SaveProjAs(filename gi.FileName, saveAllFiles bool) bool

SaveProjAs saves project custom settings to given filename, in a standard JSON-formatted file saveAllFiles indicates if user should be prompted for saving all files returns true if the user was prompted, false otherwise

func (*Gide) SaveProjIfExists

func (ge *Gide) SaveProjIfExists(saveAllFiles bool) bool

SaveProjIfExists saves project file containing custom project settings, in a standard JSON-formatted file, only if it already exists -- returns true if saved saveAllFiles indicates if user should be prompted for saving all files

func (*Gide) SelectMainTabByName

func (ge *Gide) SelectMainTabByName(label string) (gi.Node2D, int, bool)

SelectMainTabByName Selects given main tab, and returns all of its contents as well.

func (*Gide) SelectOpenNode

func (ge *Gide) SelectOpenNode()

SelectOpenNode pops up a menu to select an open node (aka buffer) to view in current active textview

func (*Gide) SetActiveFilename

func (ge *Gide) SetActiveFilename(fname gi.FileName)

SetActiveFilename sets the active filename

func (*Gide) SetActiveTextView

func (ge *Gide) SetActiveTextView(av *giv.TextView) int

SetActiveTextView sets the given textview as the active one, and returns its index

func (*Gide) SetActiveTextViewIdx

func (ge *Gide) SetActiveTextViewIdx(idx int) *giv.TextView

SetActiveTextViewIdx sets the given view index as the currently-active TextView -- returns that textview

func (*Gide) SetArgVarVals

func (ge *Gide) SetArgVarVals()

SetArgVarVals sets the ArgVar values for commands, from Gide values

func (*Gide) SetStatus

func (ge *Gide) SetStatus(msg string)

SetStatus updates the statusbar label with given message, along with other status info

func (*Gide) Spell

func (ge *Gide) Spell()

Spell checks spelling in files

func (*Gide) SplitView

func (ge *Gide) SplitView() *gi.SplitView

SplitView returns the main SplitView

func (*Gide) SplitViewConfig

func (ge *Gide) SplitViewConfig() kit.TypeAndNameList

SplitViewConfig returns a TypeAndNameList for configuring the SplitView

func (*Gide) SplitsEdit

func (ge *Gide) SplitsEdit()

SplitsEdit opens the SplitsView editor to customize saved splitter settings

func (*Gide) SplitsSave

func (ge *Gide) SplitsSave(split SplitName)

SplitsSave saves current splitter settings to named splitter settings under existing name, and saves to prefs file

func (*Gide) SplitsSaveAs

func (ge *Gide) SplitsSaveAs(name, desc string)

SplitsSaveAs saves current splitter settings to new named splitter settings, and saves to prefs file

func (*Gide) SplitsSetView

func (ge *Gide) SplitsSetView(split SplitName)

SplitsSetView sets split view splitters to given named setting

func (*Gide) StatusBar

func (ge *Gide) StatusBar() *gi.Frame

StatusBar returns the statusbar widget

func (*Gide) StatusLabel

func (ge *Gide) StatusLabel() *gi.Label

StatusLabel returns the statusbar label widget

func (*Gide) StdConfig

func (ge *Gide) StdConfig() (mods, updt bool)

StdConfig configures a standard setup of the overall Frame -- returns mods, updt from ConfigChildren and does NOT call UpdateEnd

func (*Gide) StdFrameConfig

func (ge *Gide) StdFrameConfig() kit.TypeAndNameList

StdFrameConfig returns a TypeAndNameList for configuring a standard Frame -- can modify as desired before calling ConfigChildren on Frame using this

func (*Gide) TextViewByIndex

func (ge *Gide) TextViewByIndex(idx int) *giv.TextView

TextViewByIndex returns the TextView by index (0 or 1), nil if not found

func (*Gide) TextViewForFile

func (ge *Gide) TextViewForFile(fnm gi.FileName) (*giv.TextView, int, bool)

TextViewForFile finds FileNode for file, and returns TextView and index that is viewing that FileNode, or false if none is

func (*Gide) TextViewForFileNode

func (ge *Gide) TextViewForFileNode(fn *giv.FileNode) (*giv.TextView, int, bool)

TextViewForFileNode finds a TextView that is viewing given FileNode, and its index, or false if none is

func (*Gide) TextViewIndex

func (ge *Gide) TextViewIndex(av *giv.TextView) int

TextViewIndex finds index of given textview (0 or 1)

func (*Gide) TextViewSig

func (ge *Gide) TextViewSig(tv *giv.TextView, sig giv.TextViewSignals)

TextViewSig handles all signals from the textviews

func (*Gide) ToolBar

func (ge *Gide) ToolBar() *gi.ToolBar

ToolBar returns the main toolbar

func (*Gide) UpdateFiles

func (ge *Gide) UpdateFiles()

UpdateFiles updates the list of files saved in project

func (*Gide) UpdateProj

func (ge *Gide) UpdateProj()

UpdateProj does full update to current proj

func (*Gide) ViewFile

func (ge *Gide) ViewFile(fnm gi.FileName) (*giv.TextView, int, bool)

ViewFile views file in an existing TextView if it is already viewing that file, otherwise opens ViewFileNode in active buffer

func (*Gide) ViewFileNode

func (ge *Gide) ViewFileNode(tv *giv.TextView, vidx int, fn *giv.FileNode)

ViewFileNode sets the given text view to view file in given node (opens buffer if not already opened)

func (*Gide) ViewOpenNodeName

func (ge *Gide) ViewOpenNodeName(name string)

ViewOpenNodeName views given open node (by name) in active view

func (*Gide) VisTabByName

func (ge *Gide) VisTabByName(label string) (gi.Node2D, int, bool)

VisTabByName returns a VisTabs (second set of tabs for visualizations) tab with given name, and its index -- returns false if not found

func (*Gide) VisTabs

func (ge *Gide) VisTabs() *gi.TabView

VisTabs returns the second, visualization TabView

type KeyFuns

type KeyFuns int32

gide.KeyFuns are special functions for the overall control of the system -- moving between windows, running commands, etc. Multi-key sequences can be used.

const (
	KeyFunNil        KeyFuns = iota
	KeyFunNeeds2             // special internal signal returned by KeyFun indicating need for second key
	KeyFunNextPanel          // move to next panel to the right
	KeyFunPrevPanel          // move to prev panel to the left
	KeyFunFileOpen           // open a new file in active textview
	KeyFunBufSelect          // select an open buffer to edit in active textview
	KeyFunBufClone           // open active file in other view
	KeyFunBufSave            // save active textview buffer to its file
	KeyFunBufSaveAs          // save as active textview buffer to its file
	KeyFunBufClose           // close active textview buffer
	KeyFunExecCmd            // execute a command on active textview buffer
	KeyFunRegCopy            // copy selection to named register
	KeyFunRegPaste           // paste selection from named register
	KeyFunCommentOut         // comment out region
	KeyFunIndent             // indent region
	KeyFunJump               // jump to line (same as gi.KeyFunJump)
	KeyFunSetSplit           // set named splitter config
	KeyFunBuildProj          // build overall project
	KeyFunRunProj            // run overall project
	KeyFunsN
)

func KeyFun

func KeyFun(key1, key2 key.Chord) KeyFuns

KeyFun translates chord into keyboard function -- use oswin key.Chord to get chord -- it returns KeyFunNeeds2 if the key sequence requires 2 keys to be entered, and only the first is present

func (*KeyFuns) FromString

func (i *KeyFuns) FromString(s string) error

func (KeyFuns) MarshalJSON

func (kf KeyFuns) MarshalJSON() ([]byte, error)

func (KeyFuns) String

func (i KeyFuns) String() string

func (*KeyFuns) UnmarshalJSON

func (kf *KeyFuns) UnmarshalJSON(b []byte) error

type KeyMapItem

type KeyMapItem struct {
	Keys KeySeq  `desc:"the key chord sequence that activates a function"`
	Fun  KeyFuns `desc:"the function of that key"`
}

KeyMapItem records one element of the key map -- used for organizing the map.

type KeyMapName

type KeyMapName string

KeyMapName has an associated ValueView for selecting from the list of available key map names, for use in preferences etc.

var ActiveKeyMapName KeyMapName

ActiveKeyMapName is the name of the active keymap

func (KeyMapName) ValueView

func (kn KeyMapName) ValueView() giv.ValueView

ValueView registers KeyMapValueView as the viewer of KeyMapName

type KeyMapValueView

type KeyMapValueView struct {
	giv.ValueViewBase
}

KeyMapValueView presents an action for displaying an KeyMapName and selecting from KeyMapChooserDialog

func (*KeyMapValueView) Activate

func (vv *KeyMapValueView) Activate(vp *gi.Viewport2D, dlgRecv ki.Ki, dlgFunc ki.RecvFunc)

func (*KeyMapValueView) ConfigWidget

func (vv *KeyMapValueView) ConfigWidget(widg gi.Node2D)

func (*KeyMapValueView) HasAction

func (vv *KeyMapValueView) HasAction() bool

func (*KeyMapValueView) UpdateWidget

func (vv *KeyMapValueView) UpdateWidget()

func (*KeyMapValueView) WidgetType

func (vv *KeyMapValueView) WidgetType() reflect.Type

type KeyMaps

type KeyMaps []KeyMapsItem

KeyMaps is a list of KeyMap's -- users can edit these in Prefs -- to create a custom one, just duplicate an existing map, rename, and customize

var AvailKeyMaps KeyMaps

AvailKeyMaps is the current list of available keymaps for use -- can be loaded / saved / edited with preferences. This is set to StdKeyMaps at startup.

func (*KeyMaps) CopyFrom

func (km *KeyMaps) CopyFrom(cp KeyMaps)

CopyFrom copies keymaps from given other map

func (*KeyMaps) MapByName

func (km *KeyMaps) MapByName(name KeyMapName) (*KeySeqMap, int, bool)

MapByName returns a keymap and index by name -- returns false and emits a message to stdout if not found

func (*KeyMaps) OpenJSON

func (km *KeyMaps) OpenJSON(filename gi.FileName) error

OpenJSON opens keymaps from a JSON-formatted file.

func (*KeyMaps) OpenPrefs

func (km *KeyMaps) OpenPrefs() error

OpenPrefs opens KeyMaps from App standard prefs directory, using PrefsKeyMapsFileName

func (*KeyMaps) RevertToStd

func (km *KeyMaps) RevertToStd()

RevertToStd reverts this map to using the StdKeyMaps that are compiled into the program and have all the lastest key functions bound to standard values.

func (*KeyMaps) SaveJSON

func (km *KeyMaps) SaveJSON(filename gi.FileName) error

SaveJSON saves keymaps to a JSON-formatted file.

func (*KeyMaps) SavePrefs

func (km *KeyMaps) SavePrefs() error

SavePrefs saves KeyMaps to App standard prefs directory, using PrefsKeyMapsFileName

func (*KeyMaps) ViewStd

func (km *KeyMaps) ViewStd()

ViewStd shows the standard maps that are compiled into the program and have all the lastest key functions bound to standard values. Useful for comparing against custom maps.

type KeyMapsItem

type KeyMapsItem struct {
	Name string    `width:"20" desc:"name of keymap"`
	Desc string    `desc:"description of keymap -- good idea to include source it was derived from"`
	Map  KeySeqMap `` /* 127-byte string literal not displayed */
}

KeyMapsItem is an entry in a KeyMaps list

func (KeyMapsItem) Label

func (km KeyMapsItem) Label() string

Label satisfies the Labeler interface

type KeySeq

type KeySeq struct {
	Key1 key.Chord // first key
	Key2 key.Chord // second key (optional)
}

KeySeq defines a multiple-key sequence to initiate a key function

func ChordForFun

func ChordForFun(kf KeyFuns) KeySeq

ChordForFun returns first key sequence trigger for given KeyFun in ActiveKeyMap

func (KeySeq) Label

func (kf KeySeq) Label() string

Label() satisfies gi.Labeler interface

func (KeySeq) MarshalText

func (kf KeySeq) MarshalText() ([]byte, error)

TextMarshaler is required for JSON encoding of struct keys

func (KeySeq) String

func (kf KeySeq) String() string

String() satisfies fmt.Stringer interface

func (*KeySeq) UnmarshalText

func (kf *KeySeq) UnmarshalText(b []byte) error

type KeySeqMap

type KeySeqMap map[KeySeq]KeyFuns

KeySeqMap is a map between a multi-key sequence (multiple chords) and a specific KeyFun function. This mapping must be unique, in that each chord has unique KeyFun, but multiple chords can trigger the same function.

var ActiveKeyMap *KeySeqMap

ActiveKeyMap points to the active map -- users can set this to an alternative map in Prefs

func (*KeySeqMap) ChordForFun

func (km *KeySeqMap) ChordForFun(kf KeyFuns) KeySeq

ChordForFun returns first key sequence trigger for given KeyFun in map

func (*KeySeqMap) ToSlice

func (km *KeySeqMap) ToSlice() []KeyMapItem

ToSlice copies this keymap to a slice of KeyMapItem's

func (*KeySeqMap) Update

func (km *KeySeqMap) Update(kmName KeyMapName)

Update ensures that the given keymap has at least one entry for every defined KeyFun, grabbing ones from the default map if not, and also eliminates any Nil entries which might reflect out-of-date functions

type Lang

type Lang struct {
	Name         string   `desc:"name of this language / data / file type (must be unique)"`
	Desc         string   `desc:"<i>brief</i> description of it"`
	Exts         []string `` /* 205-byte string literal not displayed */
	PostSaveCmds CmdNames `desc:"command(s) to run after a file of this type is saved"`
	Comment      string   `desc:"string used for commenting-out individual lines"`
}

Lang defines properties associated with a given language or file type more generally (e.g., image files, data files, etc)

func (Lang) Label

func (ln Lang) Label() string

Label satisfies the Labeler interface

type LangName

type LangName string

LangName has an associated ValueView for selecting from the list of available language names, for use in preferences etc.

func (LangName) ValueView

func (kn LangName) ValueView() giv.ValueView

ValueView registers LangValueView as the viewer of LangName

type LangNames

type LangNames []LangName

LangNames is a list of language names

func LangNamesForFilename

func LangNamesForFilename(filename string) LangNames

LangNamesForFilename returns the language(s) associated with given filename

type LangValueView

type LangValueView struct {
	giv.ValueViewBase
}

LangValueView presents an action for displaying an LangName and selecting from LangChooserDialog

func (*LangValueView) Activate

func (vv *LangValueView) Activate(vp *gi.Viewport2D, dlgRecv ki.Ki, dlgFunc ki.RecvFunc)

func (*LangValueView) ConfigWidget

func (vv *LangValueView) ConfigWidget(widg gi.Node2D)

func (*LangValueView) HasAction

func (vv *LangValueView) HasAction() bool

func (*LangValueView) UpdateWidget

func (vv *LangValueView) UpdateWidget()

func (*LangValueView) WidgetType

func (vv *LangValueView) WidgetType() reflect.Type

type Langs

type Langs []*Lang

Langs is a list of language types

var AvailLangs Langs

AvailLangs is the current list of available languages defined -- can be loaded / saved / edited with preferences. This is set to StdLangs at startup.

func LangsForExt

func LangsForExt(ext string) Langs

LangsForExt returns the language(s) associated with given extension

func LangsForFilename

func LangsForFilename(filename string) Langs

LangsForFilename returns the language(s) associated with given filename

func (*Langs) CompileExtMap

func (lt *Langs) CompileExtMap() map[string]Langs

CompileExtMap compiles a map between extensions and language(s)

func (*Langs) CopyFrom

func (lt *Langs) CopyFrom(cp Langs)

CopyFrom copies languages from given other map

func (*Langs) LangByName

func (lt *Langs) LangByName(name LangName) (*Lang, int, bool)

LangByName returns a language and index by name -- returns false and emits a message to stdout if not found

func (*Langs) OpenJSON

func (lt *Langs) OpenJSON(filename gi.FileName) error

OpenJSON opens languages from a JSON-formatted file.

func (*Langs) OpenPrefs

func (lt *Langs) OpenPrefs() error

OpenPrefs opens Langs from App standard prefs directory, using PrefsLangsFileName

func (*Langs) RevertToStd

func (lt *Langs) RevertToStd()

RevertToStd reverts this map to using the StdLangs that are compiled into the program and have all the lastest standards.

func (*Langs) SaveJSON

func (lt *Langs) SaveJSON(filename gi.FileName) error

SaveJSON saves languages to a JSON-formatted file.

func (*Langs) SavePrefs

func (lt *Langs) SavePrefs() error

SavePrefs saves Langs to App standard prefs directory, using PrefsLangsFileName

func (*Langs) Validate

func (lt *Langs) Validate() bool

Validate checks to make sure post save command names exist, issuing warnings to log for those that don't

func (*Langs) ViewStd

func (lt *Langs) ViewStd()

ViewStd shows the standard langs that are compiled into the program and have all the lastest standards. Useful for comparing against custom lists.

type OpenNodes

type OpenNodes []*giv.FileNode

OpenNodes is a list of file nodes that have been opened for editing -- it is maintained in recency order -- most recent on top -- call Add every time a node is opened / visited for editing

func (*OpenNodes) Add

func (on *OpenNodes) Add(fn *giv.FileNode)

Add adds given node to list of open nodes -- if already on the list it is moved to the top

func (*OpenNodes) ByStringName

func (on *OpenNodes) ByStringName(name string) *giv.FileNode

ByStringName returns the open node with given strings name

func (*OpenNodes) Delete

func (on *OpenNodes) Delete(fn *giv.FileNode) bool

Delete deletes given node in list of open nodes, returning true if found and deleted

func (*OpenNodes) DeleteDeleted

func (on *OpenNodes) DeleteDeleted()

DeleteDeleted deletes deleted nodes on list

func (*OpenNodes) DeleteIdx

func (on *OpenNodes) DeleteIdx(idx int)

DeleteIdx deletes at given index

func (*OpenNodes) NChanged

func (on *OpenNodes) NChanged() int

NChanged returns number of changed open files

func (*OpenNodes) Strings

func (on *OpenNodes) Strings() []string

Strings returns a string list of nodes, with paths relative to proj root

type Preferences

type Preferences struct {
	HiStyle     histyle.StyleName `desc:"highilighting style / theme"`
	FontFamily  gi.FontName       `desc:"monospaced font family for editor"`
	Files       FilePrefs         `desc:"file view preferences"`
	Editor      EditorPrefs       `view:"inline" desc:"editor preferences"`
	KeyMap      KeyMapName        `desc:"key map for gide-specific keyboard sequences"`
	SaveKeyMaps bool              `` /* 403-byte string literal not displayed */
	SaveLangs   bool              `` /* 230-byte string literal not displayed */
	SaveCmds    bool              `` /* 228-byte string literal not displayed */
	Changed     bool              `` /* 164-byte string literal not displayed */
}

Preferences are the overall user preferences for Gide.

func (*Preferences) Apply

func (pf *Preferences) Apply()

Apply preferences updates things according with settings

func (*Preferences) Defaults

func (pf *Preferences) Defaults()

func (*Preferences) EditCmds

func (pf *Preferences) EditCmds()

EditCmds opens the CmdsView editor to customize commands you can run.

func (*Preferences) EditHiStyles

func (pf *Preferences) EditHiStyles()

EditHiStyles opens the HiStyleView editor to customize highlighting styles

func (*Preferences) EditKeyMaps

func (pf *Preferences) EditKeyMaps()

EditKeyMaps opens the KeyMapsView editor to create new keymaps / save / load from other files, etc. Current avail keymaps are saved and loaded with preferences automatically.

func (*Preferences) EditLangs

func (pf *Preferences) EditLangs()

EditLangs opens the LangsView editor to customize settings for each type of language / data / file type.

func (*Preferences) EditRegisters

func (pf *Preferences) EditRegisters()

EditRegisters opens the RegistersView editor to customize saved registers

func (*Preferences) EditSplits

func (pf *Preferences) EditSplits()

EditSplits opens the SplitsView editor to customize saved splitter settings

func (*Preferences) Open

func (pf *Preferences) Open() error

Open preferences from GoGi standard prefs directory, and applies them

func (*Preferences) Save

func (pf *Preferences) Save() error

Save Preferences to GoGi standard prefs directory

func (*Preferences) VersionInfo added in v0.5.1

func (pf *Preferences) VersionInfo() string

VersionInfo returns GoGi version information

type ProjPrefs

type ProjPrefs struct {
	Files        FilePrefs      `desc:"file view preferences"`
	Editor       EditorPrefs    `view:"inline" desc:"editor preferences"`
	SplitName    SplitName      `desc:"current named-split config in use for configuring the splitters"`
	MainLang     LangName       `` /* 135-byte string literal not displayed */
	VersCtrl     VersCtrlName   `desc:"the type of version control system used in this project (git, svn, etc) -- filters commands available"`
	ChangeLog    ChangeLog      `` /* 135-byte string literal not displayed */
	ProjFilename gi.FileName    `` /* 131-byte string literal not displayed */
	ProjRoot     gi.FileName    `` /* 217-byte string literal not displayed */
	BuildCmds    CmdNames       `desc:"command(s) to run for main Build button"`
	BuildDir     gi.FileName    `` /* 165-byte string literal not displayed */
	BuildTarg    gi.FileName    `desc:"build target for main Build button, if relevant for your  BuildCmds"`
	RunExec      gi.FileName    `desc:"executable to run for this project via main Run button -- called by standard Run Proj command"`
	RunCmds      CmdNames       `desc:"command(s) to run for main Run button (typically Run Proj)"`
	Find         FindParams     `view:"-" desc:"saved find params"`
	Spell        SpellParams    `view:"-" desc:"saved spell params"`
	OpenDirs     giv.OpenDirMap `view:"-" desc:"open directories"`
	Register     RegisterName   `view:"-" desc:"last register used"`
	Splits       []float32      `view:"-" desc:"current splitter splits"`
	Changed      bool           `` /* 164-byte string literal not displayed */
}

ProjPrefs are the preferences for saving for a project -- this IS the project file

func (*ProjPrefs) OpenJSON

func (pf *ProjPrefs) OpenJSON(filename gi.FileName) error

OpenJSON open from JSON file

func (*ProjPrefs) SaveJSON

func (pf *ProjPrefs) SaveJSON(filename gi.FileName) error

SaveJSON save to JSON file

type RegisterName

type RegisterName string

RegisterName has an associated ValueView for selecting from the list of available named registers

func (RegisterName) ValueView

func (kn RegisterName) ValueView() giv.ValueView

ValueView registers RegisterValueView as the viewer of RegisterName

type RegisterValueView

type RegisterValueView struct {
	giv.ValueViewBase
}

RegisterValueView presents an action for displaying an RegisterName and selecting

func (*RegisterValueView) Activate

func (vv *RegisterValueView) Activate(vp *gi.Viewport2D, dlgRecv ki.Ki, dlgFunc ki.RecvFunc)

func (*RegisterValueView) ConfigWidget

func (vv *RegisterValueView) ConfigWidget(widg gi.Node2D)

func (*RegisterValueView) HasAction

func (vv *RegisterValueView) HasAction() bool

func (*RegisterValueView) UpdateWidget

func (vv *RegisterValueView) UpdateWidget()

func (*RegisterValueView) WidgetType

func (vv *RegisterValueView) WidgetType() reflect.Type

type Registers

type Registers map[string]string

Registers is a list of named strings

var AvailRegisters Registers

AvailRegisters are available named registers. can be loaded / saved / edited with preferences.

func (*Registers) Names

func (lt *Registers) Names() []string

Names returns a slice of current register names

func (*Registers) OpenJSON

func (lt *Registers) OpenJSON(filename gi.FileName) error

OpenJSON opens named registers from a JSON-formatted file.

func (*Registers) OpenPrefs

func (lt *Registers) OpenPrefs() error

OpenPrefs opens Registers from App standard prefs directory, using PrefRegistersFileName

func (*Registers) SaveJSON

func (lt *Registers) SaveJSON(filename gi.FileName) error

SaveJSON saves named registers to a JSON-formatted file.

func (*Registers) SavePrefs

func (lt *Registers) SavePrefs() error

SavePrefs saves Registers to App standard prefs directory, using PrefRegistersFileName

type SpellParams

type SpellParams struct {
}

SpellParams

type SpellView

type SpellView struct {
	gi.Layout
	Gide         *Gide       `json:"-" xml:"-" desc:"parent gide project"`
	Spell        SpellParams `desc:"params for spelling"`
	Unknown      gi.TextWord `desc:"current unknown/misspelled word"`
	Suggestions  []string    `desc:"a list of suggestions from spell checker"`
	ChangeOffset int         `desc:"compensation for change word length different than original word"`
	PreviousLine int         `desc:"line of previous unknown word"`
	CurrentLine  int         `desc:"line of current unknown word"`
	LastAction   *gi.Action  `desc:"last user action (ignore, change, learn)"`
}

SpellView is a widget that displays results of spell check

func (*SpellView) AcceptSuggestion

func (sv *SpellView) AcceptSuggestion(s string)

func (*SpellView) AdjustTextPos

func (sv *SpellView) AdjustTextPos(tp giv.TextPos) giv.TextPos

AdjustTextPos adjust the character position to compensate for replacement text being different length than original text

func (*SpellView) ChangeAct

func (sv *SpellView) ChangeAct() *gi.Action

ChangeAct returns the spell change action from toolbar

func (*SpellView) ChangeAction

func (sv *SpellView) ChangeAction()

ChangeAction replaces the known word with the selected suggested word and call CheckNextAction

func (*SpellView) ChangeAllAct

func (sv *SpellView) ChangeAllAct() *gi.Action

ChangeAct returns the spell change action from toolbar

func (*SpellView) ChangeAllAction

func (sv *SpellView) ChangeAllAction()

ChangeAllAction replaces the known word with the selected suggested word and call CheckNextAction

func (*SpellView) ChangeBar

func (sv *SpellView) ChangeBar() *gi.ToolBar

ChangeBar returns the suggest toolbar

func (*SpellView) ChangeText

func (sv *SpellView) ChangeText() *gi.TextField

ChangeText returns the unknown word textfield from toolbar

func (*SpellView) CheckAct

func (sv *SpellView) CheckAct() *gi.Action

CheckAct returns the spell check action from toolbar

func (*SpellView) CheckNext

func (sv *SpellView) CheckNext()

CheckNext will find the next misspelled/unknown word and get suggestions for replacing it

func (*SpellView) ConfigToolbar

func (sv *SpellView) ConfigToolbar()

ConfigToolbar adds toolbar.

func (*SpellView) IgnoreAct

func (sv *SpellView) IgnoreAct() *gi.Action

IgnoreAct returns the ignore action from toolbar

func (*SpellView) IgnoreAction

func (sv *SpellView) IgnoreAction()

IgnoreAction will skip this and future instances of misspelled/unknown word and call CheckNextAction

func (*SpellView) LearnAct

func (sv *SpellView) LearnAct() *gi.Action

LearnAct returns the learn action from toolbar

func (*SpellView) LearnAction

func (sv *SpellView) LearnAction()

LearnAction will add the current unknown word to corpus and call CheckNext

func (*SpellView) OpenSpellURL

func (sv *SpellView) OpenSpellURL(ur string, ftv *giv.TextView) bool

OpenFindURL opens given spell:/// url from Find

func (*SpellView) SetUnknownAndSuggest

func (sv *SpellView) SetUnknownAndSuggest(unknown gi.TextWord, suggests []string)

SetUnknownAndSuggest

func (*SpellView) SkipAct

func (sv *SpellView) SkipAct() *gi.Action

SkitpAct returns the skip action from toolbar

func (*SpellView) SkipAction

func (sv *SpellView) SkipAction()

SkipAction will skip this single instance of misspelled/unknown word and call CheckNextAction

func (*SpellView) SpellAction

func (sv *SpellView) SpellAction()

SpellAction runs a new spell check with current params

func (*SpellView) SpellBar

func (sv *SpellView) SpellBar() *gi.ToolBar

SpellBar returns the spell toolbar

func (*SpellView) SpellNextAct

func (sv *SpellView) SpellNextAct() *gi.Action

SpellNextAct returns the spell next action from toolbar

func (*SpellView) StdConfig

func (sv *SpellView) StdConfig() kit.TypeAndNameList

StdConfig returns a TypeAndNameList for configuring a standard Frame -- can modify as desired before calling ConfigChildren on Frame using this

func (*SpellView) StdSpellConfig

func (sv *SpellView) StdSpellConfig() (mods, updt bool)

StdSpellConfig configures a standard setup of the overall layout -- returns mods, updt from ConfigChildren and does NOT call UpdateEnd

func (*SpellView) SuggestBar

func (sv *SpellView) SuggestBar() *gi.ToolBar

SuggestBar returns the suggest toolbar

func (*SpellView) SuggestView

func (sv *SpellView) SuggestView() *giv.SliceView

SuggestView returns the view for the list of suggestions

func (*SpellView) TextView

func (sv *SpellView) TextView() *giv.TextView

TextView returns the spell check results TextView

func (*SpellView) TextViewLay

func (sv *SpellView) TextViewLay() *gi.Layout

TextViewLay returns the spell check results TextView layout

func (*SpellView) TrainAction

func (sv *SpellView) TrainAction()

TrainAction allows you to train on additional text files and also to rebuild the spell model

func (*SpellView) UnknownBar

func (sv *SpellView) UnknownBar() *gi.ToolBar

UnknownBar returns the toolbar that displays the unknown word

func (*SpellView) UnknownEndPos

func (sv *SpellView) UnknownEndPos() giv.TextPos

UnknownEndPos returns the end position of the current unknown word adjusted for any prior replacement text

func (*SpellView) UnknownStartPos

func (sv *SpellView) UnknownStartPos() giv.TextPos

UnknownStartPos returns the start position of the current unknown word adjusted for any prior replacement text

func (*SpellView) UnknownText

func (sv *SpellView) UnknownText() *gi.TextField

UnknownText returns the unknown word textfield from toolbar

func (*SpellView) UpdateView

func (sv *SpellView) UpdateView(ge *Gide, sp SpellParams)

UpdateView updates view with current settings

type Split

type Split struct {
	Name   string    `desc:"name of splitter config"`
	Desc   string    `desc:"brief description"`
	Splits []float32 `min:"0" max:"1" step:".05" fixed-len:"5" desc:"splitter panel proportions"`
}

Split is a named splitter configuration

func (Split) Label

func (sp Split) Label() string

Label satisfies the Labeler interface

func (*Split) SaveSplits

func (lt *Split) SaveSplits(sp []float32)

SaveSplits saves given splits to this setting -- must use copy!

type SplitName

type SplitName string

SplitName has an associated ValueView for selecting from the list of available named splits

func (SplitName) ValueView

func (kn SplitName) ValueView() giv.ValueView

ValueView registers SplitValueView as the viewer of SplitName

type SplitValueView

type SplitValueView struct {
	giv.ValueViewBase
}

SplitValueView presents an action for displaying an SplitName and selecting

func (*SplitValueView) Activate

func (vv *SplitValueView) Activate(vp *gi.Viewport2D, dlgRecv ki.Ki, dlgFunc ki.RecvFunc)

func (*SplitValueView) ConfigWidget

func (vv *SplitValueView) ConfigWidget(widg gi.Node2D)

func (*SplitValueView) HasAction

func (vv *SplitValueView) HasAction() bool

func (*SplitValueView) UpdateWidget

func (vv *SplitValueView) UpdateWidget()

func (*SplitValueView) WidgetType

func (vv *SplitValueView) WidgetType() reflect.Type

type Splits

type Splits []Split

Splits is a list of named splitter configurations

var AvailSplits Splits

AvailSplits are available named splitter settings. can be loaded / saved / edited with preferences. This is set to StdSplits at startup.

func (*Splits) Add

func (lt *Splits) Add(name, desc string, splits []float32) (*Split, int)

Add adds a new splitter setting, returns split and index

func (*Splits) CopyFrom

func (lt *Splits) CopyFrom(cp Splits)

CopyFrom copies named splits from given other map

func (*Splits) Names

func (lt *Splits) Names() []string

Names returns a slice of current names

func (*Splits) OpenJSON

func (lt *Splits) OpenJSON(filename gi.FileName) error

OpenJSON opens named splits from a JSON-formatted file.

func (*Splits) OpenPrefs

func (lt *Splits) OpenPrefs() error

OpenPrefs opens Splits from App standard prefs directory, using PrefSplitsFileName

func (*Splits) SaveJSON

func (lt *Splits) SaveJSON(filename gi.FileName) error

SaveJSON saves named splits to a JSON-formatted file.

func (*Splits) SavePrefs

func (lt *Splits) SavePrefs() error

SavePrefs saves Splits to App standard prefs directory, using PrefSplitsFileName

func (*Splits) SplitByName

func (lt *Splits) SplitByName(name SplitName) (*Split, int, bool)

SplitByName returns a named split and index by name -- returns false and emits a message to stdout if not found

type VersCtrlName

type VersCtrlName string

VersCtrlName is the name of a version control system

func (VersCtrlName) ValueView

func (kn VersCtrlName) ValueView() giv.ValueView

ValueView registers VersCtrlValueView as the viewer of VersCtrlName

type VersCtrlValueView

type VersCtrlValueView struct {
	giv.ValueViewBase
}

VersCtrlValueView presents an action for displaying an VersCtrlName and selecting from StringPopup

func (*VersCtrlValueView) Activate

func (vv *VersCtrlValueView) Activate(vp *gi.Viewport2D, dlgRecv ki.Ki, dlgFunc ki.RecvFunc)

func (*VersCtrlValueView) ConfigWidget

func (vv *VersCtrlValueView) ConfigWidget(widg gi.Node2D)

func (*VersCtrlValueView) HasAction

func (vv *VersCtrlValueView) HasAction() bool

func (*VersCtrlValueView) UpdateWidget

func (vv *VersCtrlValueView) UpdateWidget()

func (*VersCtrlValueView) WidgetType

func (vv *VersCtrlValueView) WidgetType() reflect.Type

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL