gide

package
v0.5.6 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2019 License: BSD-3-Clause Imports: 35 Imported by: 0

Documentation

Overview

Package gide provides all the gide infrastructure and supporting gui for filetree, commands, console, and 2-sequence key functions, preferences, splitviews, etc.

GideView is in a separate gidev directory so that other packages can tap into the gide infrastructure, and be callable directly from the GideView editor, without creating circular import problems.

Index

Constants

View Source
const (
	Version     = "v0.5.6"
	GitCommit   = "027697e"          // the commit JUST BEFORE the release
	VersionDate = "2019-01-04 13:50" // UTC
)

Variables

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 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,
	},
	".notinvcs": ki.Props{
		"color": "#ce4252",
	},
	".modified": ki.Props{
		"color": "#4b7fd1",
	},
	".added": ki.Props{
		"color": "#52af36",
	},
	"#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,
		}},
		{"ShowFileInfo", ki.Props{
			"label": "File Info",
		}},
		{"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,
			"shortcut": gi.KeyFunDuplicate,
		}},
		{"DeleteFiles", ki.Props{
			"label":    "Delete",
			"desc":     "Ok to delete file(s)?  This is not undoable and is not moving to trash / recycle bin",
			"shortcut": gi.KeyFunDelete,
		}},
		{"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",
			"shortcut": gi.KeyFunInsert,
			"updtfunc": FileTreeActiveDirFunc,
			"Args": ki.PropSlice{
				{"File Name", ki.Props{
					"width": 60,
				}},
				{"Add To Version Control", ki.Props{}},
			},
		}},
		{"NewFolder", ki.Props{
			"label":    "New Folder...",
			"desc":     "make a new folder within this folder",
			"shortcut": gi.KeyFunInsertAfter,
			"updtfunc": FileTreeActiveDirFunc,
			"Args": ki.PropSlice{
				{"Folder Name", ki.Props{
					"width": 60,
				}},
			},
		}},
		{"sep-vcs", ki.BlankProp{}},
		{"AddToVcs", ki.Props{

			"desc":       "Add file to version control git/svn",
			"updtfunc":   giv.FileTreeActiveNotInVcsFunc,
			"label-func": giv.VcsLabelFunc,
		}},
		{"RemoveFromVcs", ki.Props{

			"desc":       "Remove file from version control git/svn",
			"updtfunc":   giv.FileTreeActiveInVcsFunc,
			"label-func": giv.VcsLabelFunc,
		}},
		{"CommitToVcs", ki.Props{
			"desc":       "Commit file to version control",
			"updtfunc":   giv.FileTreeActiveInVcsModifiedFunc,
			"label-func": giv.VcsLabelFunc,
		}},
		{"RevertVcs", ki.Props{
			"label":    "Revert",
			"desc":     "Revert file to last commit",
			"updtfunc": giv.FileTreeActiveInVcsModifiedFunc,
		}},
	},
}
View Source
var FindViewProps = ki.Props{
	"background-color": &gi.Prefs.Colors.Background,
	"color":            &gi.Prefs.Colors.Font,
	"max-width":        -1,
	"max-height":       -1,
}

FindViewProps are style properties for FindView

View Source
var GideType = reflect.TypeOf((*Gide)(nil)).Elem()

GideType is a Gide reflect.Type, suitable for checking for Type.Implements.

View Source
var GideViewEditRecents = "<i>Edit Recents...</i>"

GideViewEditRecents defines a string that is added as an item to the recents menu

View Source
var GideViewResetRecents = "<i>Reset Recents</i>"

GideViewResetRecents defines a string that is added as an item to the recents menu

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_KeyFuns = kit.Enums.AddEnumAltLower(KeyFunsN, false, nil, "KeyFun")

KiT_KeyFuns adds a type to the EnumRegistry

View Source
var KiT_KeyMapValueView = kit.Types.AddType(&KeyMapValueView{}, nil)
View Source
var KiT_KeyMaps = kit.Types.AddType(&KeyMaps{}, KeyMapsProps)

KiT_KeyMaps registers KeyMaps as a type

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_SymNode = kit.Types.AddType(&SymNode{}, nil)
View Source
var KiT_SymTree = kit.Types.AddType(&SymTree{}, SymTreeProps)
View Source
var KiT_SymbolsView = kit.Types.AddType(&SymbolsView{}, SymbolsViewProps)
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 language options 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 language options to / from files to share, experiment, transfer, etc",
				"Args": ki.PropSlice{
					{"File Name", ki.Props{
						"ext": ".json",
					}},
				},
			}},
			{"RevertToStd", ki.Props{
				"desc":    "This reverts the language options 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 language options)",
			"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 language options 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 language options 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 language options 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 language options 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).",
		}},
		{"EditLangOpts", ki.Props{
			"icon": "file-text",
			"desc": "opens the LangsView editor to customize options different language / data / file types.  Current customized settings are saved and loaded with preferences automatically if SaveLangOpts 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

SavedPaths is a slice of strings that are file paths

SavedPathsExtras are the reset and edit items we add to the recents menu

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,
}

SpellViewProps are style properties for SpellView

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", filecat.Any,
		[]CmdAndArgs{CmdAndArgs{"{RunExecPath}", nil}}, "{RunExecDirPath}", false, false, false},
	{"Run Prompt", "run any command you enter at the prompt", filecat.Any,
		[]CmdAndArgs{CmdAndArgs{"{PromptString1}", nil}}, "{FileDirPath}", false, false, false},

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

	{"Imports Go File", "run goimports on file", filecat.Go,
		[]CmdAndArgs{CmdAndArgs{"goimports", []string{"-w", "{FilePath}"}}}, "{FileDirPath}", true, false, false},
	{"Fmt Go File", "run go fmt on file", filecat.Go,
		[]CmdAndArgs{CmdAndArgs{"gofmt", []string{"-w", "{FilePath}"}}}, "{FileDirPath}", true, false, false},
	{"Build Go Dir", "run go build to build in current dir", filecat.Go,
		[]CmdAndArgs{CmdAndArgs{"go", []string{"build", "-v"}}}, "{FileDirPath}", false, false, false},
	{"Build Go Proj", "run go build for project BuildDir", filecat.Go,
		[]CmdAndArgs{CmdAndArgs{"go", []string{"build", "-v"}}}, "{BuildDir}", false, false, false},
	{"Install Go Proj", "run go install for project BuildDir", filecat.Go,
		[]CmdAndArgs{CmdAndArgs{"go", []string{"install", "-v"}}}, "{BuildDir}", false, false, false},
	{"Generate Go", "run go generate in current dir", filecat.Go,
		[]CmdAndArgs{CmdAndArgs{"go", []string{"generate"}}}, "{FileDirPath}", false, false, false},
	{"Test Go", "run go test in current dir", filecat.Go,
		[]CmdAndArgs{CmdAndArgs{"go", []string{"test", "-v"}}}, "{FileDirPath}", false, false, false},
	{"Vet Go", "run go vet in current dir", filecat.Go,
		[]CmdAndArgs{CmdAndArgs{"go", []string{"vet"}}}, "{FileDirPath}", false, false, false},
	{"Get Go", "run go get on package you enter at prompt", filecat.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", filecat.Go,
		[]CmdAndArgs{CmdAndArgs{"go", []string{"get", "{PromptString1}"}}}, "{FileDirPath}", false, false, false},

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

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

	{"LaTeX PDF", "run PDFLaTeX on file", filecat.TeX,
		[]CmdAndArgs{CmdAndArgs{"pdflatex", []string{"-file-line-error", "-interaction=nonstopmode", "{FilePath}"}}}, "{FileDirPath}", false, false, false},
	{"BibTeX", "run BibTeX on file", filecat.TeX,
		[]CmdAndArgs{CmdAndArgs{"bibtex", []string{"{FileNameNoExt}"}}}, "{FileDirPath}", false, false, false},

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

	{"List Dir", "list current dir", filecat.Any,
		[]CmdAndArgs{CmdAndArgs{"ls", []string{"-la"}}}, "{FileDirPath}", false, false, false},
	{"Grep", "recursive grep of all files for prompted value", filecat.Any,
		[]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{
	filecat.Go: {CmdNames{"Imports Go File"}},
}

StdLangs is the original compiled-in set of standard language options.

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 SymTreeProps = ki.Props{}
View Source
var SymbolsViewProps = ki.Props{
	"background-color": &gi.Prefs.Colors.Background,
	"color":            &gi.Prefs.Colors.Font,
	"max-width":        -1,
	"max-height":       -1,
}

SymbolsViewProps are style properties for SymbolsView

Functions

func ArgVarKeys

func ArgVarKeys() []string

ArgVarKeys creates a slice of string to hold the keys

func ArgVarPrompts

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

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

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 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 LangsView

func LangsView(pt *Langs)

LangsView opens a view of a languages options map

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 MarkupStderr added in v0.5.4

func MarkupStderr(out []byte) []byte

func MarkupStdout added in v0.5.4

func MarkupStdout(out []byte) []byte

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 ProjPrefsView

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

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

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 SplitsView

func SplitsView(pt *Splits)

SplitsView opens a view of a commands table

func VersCtrlCmdNames

func VersCtrlCmdNames(vcnm giv.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 is the number of ArgVarTypes
	ArgVarTypesN
)

func (*ArgVarTypes) FromString

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

func (ArgVarTypes) MarshalJSON

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

MarshalJSON saves arg variables to a JSON-formatted file

func (ArgVarTypes) String

func (i ArgVarTypes) String() string

func (*ArgVarTypes) UnmarshalJSON

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

UnmarshalJSON decodes arg variables from a JSON-formatted file

type ArgVarVals

type ArgVarVals map[string]string

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

func (*ArgVarVals) Bind added in v0.5.4

func (avp *ArgVarVals) Bind(arg string) string

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

func (*ArgVarVals) Set added in v0.5.4

func (avp *ArgVarVals) Set(fpath string, ppref *ProjPrefs, tv *giv.TextView)

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

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(avp *ArgVarVals) []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(avp *ArgVarVals) (*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)

SetCompleter specifies the functions that do completion and post selection editing when inserting the chosen completion

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"`
	Lang    filecat.Supported `` /* 176-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(lang filecat.Supported) bool

LangMatch returns true if the given language matches the command Lang constraints

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(lang filecat.Supported, vcnm giv.VersCtrlName) []string

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

func (*Commands) LangCmdNames

func (cm *Commands) LangCmdNames(lang filecat.Supported) []string

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

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 */
	DepthColor   bool `desc:"colorize the background according to nesting depth"`
}

EditorPrefs contains editor preferences

func (*EditorPrefs) ConfigTextBuf added in v0.5.4

func (pf *EditorPrefs) ConfigTextBuf(tb *giv.TextBuf)

ConfigTextBuf sets TextBuf Opts according to prefs

func (*EditorPrefs) Defaults

func (pf *EditorPrefs) Defaults()

Defaults are the defaults for EditorPrefs

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()

Defaults are the defaults for FilePrefs

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 []filecat.Supported) []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

FindLoc corresponds to the search scope

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 is the number of find locations (scopes)
	FindLocN
)

func (*FindLoc) FromString

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

func (FindLoc) MarshalJSON

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

MarshalJSON encodes

func (FindLoc) String

func (i FindLoc) String() string

func (*FindLoc) UnmarshalJSON

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

UnmarshalJSON decodes

type FindParams

type FindParams struct {
	Find       string              `desc:"find string"`
	Replace    string              `desc:"replace string"`
	IgnoreCase bool                `desc:"ignore case"`
	Langs      []filecat.Supported `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 interface {
	gi.Node2D

	// VPort returns the viewport for the view
	VPort() *gi.Viewport2D

	// ProjPrefs() returns the gide.ProjPrefs
	ProjPrefs() *ProjPrefs

	// CmdRuns returns the CmdRuns manager of running commands, used extensively
	// in commands.go
	CmdRuns() *CmdRuns

	// ArgVarVals returns the ArgVarVals argument variable values
	ArgVarVals() *ArgVarVals

	// SetStatus updates the statusbar label with given message, along with other status info
	SetStatus(msg string)

	// SelectMainTabByName Selects given main tab, and returns all of its contents as well.
	SelectMainTabByName(label string) (gi.Node2D, int, bool)

	// FocusOnMainTabs moves keyboard focus to MainTabs panel -- returns false if nothing at that tab
	FocusOnMainTabs() bool

	// 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
	NextViewFileNode(fn *giv.FileNode) (*giv.TextView, int)

	// ActiveTextView returns the currently-active TextView
	ActiveTextView() *giv.TextView

	// ConfigOutputTextView configures a command-output textview within given parent layout
	ConfigOutputTextView(ly *gi.Layout) *giv.TextView

	// ExecCmdFileNode pops up a menu to select a command appropriate for the given node,
	// and shows output in MainTab with name of command
	ExecCmdFileNode(fn *giv.FileNode)

	// ExecCmdNameFileNode executes command of given name on given node
	ExecCmdNameFileNode(fn *giv.FileNode, cmdNm CmdName, sel bool, clearBuf bool)

	// ExecCmdNameFileName executes command of given name on given file name
	ExecCmdNameFileName(fn string, cmdNm CmdName, sel bool, clearBuf bool)

	// Find does Find / Replace in files, using given options and filters -- opens up a
	// main tab with the results and further controls.
	Find(find, repl string, ignoreCase bool, loc FindLoc, langs []filecat.Supported)

	// 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
	ParseOpenFindURL(ur string, ftv *giv.TextView) (tv *giv.TextView, reg giv.TextRegion, findBufStLn, findCount int, ok bool)

	// Spell checks spelling in files
	Spell()

	// Symbols calls a function to parse file or package
	Symbols()
}

Gide provides the interface for the GideView functionality that is needed by the core gide infrastructure, to allow GideView to be in a separate package. It is not intended to be the full functionality of the GideView.

func ParentGide added in v0.5.5

func ParentGide(kn ki.Ki) (Gide, bool)

ParentGide returns the Gide parent of given node

type KeyFuns

type KeyFuns int32

KeyFuns (i.e. gide.KeytFuns) 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)

MarshalJSON saves the KeyFuns in JSON format

func (KeyFuns) String

func (i KeyFuns) String() string

func (*KeyFuns) UnmarshalJSON

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

UnmarshalJSON reads the JSON formatted KeyFun info from file and loads into memory

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)

MarshalText 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

UnmarshalText is required for JSON decoding of struct keys

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 LangOpts added in v0.5.4

type LangOpts struct {
	PostSaveCmds CmdNames `desc:"command(s) to run after a file of this type is saved"`
}

LangOpts defines options associated with a given language / file format only languages in filecat.Supported list are supported..

type Langs

type Langs map[filecat.Supported]*LangOpts

Langs is a map of language options

var AvailLangs Langs

AvailLangs is the current set of language options -- can be loaded / saved / edited with preferences. This is set to StdLangs at startup.

func (*Langs) CopyFrom

func (lt *Langs) CopyFrom(cp Langs)

CopyFrom copies languages from given other map

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 */
	SaveLangOpts bool              `` /* 231-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()

Defaults are the defaults for Preferences

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) EditLangOpts added in v0.5.4

func (pf *Preferences) EditLangOpts()

EditLangOpts opens the LangsView editor to customize options 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 Gide 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     filecat.Supported `` /* 135-byte string literal not displayed */
	VersCtrl     giv.VersCtrlName  `desc:"the type of version control system used in this project (git, svn, etc) -- filters commands available"`
	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"`
	Symbols      SymbolsParams     `view:"-" desc:"saved structure 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 are parameters for spell check and correction

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)

AcceptSuggestion replaces the misspelled word with the word in the ChangeText field

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

ChangeAllAct 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

OpenSpellURL opens given spell:/// url from Find

func (*SpellView) SetUnknownAndSuggest

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

SetUnknownAndSuggest sets the textfield unknown with the best suggestion and fills the suggestions with all suggestions up to the max

func (*SpellView) SkipAct

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

SkipAct 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 SymNode added in v0.5.6

type SymNode struct {
	ki.Node
	Symbol syms.Symbol `desc:"a string"`
	SRoot  *SymTree    `json:"-" xml:"-" desc:"root of the tree -- has global state"`
}

SymNode represents a language symbol -- the name of the node is the name of the symbol. Some symbols, e.g. type have children

type SymTree added in v0.5.6

type SymTree struct {
	SymNode
	NodeType reflect.Type `view:"-" json:"-" qxml:"-" desc:"type of node to create -- defaults to giv.FileNode but can use custom node types"`
	View     *SymbolsView
}

SymTree is the root of a tree representing symbols of a package or file

func (*SymTree) OpenTree added in v0.5.6

func (st *SymTree) OpenTree(view *SymbolsView)

OpenTree opens a SymTree of symbols from a file or package parse

type SymbolsParams added in v0.5.6

type SymbolsParams struct {
}

SymbolsParams are parameters for structure view of file or package

type SymbolsView added in v0.5.6

type SymbolsView struct {
	gi.Layout
	Gide      Gide          `json:"-" xml:"-" desc:"parent gide project"`
	SymParams SymbolsParams `desc:"params for structure display"`
	SymsTree  SymTree       `desc:"all the syms for the file or package in a tree"`
}

SymbolsView is a widget that displays results of a file or package parse

func (*SymbolsView) ConfigToolbar added in v0.5.6

func (sv *SymbolsView) ConfigToolbar()

ConfigToolbar adds toolbar.

func (*SymbolsView) ConfigTree added in v0.5.6

func (sv *SymbolsView) ConfigTree()

ConfigTree adds a treeview to the symbolsview

func (*SymbolsView) OpenSymbolsURL added in v0.5.6

func (sv *SymbolsView) OpenSymbolsURL(ur string, ftv *giv.TextView) bool

OpenSymbolsURL opens given symbols:/// url from Find

func (*SymbolsView) SelectSymbol added in v0.5.6

func (sv *SymbolsView) SelectSymbol(ssym syms.Symbol)

func (*SymbolsView) StdConfig added in v0.5.6

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

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

func (*SymbolsView) StdSymbolsConfig added in v0.5.6

func (sv *SymbolsView) StdSymbolsConfig() (mods, updt bool)

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

func (*SymbolsView) SymbolsAction added in v0.5.6

func (sv *SymbolsView) SymbolsAction()

SymbolsAction runs a new parse with current params

func (*SymbolsView) SymbolsBar added in v0.5.6

func (sv *SymbolsView) SymbolsBar() *gi.ToolBar

SymbolsBar returns the spell toolbar

func (*SymbolsView) SymbolsTree added in v0.5.6

func (sv *SymbolsView) SymbolsTree() *gi.Frame

SymbolsBar returns the spell toolbar

func (*SymbolsView) UpdateView added in v0.5.6

func (sv *SymbolsView) UpdateView(ge Gide, sp SymbolsParams)

UpdateView updates view with current settings

Jump to

Keyboard shortcuts

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