gide

package
v1.1.11 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2023 License: BSD-3-Clause Imports: 44 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 (
	CmdWait      = true
	CmdNoWait    = false
	CmdFocus     = true
	CmdNoFocus   = false
	CmdConfirm   = true
	CmdNoConfirm = false
)

Use these for more obvious command options

View Source
const (
	Version     = "v1.1.11"
	GitCommit   = "f05416c"          // the commit JUST BEFORE the release
	VersionDate = "2023-08-27 22:37" // UTC
)

Variables

View Source
var ArgVars = map[string]ArgVarInfo{

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

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

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

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

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

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

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

	"{PromptFilePath}":       {"Prompt user for a file, and this is the full path to that file.", ArgVarPrompt},
	"{PromptFileName}":       {"Prompt user for a file, and this is the filename (only) of that file.", ArgVarPrompt},
	"{PromptFileDir}":        {"Prompt user for a file, and this is the directory name (only) of that file.", ArgVarPrompt},
	"{PromptFileDirPath}":    {"Prompt user for a file, and this is the full path to that directory.", ArgVarPrompt},
	"{PromptFileDirProjRel}": {"Prompt user for a file, and this is the path of that directory relative to the project root.", ArgVarPrompt},
	"{PromptString1}":        {"Prompt user for a string -- this is it.", ArgVarPrompt},
	"{PromptString2}":        {"Prompt user for another string -- this is it.", ArgVarPrompt},
	"{PromptBranch}":         {"Prompt user for a VCS branch.", 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 BreakViewProps = ki.Props{
	"EnumType:Flag": gi.KiT_NodeFlags,
	"max-width":     -1,
	"max-height":    -1,
}

BreakViewProps are style properties for DebugView

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 CmdPrompt1Vals = map[string]string{}

CmdPrompt1Vals holds last values for PromptString1 per command, so that each such command has its own appropriate history

View Source
var CmdPrompt2Vals = map[string]string{}

CmdPrompt2Vals holds last values for PromptString2 per command, so that each such command has its own appropriate history

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 any, 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 any, 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 any, act *gi.Action) {
				act.SetActiveState(cmi.(*Commands) != &StdCmds)
			}),
		}},
	},
}

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

View Source
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.

View Source
var CustomCmdsChanged = false

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

View Source
var DebugBreakColors = [DebugBreakStatusN]string{"pink", "red", "orange", "lightblue"}

DebugBreakColors are the colors indicating different breakpoint statuses

View Source
var DebugStatusColors = map[gidebug.Status]string{
	gidebug.NotInit:    "grey",
	gidebug.Error:      "#FF8080",
	gidebug.Building:   "yellow",
	gidebug.Ready:      "#80FF80",
	gidebug.Running:    "#FF80FF",
	gidebug.Stopped:    "#8080FF",
	gidebug.Breakpoint: "#8080FF",
	gidebug.Finished:   "tan",
}
View Source
var DebugViewProps = ki.Props{
	"EnumType:Flag": gi.KiT_NodeFlags,
	"max-width":     -1,
	"max-height":    -1,
	"CallMethods": ki.PropSlice{
		{"ListGlobalVars", ki.Props{
			"Args": ki.PropSlice{
				{"Filter", ki.Props{
					"width": 40,
				}},
			},
		}},
	},
}

DebugViewProps are style properties for DebugView

View Source
var Debuggers = map[filecat.Supported]func(path, rootPath string, outbuf *giv.TextBuf, pars *gidebug.Params) (gidebug.GiDebug, error){
	filecat.Go: func(path, rootPath string, outbuf *giv.TextBuf, pars *gidebug.Params) (gidebug.GiDebug, error) {
		return gidelve.NewGiDelve(path, rootPath, outbuf, pars)
	},
}

Debuggers is the list of supported debuggers

View Source
var DefaultKeyMap = KeyMapName("MacEmacs")

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

View Source
var FileNodeProps map[string]any
View Source
var FileTreeActiveDirFunc = giv.ActionUpdateFunc(func(fni any, 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 FileTreeActiveExecFunc = giv.ActionUpdateFunc(func(fni any, act *gi.Action) {
	ft := fni.(ki.Ki).Embed(KiT_FileTreeView).(*FileTreeView)
	fn := ft.FileNode()
	if fn != nil {
		act.SetActiveState(fn.IsExec())
	}
})

FileTreeActiveExecFunc is an ActionUpdateFunc that activates action if node is executable

View Source
var FileTreeInactiveDirFunc = giv.ActionUpdateFunc(func(fni any, 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 map[string]any
View Source
var FindViewProps = ki.Props{
	"EnumType:Flag":    gi.KiT_NodeFlags,
	"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 any, 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 any, 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 any, 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 any, 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, kit.NotBitFlag, nil, "ArgVar")
View Source
var KiT_BreakView = kit.Types.AddType(&BreakView{}, BreakViewProps)
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_DebugView = kit.Types.AddType(&DebugView{}, DebugViewProps)
View Source
var KiT_FileNode = kit.Types.AddType(&FileNode{}, nil)
View Source
var KiT_FileTreeView = kit.Types.AddType(&FileTreeView{}, nil)
View Source
var KiT_FindLoc = kit.Enums.AddEnumAltLower(FindLocN, kit.NotBitFlag, nil, "FindLoc")
View Source
var KiT_FindView = kit.Types.AddType(&FindView{}, FindViewProps)
View Source
var KiT_KeyFuns = kit.Enums.AddEnumAltLower(KeyFunsN, kit.NotBitFlag, 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_StackView = kit.Types.AddType(&StackView{}, StackViewProps)
View Source
var KiT_SymNode = kit.Types.AddType(&SymNode{}, ki.Props{"EnumType:Flag": ki.KiT_Flags})
View Source
var KiT_SymTreeView = kit.Types.AddType(&SymTreeView{}, nil)
View Source
var KiT_SymbolsView = kit.Types.AddType(&SymbolsView{}, SymbolsViewProps)
View Source
var KiT_TaskView = kit.Types.AddType(&TaskView{}, TaskViewProps)
View Source
var KiT_TextView = kit.Types.AddType(&TextView{}, giv.TextViewProps)
View Source
var KiT_ThreadView = kit.Types.AddType(&ThreadView{}, ThreadViewProps)
View Source
var KiT_VarView = kit.Types.AddType(&VarView{}, VarViewProps)
View Source
var KiT_VarsView = kit.Types.AddType(&VarsView{}, VarsViewProps)
View Source
var Kit_SymbolsViewScope = kit.Enums.AddEnumAltLower(SymScopeN, kit.NotBitFlag, nil, "SymScope")
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 any, 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 any, 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 any, 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 any, 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 any, 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 any, 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.",
		}},
	},
}

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 any, 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 any, 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{
	"EnumType:Flag":    gi.KiT_NodeFlags,
	"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 any, 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 any, 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 StackViewProps = ki.Props{
	"EnumType:Flag": gi.KiT_NodeFlags,
	"max-width":     -1,
	"max-height":    -1,
}

StackViewProps are style properties for DebugView

View Source
var StdCmds = Commands{
	{Cat: "Build", Name: "Run Proj",
		Desc: "run RunExec executable set in project",
		Lang: filecat.Any,
		Cmds: []CmdAndArgs{{Cmd: "{RunExecPath}"}},
		Dir:  "{RunExecDirPath}",
		Wait: CmdNoWait, Focus: CmdNoFocus, Confirm: CmdNoConfirm},
	{Cat: "Build", Name: "Run Prompt",
		Desc: "run any command you enter at the prompt",
		Lang: filecat.Any,
		Cmds: []CmdAndArgs{{Cmd: "{PromptString1}"}},
		Dir:  "{FileDirPath}",
		Wait: CmdNoWait, Focus: CmdNoFocus, Confirm: CmdNoConfirm},

	{Cat: "Build", Name: "Make",
		Desc: "run make with no args",
		Lang: filecat.Any,
		Cmds: []CmdAndArgs{{Cmd: "make"}},
		Dir:  "{FileDirPath}",
		Wait: CmdNoWait, Focus: CmdNoFocus, Confirm: CmdNoConfirm},

	{Cat: "Build", Name: "Make Prompt",
		Desc: "run make with prompted make target",
		Lang: filecat.Any,
		Cmds: []CmdAndArgs{{Cmd: "make",
			Args: []string{"{PromptString1}"}}},
		Dir:  "{FileDirPath}",
		Wait: CmdNoWait, Focus: CmdNoFocus, Confirm: CmdNoConfirm},

	{Cat: "File", Name: "Grep",
		Desc: "recursive grep of all files for prompted value",
		Lang: filecat.Any,
		Cmds: []CmdAndArgs{{Cmd: "grep",
			Args: []string{"-R", "-e", "{PromptString1}", "{FileDirPath}"}}},
		Dir:  "{FileDirPath}",
		Wait: CmdNoWait, Focus: CmdNoFocus, Confirm: CmdNoConfirm},

	{Cat: "File", Name: "Open",
		Desc: "open file using OS 'open' command",
		Lang: filecat.Any,
		Cmds: []CmdAndArgs{{Cmd: "open",
			Args: []string{"{FilePath}"}}},
		Dir:  "{FileDirPath}",
		Wait: CmdNoWait, Focus: CmdNoFocus, Confirm: CmdNoConfirm},

	{Cat: "File", Name: "Open Target",
		Desc: "open project target file using OS 'open' command",
		Lang: filecat.Any,
		Cmds: []CmdAndArgs{{Cmd: "open",
			Args: []string{"{RunExecPath}"}}},
		Dir:  "{FileDirPath}",
		Wait: CmdNoWait, Focus: CmdNoFocus, Confirm: CmdNoConfirm},

	{Cat: "Go", Name: "Imports File",
		Desc: "run goimports on file",
		Lang: filecat.Go,
		Cmds: []CmdAndArgs{{Cmd: "goimports",
			Args: []string{"-w", "{FilePath}"}}},
		Dir:  "{FileDirPath}",
		Wait: CmdWait, Focus: CmdNoFocus, Confirm: CmdNoConfirm},

	{Cat: "Go", Name: "Fmt File",
		Desc: "run go fmt on file",
		Lang: filecat.Go,
		Cmds: []CmdAndArgs{{Cmd: "gofmt",
			Args: []string{"-w", "{FilePath}"}}},
		Dir:  "{FileDirPath}",
		Wait: CmdWait, Focus: CmdNoFocus, Confirm: CmdNoConfirm},

	{Cat: "Go", Name: "Build Dir",
		Desc: "run go build to build in current dir",
		Lang: filecat.Go,
		Cmds: []CmdAndArgs{{Cmd: "go",
			Args: []string{"build", "-v"}}},
		Dir:  "{FileDirPath}",
		Wait: CmdNoWait, Focus: CmdNoFocus, Confirm: CmdNoConfirm},

	{Cat: "Go", Name: "Build Proj",
		Desc: "run go build for project BuildDir",
		Lang: filecat.Go,
		Cmds: []CmdAndArgs{{Cmd: "go",
			Args: []string{"build", "-v"}}},
		Dir:  "{BuildDir}",
		Wait: CmdNoWait, Focus: CmdNoFocus, Confirm: CmdNoConfirm},

	{Cat: "Go", Name: "Install Dir",
		Desc: "run go install in current dir",
		Lang: filecat.Go,
		Cmds: []CmdAndArgs{{Cmd: "go",
			Args: []string{"install", "-v"}}},
		Dir:  "{FileDirPath}",
		Wait: CmdNoWait, Focus: CmdNoFocus, Confirm: CmdNoConfirm},

	{Cat: "Go", Name: "Generate",
		Desc: "run go generate in current dir",
		Lang: filecat.Go,
		Cmds: []CmdAndArgs{{Cmd: "go",
			Args: []string{"generate"}}},
		Dir:  "{FileDirPath}",
		Wait: CmdNoWait, Focus: CmdNoFocus, Confirm: CmdNoConfirm},

	{Cat: "Go", Name: "Test",
		Desc: "run go test in current dir.  Options include: -run TestName or -bench",
		Lang: filecat.Go,
		Cmds: []CmdAndArgs{{Cmd: "go",
			Args: []string{"test", "-v", "{PromptString1}"}}},
		Dir:  "{FileDirPath}",
		Wait: CmdNoWait, Focus: CmdNoFocus, Confirm: CmdNoConfirm},

	{Cat: "Go", Name: "Vet",
		Desc: "run go vet in current dir",
		Lang: filecat.Go,
		Cmds: []CmdAndArgs{{Cmd: "go",
			Args: []string{"vet"}}},
		Dir:  "{FileDirPath}",
		Wait: CmdNoWait, Focus: CmdNoFocus, Confirm: CmdNoConfirm},

	{Cat: "Go", Name: "Mod Tidy",
		Desc: "run go mod tidy in current dir",
		Lang: filecat.Go,
		Cmds: []CmdAndArgs{{Cmd: "go",
			Args: []string{"mod", "tidy"}}},
		Dir:  "{FileDirPath}",
		Wait: CmdNoWait, Focus: CmdNoFocus, Confirm: CmdNoConfirm},

	{Cat: "Go", Name: "Mod Init",
		Desc: "run go mod init in current dir with module path from prompt",
		Lang: filecat.Go,
		Cmds: []CmdAndArgs{{Cmd: "go",
			Args: []string{"mod", "init", "{PromptString1}"}}},
		Dir:  "{FileDirPath}",
		Wait: CmdNoWait, Focus: CmdNoFocus, Confirm: CmdNoConfirm},

	{Cat: "Go", Name: "Get",
		Desc: "run go get on package(s) you enter at prompt",
		Lang: filecat.Go,
		Cmds: []CmdAndArgs{{Cmd: "go",
			Args: []string{"get", "{PromptString1}"}}},
		Dir:  "{FileDirPath}",
		Wait: CmdNoWait, Focus: CmdNoFocus, Confirm: CmdNoConfirm},

	{Cat: "Go", Name: "Get Updt",
		Desc: "run go get -u (updt) on package(s) you enter at prompt.  use ./... for all.",
		Lang: filecat.Go,
		Cmds: []CmdAndArgs{{Cmd: "go",
			Args:    []string{"get", "-u", "{PromptString1}"},
			Default: "./..."}},
		Dir:  "{FileDirPath}",
		Wait: CmdNoWait, Focus: CmdNoFocus, Confirm: CmdNoConfirm},

	{Cat: "Git", Name: "Add",
		Desc: "git add file",
		Lang: filecat.Any,
		Cmds: []CmdAndArgs{{Cmd: "git",
			Args: []string{"add", "{FilePath}"}}},
		Dir:  "{FileDirPath}",
		Wait: CmdNoWait, Focus: CmdNoFocus, Confirm: CmdNoConfirm},

	{Cat: "Git", Name: "Switch To Branch",
		Desc: "git switch to an existing branch",
		Lang: filecat.Any,
		Cmds: []CmdAndArgs{{Cmd: "git",
			Args: []string{"switch", "{PromptBranch}"}}},
		Dir:  "{FileDirPath}",
		Wait: CmdNoWait, Focus: CmdNoFocus, Confirm: CmdNoConfirm},

	{Cat: "Git", Name: "Switch",
		Desc: "git switch to new branch or existing commit: -c or -C (force) <branch> to create new; --detatch <commit> to switch to older (non-HEAD) commit; --orphan to abandon history",
		Lang: filecat.Any,
		Cmds: []CmdAndArgs{{Cmd: "git",
			Args:    []string{"switch", "{PromptString1}"},
			Default: "-c "}},
		Dir:  "{FileDirPath}",
		Wait: CmdNoWait, Focus: CmdNoFocus, Confirm: CmdNoConfirm},

	{Cat: "Git", Name: "Restore",
		Desc: "git restore: file, directory -- undoes any current changes and restores from last commit; -s option specifies source -- also available as revert in file view",
		Lang: filecat.Any,
		Cmds: []CmdAndArgs{{Cmd: "git",
			Args: []string{"restore", "{PromptString1}"}}},
		Dir:  "{FileDirPath}",
		Wait: CmdNoWait, Focus: CmdNoFocus, Confirm: CmdNoConfirm},

	{Cat: "Git", Name: "Checkout",
		Desc: "git checkout: file, directory, branch; -b <branch> creates a new branch",
		Lang: filecat.Any,
		Cmds: []CmdAndArgs{{Cmd: "git",
			Args: []string{"checkout", "{PromptString1}"}}},
		Dir:  "{FileDirPath}",
		Wait: CmdNoWait, Focus: CmdNoFocus, Confirm: CmdNoConfirm},

	{Cat: "Git", Name: "Status",
		Desc: "git status",
		Lang: filecat.Any,
		Cmds: []CmdAndArgs{{Cmd: "git",
			Args: []string{"status"}}},
		Dir:  "{FileDirPath}",
		Wait: CmdNoWait, Focus: CmdNoFocus, Confirm: CmdNoConfirm},

	{Cat: "Git", Name: "Diff",
		Desc: "git diff -- see changes since last checkin",
		Lang: filecat.Any,
		Cmds: []CmdAndArgs{{Cmd: "git",
			Args: []string{"diff"}}},
		Dir:  "{FileDirPath}",
		Wait: CmdNoWait, Focus: CmdNoFocus, Confirm: CmdNoConfirm},

	{Cat: "Git", Name: "Log",
		Desc: "git log",
		Lang: filecat.Any,
		Cmds: []CmdAndArgs{{Cmd: "git",
			Args: []string{"log"}}},
		Dir:  "{FileDirPath}",
		Wait: CmdNoWait, Focus: CmdNoFocus, Confirm: CmdNoConfirm},

	{Cat: "Git", Name: "Commit",
		Desc: "git commit",
		Lang: filecat.Any,
		Cmds: []CmdAndArgs{{Cmd: "git",
			Args: []string{"commit", "-am", "{PromptString1}"}, PromptIsString: true}},
		Dir:  "{FileDirPath}",
		Wait: CmdWait, Focus: CmdNoFocus, Confirm: CmdNoConfirm},

	{Cat: "Git", Name: "Pull Branch",
		Desc: "git pull from existing branch",
		Lang: filecat.Any,
		Cmds: []CmdAndArgs{{Cmd: "git",
			Args: []string{"pull", "origin", "{PromptBranch}"}}},
		Dir:  "{FileDirPath}",
		Wait: CmdNoWait, Focus: CmdNoFocus, Confirm: CmdNoConfirm},

	{Cat: "Git", Name: "Pull",
		Desc: "git pull",
		Lang: filecat.Any,
		Cmds: []CmdAndArgs{{Cmd: "git",
			Args:    []string{"pull", "{PromptString1}"},
			Default: "origin"}},
		Dir:  "{FileDirPath}",
		Wait: CmdNoWait, Focus: CmdNoFocus, Confirm: CmdNoConfirm},

	{Cat: "Git", Name: "Push",
		Desc: "git push to update remote (origin) for given branch",
		Lang: filecat.Any,
		Cmds: []CmdAndArgs{{Cmd: "git",
			Args:    []string{"push", "origin", "{PromptBranch}"},
			Default: "origin"}},
		Dir:  "{FileDirPath}",
		Wait: CmdNoWait, Focus: CmdNoFocus, Confirm: CmdNoConfirm},

	{Cat: "Git", Name: "Push Force",
		Desc: "git push to update remote (origin) for given branch -- force -- needed for example after rebase or merge with conflicts",
		Lang: filecat.Any,
		Cmds: []CmdAndArgs{{Cmd: "git",
			Args:    []string{"push", "--force", "origin", "{PromptBranch}"},
			Default: "origin"}},
		Dir:  "{FileDirPath}",
		Wait: CmdNoWait, Focus: CmdNoFocus, Confirm: CmdNoConfirm},

	{Cat: "Git", Name: "Stash",
		Desc: "git stash: push / pop local changes for later without committing, resetting to HEAD: also list, show, drop, clear",
		Lang: filecat.Any,
		Cmds: []CmdAndArgs{{Cmd: "git",
			Args:    []string{"stash", "{PromptString1}"},
			Default: "push"}},
		Dir:  "{FileDirPath}",
		Wait: CmdNoWait, Focus: CmdNoFocus, Confirm: CmdNoConfirm},

	{Cat: "Git", Name: "Branch",
		Desc: "git branch: -a shows all; --list shows local; <branchname> makes a new one, optionally given sha; -d to delete; -r delete remote; -D force delete",
		Lang: filecat.Any,
		Cmds: []CmdAndArgs{{Cmd: "git",
			Args:    []string{"branch", "{PromptString1}"},
			Default: "-a"}},
		Dir:  "{FileDirPath}",
		Wait: CmdNoWait, Focus: CmdNoFocus, Confirm: CmdNoConfirm},

	{Cat: "Git", Name: "Branch Delete",
		Desc: "git branch -d -r selected branch name",
		Lang: filecat.Any,
		Cmds: []CmdAndArgs{{Cmd: "git",
			Args: []string{"branch", "-d", "-r", "{PromptBranch}"}}},
		Dir:  "{FileDirPath}",
		Wait: CmdNoWait, Focus: CmdNoFocus, Confirm: CmdNoConfirm},

	{Cat: "Git", Name: "Rebase",
		Desc: "git rebase: updates current branch to given branch, often master",
		Lang: filecat.Any,
		Cmds: []CmdAndArgs{{Cmd: "git",
			Args:    []string{"rebase", "{PromptBranch}"},
			Default: "master"}},
		Dir:  "{FileDirPath}",
		Wait: CmdNoWait, Focus: CmdNoFocus, Confirm: CmdNoConfirm},

	{Cat: "Git", Name: "Rebase Continue",
		Desc: "git rebase: updates current branch to given branch, often master -- does --continue to continue process",
		Lang: filecat.Any,
		Cmds: []CmdAndArgs{{Cmd: "git",
			Args: []string{"rebase", "--continue"}}},
		Dir:  "{FileDirPath}",
		Wait: CmdNoWait, Focus: CmdNoFocus, Confirm: CmdNoConfirm},

	{Cat: "Git", Name: "Reset",
		Desc: "git reset: resets current state to given source -- use --hard to override -- CAN RESULT IN LOSS OF CHANGES -- make sure everything is committed",
		Lang: filecat.Any,
		Cmds: []CmdAndArgs{{Cmd: "git",
			Args:    []string{"reset", "{PromptString1}"},
			Default: "--hard origin/master"}},
		Dir:  "{FileDirPath}",
		Wait: CmdNoWait, Focus: CmdNoFocus, Confirm: CmdNoConfirm},

	{Cat: "Git", Name: "Remote",
		Desc: "git remote: prune origin = remove stale branches; show; add <name> <URL>; remove <name>; get-url / set-url <name>",
		Lang: filecat.Any,
		Cmds: []CmdAndArgs{{Cmd: "git",
			Args:    []string{"remote", "{PromptString1}"},
			Default: "prune origin"}},
		Dir:  "{FileDirPath}",
		Wait: CmdNoWait, Focus: CmdNoFocus, Confirm: CmdNoConfirm},

	{Cat: "SVN", Name: "Add",
		Desc: "svn add file",
		Lang: filecat.Any,
		Cmds: []CmdAndArgs{{Cmd: "svn",
			Args: []string{"add", "{FilePath}"}}},
		Dir:  "{FileDirPath}",
		Wait: CmdNoWait, Focus: CmdNoFocus, Confirm: CmdNoConfirm},

	{Cat: "SVN", Name: "Status",
		Desc: "svn status",
		Lang: filecat.Any,
		Cmds: []CmdAndArgs{{Cmd: "svn",
			Args: []string{"status"}}},
		Dir:  "{FileDirPath}",
		Wait: CmdNoWait, Focus: CmdNoFocus, Confirm: CmdNoConfirm},

	{Cat: "SVN", Name: "Info",
		Desc: "svn info",
		Lang: filecat.Any,
		Cmds: []CmdAndArgs{{Cmd: "svn",
			Args: []string{"info"}}},
		Dir:  "{FileDirPath}",
		Wait: CmdNoWait, Focus: CmdNoFocus, Confirm: CmdNoConfirm},

	{Cat: "SVN", Name: "Log",
		Desc: "svn log",
		Lang: filecat.Any,
		Cmds: []CmdAndArgs{{Cmd: "svn",
			Args: []string{"log", "-v"}}},
		Dir:  "{FileDirPath}",
		Wait: CmdNoWait, Focus: CmdNoFocus, Confirm: CmdNoConfirm},

	{Cat: "SVN", Name: "Commit Proj",
		Desc: "svn commit for entire project directory",
		Lang: filecat.Any,
		Cmds: []CmdAndArgs{{Cmd: "svn",
			Args: []string{"commit", "-m", "{PromptString1}"}, PromptIsString: true}},
		Dir:  "{ProjPath}",
		Wait: CmdWait, Focus: CmdNoFocus, Confirm: CmdNoConfirm},

	{Cat: "SVN", Name: "Commit Dir",
		Desc: "svn commit in directory of current file",
		Lang: filecat.Any,
		Cmds: []CmdAndArgs{{Cmd: "svn",
			Args: []string{"commit", "-m", "{PromptString1}"}, PromptIsString: true}},
		Dir:  "{FileDirPath}",
		Wait: CmdWait, Focus: CmdNoFocus, Confirm: CmdNoConfirm},

	{Cat: "SVN", Name: "Update",
		Desc: "svn update",
		Lang: filecat.Any,
		Cmds: []CmdAndArgs{{Cmd: "svn",
			Args: []string{"update"}}},
		Dir:  "{FileDirPath}",
		Wait: CmdNoWait, Focus: CmdNoFocus, Confirm: CmdNoConfirm},

	{Cat: "LaTeX", Name: "LaTeX PDF",
		Desc: "run PDFLaTeX on file",
		Lang: filecat.TeX,
		Cmds: []CmdAndArgs{{Cmd: "pdflatex",
			Args: []string{"-file-line-error", "-interaction=nonstopmode", "{FilePath}"}}},
		Dir:  "{FileDirPath}",
		Wait: CmdNoWait, Focus: CmdNoFocus, Confirm: CmdNoConfirm},

	{Cat: "LaTeX", Name: "BibTeX",
		Desc: "run BibTeX on file",
		Lang: filecat.TeX,
		Cmds: []CmdAndArgs{{Cmd: "bibtex",
			Args: []string{"{FileNameNoExt}"}}},
		Dir:  "{FileDirPath}",
		Wait: CmdNoWait, Focus: CmdNoFocus, Confirm: CmdNoConfirm},

	{Cat: "LaTeX", Name: "Biber",
		Desc: "run Biber on file",
		Lang: filecat.TeX,
		Cmds: []CmdAndArgs{{Cmd: "biber",
			Args: []string{"{FileNameNoExt}"}}},
		Dir:  "{FileDirPath}",
		Wait: CmdNoWait, Focus: CmdNoFocus, Confirm: CmdNoConfirm},

	{Cat: "LaTeX", Name: "CleanTeX",
		Desc: "remove aux LaTeX files",
		Lang: filecat.TeX,
		Cmds: []CmdAndArgs{{Cmd: "rm",
			Args: []string{"*.aux", "*.log", "*.blg", "*.bbl", "*.fff", "*.lof", "*.ttt", "*.toc", "*.spl"}}},
		Dir:  "{FileDirPath}",
		Wait: CmdNoWait, Focus: CmdNoFocus, Confirm: CmdNoConfirm},
}

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+M", "Control+X"}: KeyFunRectCut,
		KeySeq{"Control+M", "Control+Y"}: KeyFunRectPaste,
		KeySeq{"Control+M", "Alt+∑"}:     KeyFunRectCopy,
		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+X", "Control+X"}: KeyFunRectCut,
		KeySeq{"Control+X", "Control+Y"}: KeyFunRectPaste,
		KeySeq{"Control+X", "Alt+∑"}:     KeyFunRectCopy,
		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+X", "Control+X"}: KeyFunRectCut,
		KeySeq{"Control+X", "Control+Y"}: KeyFunRectPaste,
		KeySeq{"Control+X", "Alt+∑"}:     KeyFunRectCopy,
		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+M", "Control+X"}: KeyFunRectCut,
		KeySeq{"Control+M", "Control+Y"}: KeyFunRectPaste,
		KeySeq{"Control+M", "Alt+∑"}:     KeyFunRectCopy,
		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+M", "Control+X"}: KeyFunRectCut,
		KeySeq{"Control+M", "Control+Y"}: KeyFunRectPaste,
		KeySeq{"Control+M", "Alt+∑"}:     KeyFunRectCopy,
		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+M", "Control+X"}: KeyFunRectCut,
		KeySeq{"Control+M", "Control+Y"}: KeyFunRectPaste,
		KeySeq{"Control+M", "Alt+∑"}:     KeyFunRectCopy,
		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{"Go: Imports File"}},
}

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

View Source
var StdSplits = Splits{
	{"Code", "2 text views, tabs", []float32{.1, .325, .325, .25}},
	{"Small", "1 text view, tabs", []float32{.1, .5, 0, .4}},
	{"BigTabs", "1 text view, big tabs", []float32{.1, .3, 0, .6}},
}

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

View Source
var SymTreeViewProps = ki.Props{
	"EnumType:Flag":    giv.KiT_TreeViewFlags,
	"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":       gist.AlignLeft,
	"vertical-align":   gist.AlignTop,
	"color":            &gi.Prefs.Colors.Font,
	"background-color": "inherit",
	".exec": ki.Props{
		"font-weight": gist.WeightBold,
	},
	".open": ki.Props{
		"font-style": gist.FontItalic,
	},
	"#icon": ki.Props{
		"width":   units.NewValue(1, units.Em),
		"height":  units.NewValue(1, units.Em),
		"margin":  units.NewValue(0, units.Px),
		"padding": units.NewValue(0, units.Px),
		"fill":    &gi.Prefs.Colors.Icon,
		"stroke":  &gi.Prefs.Colors.Font,
	},
	"#branch": ki.Props{
		"icon":             "wedge-down",
		"icon-off":         "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{},
}
View Source
var SymbolsViewProps = ki.Props{
	"EnumType:Flag":    gi.KiT_NodeFlags,
	"background-color": &gi.Prefs.Colors.Background,
	"color":            &gi.Prefs.Colors.Font,
	"max-width":        -1,
	"max-height":       -1,
}

SymbolsViewProps are style properties for SymbolsView

View Source
var TaskViewProps = ki.Props{
	"EnumType:Flag": gi.KiT_NodeFlags,
	"max-width":     -1,
	"max-height":    -1,
}

TaskViewProps are style properties for DebugView

View Source
var ThreadViewProps = ki.Props{
	"EnumType:Flag": gi.KiT_NodeFlags,
	"max-width":     -1,
	"max-height":    -1,
}

ThreadViewProps are style properties for DebugView

View Source
var VarViewProps = ki.Props{
	"EnumType:Flag":    gi.KiT_NodeFlags,
	"background-color": &gi.Prefs.Colors.Background,
	"color":            &gi.Prefs.Colors.Font,
	"max-width":        -1,
	"max-height":       -1,
}
View Source
var VarsViewProps = ki.Props{
	"EnumType:Flag": gi.KiT_NodeFlags,
	"max-width":     -1,
	"max-height":    -1,
}

VarsViewProps are style properties for DebugView

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 CommandName added in v1.1.7

func CommandName(cat, cmd string) string

CommandName returns a qualified command name as cat: cmd

func CompleteArg

func CompleteArg(data any, text string, posLn, posCh int) (md complete.Matches)

CompleteArg supplies directory variables to the completer

func CompleteArgEdit

func CompleteArgEdit(data any, text string, cursorPos int, c complete.Completion, seed string) (ed complete.Edit)

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

func ConfigOutputTextView added in v0.9.11

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

ConfigOutputTextView configures a command-output textview within given parent layout

func FileTreeViewExecCmds

func FileTreeViewExecCmds(it any, 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 NewDebugger added in v0.9.11

func NewDebugger(sup filecat.Supported, path, rootPath string, outbuf *giv.TextBuf, pars *gidebug.Params) (gidebug.GiDebug, error)

NewDebugger returns a new debugger for given supported file type

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) *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 RepoCurBranches added in v1.1.9

func RepoCurBranches(repo vci.Repo) (string, []string, error)

RepoCurBranches returns the current branch and a list of all branches ensuring that the current also appears on the list of all. In git, a new branch may not so appear.

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 SetGoMod added in v1.1.1

func SetGoMod(gomod bool)

ApplyGoMod applies the given gomod setting, setting the GO111MODULE env var

func SplitsView

func SplitsView(pt *Splits)

SplitsView opens a view of a commands table

Types

type ArgVarInfo

type ArgVarInfo struct {

	// description of arg var
	Desc string `desc:"description of arg var"`

	// type of variable -- used for checking usage and other special features such as prompting
	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 BreakView added in v0.9.11

type BreakView struct {
	gi.Layout
}

BreakView is a view of the breakpoints

func (*BreakView) Config added in v0.9.11

func (sv *BreakView) Config(dv *DebugView)

func (*BreakView) DebugVw added in v0.9.11

func (sv *BreakView) DebugVw() *DebugView

func (*BreakView) ShowBreaks added in v0.9.11

func (sv *BreakView) ShowBreaks()

ShowBreaks triggers update of view of State.Breaks

func (*BreakView) TableView added in v0.9.11

func (sv *BreakView) TableView() *giv.TableView

TableView returns the tableview

type CmdAndArgs

type CmdAndArgs struct {

	// external program to execute -- must be on path or have full path specified -- use {RunExec} for the project RunExec executable.
	Cmd string `` /* 145-byte string literal not displayed */

	// args to pass to the program, one string per arg -- use {FileName} etc to refer to special variables -- just start typing { and you'll get a completion menu of options, and use backslash-quoted bracket to insert a literal curly bracket.  Use unix-standard path separators (/) -- they will be replaced with proper os-specific path separator (e.g., on Windows).
	Args CmdArgs `` /* 391-byte string literal not displayed */

	// default value for prompt string, for first use -- thereafter it uses last value provided for given command
	Default string `width:"25" desc:"default value for prompt string, for first use -- thereafter it uses last value provided for given command"`

	// if true, then do not split any prompted string into separate space-separated fields -- otherwise do so, except for values within quotes
	PromptIsString bool `` /* 142-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. Formatted as Cat: Name as in Command.Label()

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 of command being run -- same as Command.Name
	Name string `desc:"Name of command being run -- same as Command.Name"`

	// command string
	CmdStr string `desc:"command string"`

	// Details of the command and args
	CmdArgs *CmdAndArgs `desc:"Details of the command and args"`

	// exec.Cmd for the command
	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 {

	// category for the command -- commands are organized in to hierarchical menus according to category
	Cat string `desc:"category for the command -- commands are organized in to hierarchical menus according to category"`

	// name of this command (must be unique in list of commands)
	Name string `width:"20" desc:"name of this command (must be unique in list of commands)"`

	// brief description of this command
	Desc string `width:"40" desc:"brief description of this command"`

	// supported language / file type that this command applies to -- choose Any or e.g., AnyCode for subtypes -- filters the list of commands shown based on file language type
	Lang filecat.Supported `` /* 176-byte string literal not displayed */

	// sequence of commands to run for this overall command.
	Cmds []CmdAndArgs `tableview-select:"-" desc:"sequence of commands to run for this overall command."`

	// if specified, will change to this directory before executing the command -- e.g., use {FileDirPath} for current file's directory -- only use directory values here -- if not specified, directory will be project root directory.
	Dir string `` /* 258-byte string literal not displayed */

	// if true, we wait for the command to run before displaying output -- mainly for post-save commands and those with subsequent steps: if multiple commands are present, then it uses Wait mode regardless.
	Wait bool `` /* 206-byte string literal not displayed */

	// if true, keyboard focus is directed to the command output tab panel after the command runs.
	Focus bool `desc:"if true, keyboard focus is directed to the command output tab panel after the command runs."`

	// if true, command requires Ok / Cancel confirmation dialog -- only needed for non-prompt commands
	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.

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 organized by category that are compatible with given language and version control system.

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 {

	// std out writer -- set to os.Stdout
	StdoutWrite *os.File `json:"-" xml:"-" desc:"std out writer -- set to os.Stdout"`

	// std out reader -- used to read os.Stdout
	StdoutRead *os.File `json:"-" xml:"-" desc:"std out reader -- used to read os.Stdout"`

	// std err writer -- set to os.Stderr
	StderrWrite *os.File `json:"-" xml:"-" desc:"std err writer -- set to os.Stderr"`

	// std err reader -- used to read os.Stderr
	StderrRead *os.File `json:"-" xml:"-" desc:"std err reader -- used to read os.Stderr"`

	// text buffer holding all output
	Buf *giv.TextBuf `json:"-" xml:"-" desc:"text buffer holding all output"`

	// set to true to cancel monitoring
	Cancel bool `json:"-" xml:"-" desc:"set to true to cancel monitoring"`

	// mutex protecting updating of buffer between out / err
	Mu sync.Mutex `json:"-" xml:"-" desc:"mutex protecting updating of buffer between out / err"`

	// original os.Stdout writer
	OrgoutWrite *os.File `json:"-" xml:"-" desc:"original os.Stdout writer"`

	// original os.Stderr writer
	OrgerrWrite *os.File `json:"-" xml:"-" desc:"original os.Stderr writer"`

	// log file writer
	LogWrite *os.File `json:"-" xml:"-" desc:"log file writer"`
}

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

var TheConsole Console

func (*Console) Close added in v1.1.4

func (cn *Console) Close()

Close closes all the files -- call on exit

func (*Console) Init

func (cn *Console) Init(logFile string)

Init initializes the console -- sets up the capture, Buf, and starts the routine that monitors output. if logFile is non-empty, writes output to that file as well.

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 DebugBreakStatus added in v0.9.14

type DebugBreakStatus int32

DebugBreakStatus is the status of a given breakpoint

const (
	// DebugBreakInactive is an inactive break point
	DebugBreakInactive DebugBreakStatus = iota

	// DebugBreakActive is an active break point
	DebugBreakActive

	// DebugBreakCurrent is the current break point
	DebugBreakCurrent

	// DebugPCCurrent is the current program execution point,
	// updated for every ShowFile action
	DebugPCCurrent

	DebugBreakStatusN
)

type DebugView added in v0.9.11

type DebugView struct {
	gi.Layout

	// supported file type to determine debugger
	Sup filecat.Supported `desc:"supported file type to determine debugger"`

	// path to executable / dir to debug
	ExePath string `desc:"path to executable / dir to debug"`

	// time when dbg was last restarted
	DbgTime time.Time `desc:"time when dbg was last restarted"`

	// the debugger
	Dbg gidebug.GiDebug `json:"-" xml:"-" desc:"the debugger"`

	// all relevant debug state info
	State gidebug.AllState `json:"-" xml:"-" desc:"all relevant debug state info"`

	// current ShowFile location -- cleared before next one or run
	CurFileLoc gidebug.Location `json:"-" xml:"-" desc:"current ShowFile location -- cleared before next one or run"`

	// backup breakpoints list -- to track deletes
	BBreaks []*gidebug.Break `json:"-" xml:"-" desc:"backup breakpoints list -- to track deletes"`

	// output from the debugger
	OutBuf *giv.TextBuf `json:"-" xml:"-" desc:"output from the debugger"`

	// parent gide project
	Gide Gide `json:"-" xml:"-" desc:"parent gide project"`
}

DebugView is the debugger

func (*DebugView) ActionActivate added in v0.9.11

func (dv *DebugView) ActionActivate(act *gi.Action)

ActionActivate is the update function for actions that depend on the debugger being avail for input commands

func (*DebugView) AddBreak added in v0.9.11

func (dv *DebugView) AddBreak(fpath string, line int)

AddBreak adds a breakpoint at given file path and line number. note: all breakpoints are just set in our master list and uploaded to the system right before starting running.

func (DebugView) AllVarVw added in v0.9.11

func (dv DebugView) AllVarVw() *VarsView

AllVarVw returns the all vars view from tabs

func (*DebugView) BackupBreaks added in v0.9.14

func (dv *DebugView) BackupBreaks()

BackupBreaks makes a backup copy of current breaks

func (DebugView) BreakVw added in v0.9.11

func (dv DebugView) BreakVw() *BreakView

BreakVw returns the break view from tabs

func (*DebugView) Config added in v0.9.11

func (dv *DebugView) Config(ge Gide, sup filecat.Supported, exePath string)

Config configures the view -- parameters for the job must have already been set in ge.ProjParams.Debug.

func (*DebugView) ConfigTabs added in v0.9.11

func (dv *DebugView) ConfigTabs()

ConfigTabs configures the tabs

func (*DebugView) ConfigToolBar added in v0.9.13

func (dv *DebugView) ConfigToolBar()

func (DebugView) ConsoleText added in v0.9.11

func (dv DebugView) ConsoleText() *giv.TextView

ConsoleText returns the console TextView

func (*DebugView) Continue added in v0.9.11

func (dv *DebugView) Continue()

Continue continues running from current point -- this MUST be called in a separate goroutine!

func (*DebugView) DbgCanStep added in v0.9.11

func (dv *DebugView) DbgCanStep() bool

DbgCanStep means the debugger is started AND process is not currently running, AND it is not already waiting for a next step

func (*DebugView) DbgIsActive added in v0.9.11

func (dv *DebugView) DbgIsActive() bool

DbgIsActive means debugger is started.

func (*DebugView) DbgIsAvail added in v0.9.11

func (dv *DebugView) DbgIsAvail() bool

DbgIsAvail means the debugger is started AND process is not currently running -- it is available for command input.

func (*DebugView) DeleteAllBreaks added in v0.9.11

func (dv *DebugView) DeleteAllBreaks()

DeleteAllBreaks deletes all breakpoints

func (*DebugView) DeleteBreak added in v0.9.11

func (dv *DebugView) DeleteBreak(fpath string, line int)

DeleteBreak deletes given breakpoint. If debugger is not yet activated then it just deletes from master list. Note that breakpoints can be turned on and off directly using On flag.

func (*DebugView) DeleteBreakIdx added in v0.9.14

func (dv *DebugView) DeleteBreakIdx(bidx int)

DeleteBreakIdx deletes break at given index in list of breaks

func (*DebugView) DeleteBreakImpl added in v0.9.14

func (dv *DebugView) DeleteBreakImpl(fpath string, line int)

DeleteBreakImpl deletes given breakpoint with no other updates

func (*DebugView) DeleteBreakInBuf added in v0.9.14

func (dv *DebugView) DeleteBreakInBuf(fpath string, line int)

DeleteBreakInBuf delete breakpoint in its TextBuf line is 1-based line number

func (*DebugView) DeleteCurPCInBuf added in v0.9.14

func (dv *DebugView) DeleteCurPCInBuf()

DeleteCurPCInBuf deletes the current PC location in given file line is 1-based line number

func (*DebugView) Destroy added in v0.9.11

func (dv *DebugView) Destroy()

func (*DebugView) Detach added in v0.9.11

func (dv *DebugView) Detach()

Detach from debugger

func (*DebugView) FindFrames added in v0.9.11

func (dv *DebugView) FindFrames(fpath string, line int)

FindFrames finds the frames where given file and line are active Selects the one that is closest and shows the others in Find Tab

func (DebugView) FindFramesVw added in v0.9.11

func (dv DebugView) FindFramesVw() *StackView

FindFramesVw returns the find frames view from tabs

func (*DebugView) InitState added in v0.9.11

func (dv *DebugView) InitState(ds *gidebug.State)

InitState updates the State and View from given debug state Call this when debugger returns from any action update

func (*DebugView) ListGlobalVars added in v0.9.11

func (dv *DebugView) ListGlobalVars(filter string)

ListGlobalVars lists global vars matching given optional filter in Global Vars tab

func (*DebugView) SetBreaks added in v0.9.11

func (dv *DebugView) SetBreaks()

SetBreaks sets the current breakpoints from State, call this prior to running

func (*DebugView) SetCurPCInBuf added in v0.9.14

func (dv *DebugView) SetCurPCInBuf(fpath string, line int)

SetCurPCInBuf sets the current PC location in given file line is 1-based line number

func (*DebugView) SetFrame added in v0.9.11

func (dv *DebugView) SetFrame(depth int)

SetFrame sets the given frame depth level as active

func (*DebugView) SetStatus added in v0.9.11

func (dv *DebugView) SetStatus(stat gidebug.Status)

func (*DebugView) SetThread added in v0.9.11

func (dv *DebugView) SetThread(threadID int)

SetThread sets the given thread as active -- this must be TaskID if HasTasks and ThreadID if not.

func (*DebugView) SetThreadIdx added in v0.9.11

func (dv *DebugView) SetThreadIdx(thridx int)

SetThreadIdx sets the given thread by index in threads list as active this must be TaskID if HasTasks and ThreadID if not.

func (*DebugView) ShowBreakFile added in v0.9.11

func (dv *DebugView) ShowBreakFile(bidx int)

ShowBreakFile shows the file for given break index

func (*DebugView) ShowBreaks added in v0.9.11

func (dv *DebugView) ShowBreaks(selTab bool)

ShowBreaks shows the current breaks

func (*DebugView) ShowFile added in v0.9.11

func (dv *DebugView) ShowFile(fpath string, line int)

ShowFile shows the file name in gide

func (*DebugView) ShowFindFrames added in v0.9.11

func (dv *DebugView) ShowFindFrames(selTab bool)

ShowFindFrames shows the current find frames

func (*DebugView) ShowGlobalVars added in v0.9.11

func (dv *DebugView) ShowGlobalVars(selTab bool)

ShowGlobalVars shows the current allvars

func (*DebugView) ShowStack added in v0.9.11

func (dv *DebugView) ShowStack(selTab bool)

ShowStack shows the current stack

func (*DebugView) ShowTasks added in v0.9.11

func (dv *DebugView) ShowTasks(selTab bool)

ShowTasks shows the current tasks

func (*DebugView) ShowThreads added in v0.9.11

func (dv *DebugView) ShowThreads(selTab bool)

ShowThreads shows the current threads

func (*DebugView) ShowVar added in v0.9.11

func (dv *DebugView) ShowVar(name string) error

ShowVar shows info on a given variable within the current frame scope in a text view dialog

func (*DebugView) ShowVars added in v0.9.11

func (dv *DebugView) ShowVars(selTab bool)

ShowVars shows the current vars

func (*DebugView) SingleStep added in v0.9.11

func (dv *DebugView) SingleStep()

StepSingle steps a single cpu instruction.

func (DebugView) StackVw added in v0.9.11

func (dv DebugView) StackVw() *StackView

StackVw returns the stack view from tabs

func (*DebugView) Start added in v0.9.11

func (dv *DebugView) Start()

Start starts the debuger

func (*DebugView) StepInto added in v0.9.11

func (dv *DebugView) StepInto()

StepInto continues to the next source line, entering function calls.

func (*DebugView) StepOut added in v0.9.11

func (dv *DebugView) StepOut()

StepOut continues to the return point of the current function

func (*DebugView) StepOver added in v0.9.11

func (dv *DebugView) StepOver()

StepOver continues to the next source line, not entering function calls.

func (*DebugView) Stop added in v0.9.11

func (dv *DebugView) Stop()

Stop stops a running process

func (*DebugView) Tabs added in v0.9.11

func (dv *DebugView) Tabs() *gi.TabView

Tabs returns the tabs

func (DebugView) TaskVw added in v0.9.11

func (dv DebugView) TaskVw() *TaskView

TaskVw returns the task view from tabs

func (DebugView) ThreadVw added in v0.9.11

func (dv DebugView) ThreadVw() *ThreadView

ThreadVw returns the thread view from tabs

func (*DebugView) ToolBar added in v0.9.13

func (dv *DebugView) ToolBar() *gi.ToolBar

ToolBar returns the find toolbar

func (*DebugView) UpdateAllBreaks added in v0.9.14

func (dv *DebugView) UpdateAllBreaks()

UpdateAllBreaks updates all breakpoints

func (*DebugView) UpdateBreakInBuf added in v0.9.14

func (dv *DebugView) UpdateBreakInBuf(fpath string, line int, stat DebugBreakStatus)

UpdateBreakInBuf updates break status in its TextBuf line is 1-based line number

func (*DebugView) UpdateFmState added in v0.9.11

func (dv *DebugView) UpdateFmState()

UpdateFmState updates the view from current debugger state

func (*DebugView) UpdateToolBar added in v0.9.13

func (dv *DebugView) UpdateToolBar()

func (*DebugView) UpdateView added in v0.9.11

func (dv *DebugView) UpdateView()

UpdateView updates current view of state

func (*DebugView) VarValue added in v0.9.14

func (dv *DebugView) VarValue(varNm string) string

VarValue returns the value of given variable, first looking in local stack vars and then in global vars

func (DebugView) VarVw added in v0.9.11

func (dv DebugView) VarVw() *VarsView

VarVw returns the vars view from tabs

type FileNode

type FileNode struct {
	giv.FileNode
}

FileNode is Gide version of FileNode for FileTree view

func (*FileNode) CopyFieldsFrom added in v0.9.11

func (fn *FileNode) CopyFieldsFrom(frm any)

func (*FileNode) EditFile added in v0.9.11

func (fn *FileNode) EditFile()

EditFile pulls up this file in Gide

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) SetRunExec added in v0.9.11

func (fn *FileNode) SetRunExec()

SetRunExec sets executable as the RunExec executable that will be run with Run / Debug buttons

type FilePrefs

type FilePrefs struct {

	// if true, then all directories are placed at the top of the tree view -- otherwise everything is alpha sorted
	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 []textbuf.Match
}

FileSearchResults is used to report search results

func FileTreeSearch

func FileTreeSearch(start *giv.FileNode, find string, ignoreCase, regExp 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) EditFiles added in v0.9.11

func (ft *FileTreeView) EditFiles()

EditFiles calls EditFile on selected files

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) RenameFiles added in v0.9.11

func (ftv *FileTreeView) RenameFiles()

RenameFiles calls RenameFile on any selected nodes

func (*FileTreeView) SetRunExec added in v0.9.11

func (ft *FileTreeView) SetRunExec()

SetRunExec sets executable as the RunExec executable that will be run with Run / Debug buttons

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)

func (FindLoc) String

func (i FindLoc) String() string

func (*FindLoc) UnmarshalJSON

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

type FindParams

type FindParams struct {

	// find string
	Find string `desc:"find string"`

	// replace string
	Replace string `desc:"replace string"`

	// ignore case
	IgnoreCase bool `desc:"ignore case"`

	// use regexp regular expression search and replace
	Regexp bool `desc:"use regexp regular expression search and replace"`

	// languages for files to search
	Langs []filecat.Supported `desc:"languages for files to search"`

	// locations to search in
	Loc FindLoc `desc:"locations to search in"`

	// history of finds
	FindHist []string `desc:"history of finds"`

	// history of replaces
	ReplHist []string `desc:"history of replaces"`
}

FindParams are parameters for find / replace

type FindView

type FindView struct {
	gi.Layout

	// parent gide project
	Gide Gide `json:"-" xml:"-" desc:"parent gide project"`

	// langs value view
	LangVV giv.ValueView `desc:"langs value view"`

	// time of last find
	Time time.Time `desc:"time of last find"`

	// compiled regexp
	Re *regexp.Regexp `desc:"compiled regexp"`
}

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

func (*FindView) CheckValidRegexp added in v1.0.2

func (fv *FindView) CheckValidRegexp() bool

CheckValidRegexp returns false if using regexp and it is not valid

func (*FindView) CompileRegexp added in v1.0.2

func (fv *FindView) CompileRegexp() bool

CompileRegexp compiles the regexp if necessary -- returns false if it is invalid

func (*FindView) Config added in v0.5.8

func (fv *FindView) Config(ge Gide)

Config configures the view

func (*FindView) ConfigToolbar

func (fv *FindView) ConfigToolbar()

ConfigToolbar adds 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) RegexpBox added in v1.0.2

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

RegexpBox returns the regexp checkbox in toolbar

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 -- if using regexp mode, regexp must be compiled in advance

func (*FindView) ReplaceAll added in v0.9.14

func (fv *FindView) ReplaceAll()

ReplaceAll performs replace all

func (*FindView) ReplaceAllAction

func (fv *FindView) ReplaceAllAction()

ReplaceAllAction performs replace all, prompting before proceeding

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) ShowResults added in v1.0.5

func (fv *FindView) ShowResults(res []FileSearchResults)

ShowResults shows the results in the buffer

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

type Gide

type Gide interface {
	gi.Node2D

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

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

	// FileTree returns the gide.Files file tree
	FileTree() *giv.FileTree

	// LastSaveTime returns the time stamp when a file was last saved within project --
	// can be used for dirty flag state relative to other time stamps.
	LastSaveTime() time.Time

	// VersCtrl returns the version control system in effect, using the file tree detected
	// version or whatever is set in project preferences
	VersCtrl() giv.VersCtrlName

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

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

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

	// ShowFile shows given file name at given line, returning TextView showing it
	// or error if not found.
	ShowFile(fname string, ln int) (*TextView, error)

	// FileNodeForFile returns file node for given file path.
	// add: if not found in existing tree and external files, then if add is true,
	// it is added to the ExtFiles list.
	FileNodeForFile(fpath string, add bool) *giv.FileNode

	// TextBufForFile returns the TextBuf for given file path
	// add: if not found in existing tree and external files, then if add is true,
	// it is added to the ExtFiles list.
	TextBufForFile(fpath string, add bool) *giv.TextBuf

	// 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) (*TextView, int)

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

	// SetActiveTextView sets the given textview as the active one, and returns its index
	SetActiveTextView(av *TextView) int

	// ActiveFileNode returns the file node for the active file -- nil if none
	ActiveFileNode() *giv.FileNode

	// ExecCmdFileNode pops up a menu to select a command appropriate for the given node,
	// and shows output in Tab 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, regExp 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 *TextView, reg textbuf.Region, findBufStLn, findCount int, ok bool)

	// OpenFileAtRegion opens the specified file, highlights the region and sets the cursor
	OpenFileAtRegion(filename gi.FileName, reg textbuf.Region) (tv *TextView, ok bool)

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

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

	// CloseOpenNodes closes any nodes with open views (including those in directories under nodes).
	// called prior to rename.
	CloseOpenNodes(nodes []*FileNode)

	// LookupFun is the completion system Lookup function that makes a custom
	// textview dialog that has option to edit resulting file.
	LookupFun(data any, text string, posLn, posCh int) (ld complete.Lookup)

	// Spell checks spelling in active text view
	Spell()

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

	// Debug runs debugger on default exe
	Debug()

	// CurDebug returns the current debug view, or nil
	CurDebug() *DebugView

	// ClearDebug clears the current debugger setting -- no more debugger active.
	ClearDebug()
}

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
	KeyFunRectCopy           // copy rectangle
	KeyFunRectCut            // cut rectangle
	KeyFunRectPaste          // paste rectangle
	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 {

	// the key chord sequence that activates a function
	Keys KeySeq `desc:"the key chord sequence that activates a function"`

	// the function of that key
	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 of keymap
	Name string `width:"20" desc:"name of keymap"`

	// description of keymap -- good idea to include source it was derived from
	Desc string `desc:"description of keymap -- good idea to include source it was derived from"`

	// to edit key sequence click button and type new key combination; to edit function mapped to key sequence choose from menu
	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 {

	// command(s) to run after a file of this type is saved
	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) bool

Add adds given node to list of open nodes -- if already on the list it is moved to the top -- returns true if actually added. Connects to fn.TextBuf signal and auto-closes when buffer closes.

func (*OpenNodes) AddImpl added in v0.9.11

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

AddImpl adds given node to list of open nodes -- if already on the list it is moved to the top -- returns true if actually added.

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 {

	// file view preferences
	Files FilePrefs `desc:"file view preferences"`

	// environment variables to set for this app -- if run from the command line, standard shell environment variables are inherited, but on some OS's (Mac), they are not set when run as a gui app
	EnvVars map[string]string `` /* 196-byte string literal not displayed */

	// key map for gide-specific keyboard sequences
	KeyMap KeyMapName `desc:"key map for gide-specific keyboard sequences"`

	// if set, the current available set of key maps is saved to your preferences directory, and automatically loaded at startup -- this should be set if you are using custom key maps, but it may be safer to keep it <i>OFF</i> if you are <i>not</i> using custom key maps, so that you'll always have the latest compiled-in standard key maps with all the current key functions bound to standard key chords
	SaveKeyMaps bool `` /* 403-byte string literal not displayed */

	// if set, the current customized set of language options (see Edit Lang Opts) is saved / loaded along with other preferences -- if not set, then you always are using the default compiled-in standard set (which will be updated)
	SaveLangOpts bool `` /* 231-byte string literal not displayed */

	// if set, the current customized set of command parameters (see Edit Cmds) is saved / loaded along with other preferences -- if not set, then you always are using the default compiled-in standard set (which will be updated)
	SaveCmds bool `` /* 228-byte string literal not displayed */

	// [view: -] flag that is set by StructView by virtue of changeflag tag, whenever an edit is made.  Used to drive save menus etc.
	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) ApplyEnvVars added in v1.0.14

func (pf *Preferences) ApplyEnvVars()

ApplyEnvVars applies environment variables set in EnvVars

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

	// file view preferences
	Files FilePrefs `desc:"file view preferences"`

	// [view: inline] editor preferences
	Editor gi.EditorPrefs `view:"inline" desc:"editor preferences"`

	// current named-split config in use for configuring the splitters
	SplitName SplitName `desc:"current named-split config in use for configuring the splitters"`

	// the language associated with the most frequently-encountered file extension in the file tree -- can be manually set here as well
	MainLang filecat.Supported `` /* 135-byte string literal not displayed */

	// the type of version control system used in this project (git, svn, etc) -- filters commands available
	VersCtrl giv.VersCtrlName `desc:"the type of version control system used in this project (git, svn, etc) -- filters commands available"`

	// current project filename for saving / loading specific Gide configuration information in a .gide file (optional)
	ProjFilename gi.FileName `` /* 131-byte string literal not displayed */

	// root directory for the project -- all projects must be organized within a top-level root directory, with all the files therein constituting the scope of the project -- by default it is the path for ProjFilename
	ProjRoot gi.FileName `` /* 217-byte string literal not displayed */

	// if true, use Go modules, otherwise use GOPATH -- this sets your effective GO111MODULE environment variable accordingly, dynamically -- updated by toolbar checkbox, dynamically
	GoMod bool `` /* 182-byte string literal not displayed */

	// command(s) to run for main Build button
	BuildCmds CmdNames `desc:"command(s) to run for main Build button"`

	// build directory for main Build button -- set this to the directory where you want to build the main target for this project -- avail as {BuildDir} in commands
	BuildDir gi.FileName `` /* 165-byte string literal not displayed */

	// build target for main Build button, if relevant for your  BuildCmds
	BuildTarg gi.FileName `desc:"build target for main Build button, if relevant for your  BuildCmds"`

	// executable to run for this project via main Run button -- called by standard Run Proj command
	RunExec gi.FileName `desc:"executable to run for this project via main Run button -- called by standard Run Proj command"`

	// command(s) to run for main Run button (typically Run Proj)
	RunCmds CmdNames `desc:"command(s) to run for main Run button (typically Run Proj)"`

	// custom debugger parameters for this project
	Debug gidebug.Params `desc:"custom debugger parameters for this project"`

	// [view: -] saved find params
	Find FindParams `view:"-" desc:"saved find params"`

	// [view: -] saved structure params
	Symbols SymbolsParams `view:"-" desc:"saved structure params"`

	// [view: -] directory properties
	Dirs giv.DirFlagMap `view:"-" desc:"directory properties"`

	// [view: -] last register used
	Register RegisterName `view:"-" desc:"last register used"`

	// [view: -] current splitter splits
	Splits []float32 `view:"-" desc:"current splitter splits"`

	// [view: -] flag that is set by StructView by virtue of changeflag tag, whenever an edit is made.  Used to drive save menus etc.
	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) RunExecIsExec added in v0.9.11

func (pf *ProjPrefs) RunExecIsExec() bool

RunExecIsExec returns true if the RunExec is actually executable

func (*ProjPrefs) SaveJSON

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

SaveJSON save to JSON file

func (*ProjPrefs) Update added in v0.9.11

func (pf *ProjPrefs) Update()

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 SpellView

type SpellView struct {
	gi.Layout

	// parent gide project
	Gide Gide `json:"-" xml:"-" copy:"-" desc:"parent gide project"`

	// textview that we're spell-checking
	Text *TextView `json:"-" xml:"-" copy:"-" desc:"textview that we're spell-checking"`

	// current spelling errors
	Errs lex.Line `desc:"current spelling errors"`

	// current line in text we're on
	CurLn int `desc:"current line in text we're on"`

	// current index in Errs we're on
	CurIdx int `desc:"current index in Errs we're on"`

	// current unknown lex token
	UnkLex lex.Lex `desc:"current unknown lex token"`

	// current unknown word
	UnkWord string `desc:"current unknown word"`

	// a list of suggestions from spell checker
	Suggest []string `desc:"a list of suggestions from spell checker"`

	// last user action (ignore, change, learn)
	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) 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) CheckNext

func (sv *SpellView) CheckNext()

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

func (*SpellView) Config added in v0.5.8

func (sv *SpellView) Config(ge Gide, atv *TextView)

Config configures the view

func (*SpellView) ConfigToolbar

func (sv *SpellView) ConfigToolbar()

ConfigToolbar adds toolbar.

func (*SpellView) Destroy added in v0.9.14

func (sv *SpellView) Destroy()

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

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

SuggestView returns the view for the list of suggestions

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) UnkEndPos added in v0.9.14

func (sv *SpellView) UnkEndPos() lex.Pos

UnkEndPos returns the end position of the current unknown word

func (*SpellView) UnkStartPos added in v0.9.14

func (sv *SpellView) UnkStartPos() lex.Pos

UnkStartPos returns the start position of the current unknown word

func (*SpellView) UnknownBar

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

UnknownBar returns the toolbar that displays the unknown word

func (*SpellView) UnknownText

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

UnknownText returns the unknown word textfield from toolbar

type Split

type Split struct {

	// name of splitter config
	Name string `desc:"name of splitter config"`

	// brief description
	Desc string `desc:"brief description"`

	// [min: 0] [max: 1] [step: .05] splitter panel proportions
	Splits []float32 `min:"0" max:"1" step:".05" fixed-len:"4" 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) FixLen added in v1.0.0

func (lt *Splits) FixLen()

FixLen ensures that there are exactly 4 splits in each

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 StackView added in v0.9.11

type StackView struct {
	gi.Layout

	// if true, this is a find frames, not a regular stack
	FindFrames bool `desc:"if true, this is a find frames, not a regular stack"`
}

StackView is a view of the stack trace

func (*StackView) Config added in v0.9.11

func (sv *StackView) Config(dv *DebugView, findFrames bool)

func (*StackView) DebugVw added in v0.9.11

func (sv *StackView) DebugVw() *DebugView

func (*StackView) ShowStack added in v0.9.11

func (sv *StackView) ShowStack()

ShowStack triggers update of view of State.Stack

func (*StackView) TableView added in v0.9.11

func (sv *StackView) TableView() *giv.TableView

TableView returns the tableview

type SymNode added in v0.5.6

type SymNode struct {
	ki.Node

	// the symbol
	Symbol syms.Symbol `desc:"the symbol"`
}

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

func (*SymNode) OpenSyms added in v0.9.15

func (sn *SymNode) OpenSyms(pkg *syms.Symbol, fname, match string)

OpenSyms opens symbols from given symbol map (assumed to be package-level symbols) filtered by filename and match -- called on root node of tree.

type SymTreeView added in v0.9.15

type SymTreeView struct {
	giv.TreeView
}

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

func (*SymTreeView) Style2D added in v0.9.15

func (st *SymTreeView) Style2D()

func (*SymTreeView) SymNode added in v0.9.15

func (st *SymTreeView) SymNode() *SymNode

SymNode returns the SrcNode as a *gide* SymNode

type SymbolsParams added in v0.5.6

type SymbolsParams struct {

	// scope of symbols to list
	Scope SymbolsViewScope `desc:"scope of symbols to list"`
}

SymbolsParams are parameters for structure view of file or package

type SymbolsView added in v0.5.6

type SymbolsView struct {
	gi.Layout

	// parent gide project
	Gide Gide `json:"-" xml:"-" desc:"parent gide project"`

	// params for structure display
	SymParams SymbolsParams `desc:"params for structure display"`

	// all the symbols for the file or package in a tree
	Syms *SymNode `desc:"all the symbols for the file or package in a tree"`

	// only show symbols that match this string
	Match string `desc:"only show symbols that match this string"`
}

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

func (*SymbolsView) Config added in v0.5.8

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

Config configures the view

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

ConfigTree adds a treeview to the symbolsview

func (*SymbolsView) Frame added in v0.9.15

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

ToolBar returns the spell toolbar

func (*SymbolsView) OpenFile added in v0.9.15

func (sv *SymbolsView) OpenFile()

OpenFile opens file-level symbols for current active textview

func (*SymbolsView) OpenPackage added in v0.9.15

func (sv *SymbolsView) OpenPackage()

OpenPackage opens package-level symbols for current active textview

func (*SymbolsView) Params added in v0.5.7

func (sv *SymbolsView) Params() *SymbolsParams

Params returns the symbols params

func (*SymbolsView) RefreshAction added in v0.9.14

func (sv *SymbolsView) RefreshAction()

RefreshAction loads symbols for current file and scope

func (*SymbolsView) ScopeCombo added in v0.5.7

func (sv *SymbolsView) ScopeCombo() *gi.ComboBox

ScopeCombo returns the scope ComboBox

func (*SymbolsView) SearchText added in v0.5.7

func (sv *SymbolsView) SearchText() *gi.TextField

SearchText returns the unknown word textfield from toolbar

func (*SymbolsView) SelectSymbol added in v0.5.6

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

func (*SymbolsView) ToolBar added in v0.9.15

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

ToolBar returns the symbols toolbar

type SymbolsViewScope added in v0.5.7

type SymbolsViewScope int

SymScope corresponds to the search scope

const (
	// SymScopePackage scopes list of symbols to the package of the active file
	SymScopePackage SymbolsViewScope = iota

	// SymScopeFile restricts the list of symbols to the active file
	SymScopeFile

	// SymScopeN is the number of symbol scopes
	SymScopeN
)

func (*SymbolsViewScope) FromString added in v0.5.7

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

func (SymbolsViewScope) MarshalJSON added in v0.5.7

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

func (SymbolsViewScope) String added in v0.5.7

func (i SymbolsViewScope) String() string

func (*SymbolsViewScope) UnmarshalJSON added in v0.5.7

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

type TaskView added in v0.9.11

type TaskView struct {
	gi.Layout
}

TaskView is a view of the threads

func (*TaskView) Config added in v0.9.11

func (sv *TaskView) Config(dv *DebugView)

func (*TaskView) DebugVw added in v0.9.11

func (sv *TaskView) DebugVw() *DebugView

func (*TaskView) ShowTasks added in v0.9.11

func (sv *TaskView) ShowTasks()

ShowTasks triggers update of view of State.Tasks

func (*TaskView) TableView added in v0.9.11

func (sv *TaskView) TableView() *giv.TableView

TableView returns the tableview

type TextView added in v0.5.7

type TextView struct {
	giv.TextView
}

TextView is the Gide-specific version of the TextView, with support for setting / clearing breakpoints, etc

func AddNewTextView added in v0.9.15

func AddNewTextView(parent ki.Ki, name string) *TextView

AddNewTextView adds a new textview to given parent node, with given name.

func (*TextView) ClearBreakpoint added in v0.9.11

func (tv *TextView) ClearBreakpoint(ln int)

func (*TextView) ConnectEvents2D added in v0.9.11

func (tv *TextView) ConnectEvents2D()

ConnectEvents2D indirectly sets connections between mouse and key events and actions

func (*TextView) CurDebug added in v0.9.11

func (tv *TextView) CurDebug() (*DebugView, bool)

CurDebug returns the current debugger, true if it is present

func (*TextView) DebugVarValueAtPos added in v0.9.14

func (tv *TextView) DebugVarValueAtPos(pos image.Point) string

DebugVarValueAtPos returns debugger variable value for given mouse position

func (*TextView) DoubleClickEvent added in v0.9.14

func (tv *TextView) DoubleClickEvent(tpos lex.Pos)

DoubleClickEvent processes double-clicks NOT on the line-number section

func (*TextView) FindFrames added in v0.9.11

func (tv *TextView) FindFrames(ln int)

FindFrames finds stack frames in the debugger containing this file and line

func (*TextView) FocusChanged2D added in v0.9.11

func (tv *TextView) FocusChanged2D(change gi.FocusChanges)

func (*TextView) HasBreakpoint added in v0.9.11

func (tv *TextView) HasBreakpoint(ln int) bool

HasBreakpoint checks if line has a breakpoint

func (*TextView) HoverEvent added in v0.9.14

func (tv *TextView) HoverEvent()

func (*TextView) LineNoDoubleClick added in v0.9.14

func (tv *TextView) LineNoDoubleClick(tpos lex.Pos)

LineNoDoubleClick processes double-clicks on the line-number section

func (*TextView) MakeContextMenu added in v0.5.7

func (tv *TextView) MakeContextMenu(m *gi.Menu)

MakeContextMenu builds the textview context menu

func (*TextView) MouseEvent added in v0.9.11

func (tv *TextView) MouseEvent(me *mouse.Event)

MouseEvent handles the mouse.Event

func (*TextView) SetBreakpoint added in v0.9.11

func (tv *TextView) SetBreakpoint(ln int)

SetBreakpoint sets breakpoint at given line (e.g., tv.CursorPos.Ln)

func (*TextView) TextViewEvents added in v0.9.11

func (tv *TextView) TextViewEvents()

TextViewEvents sets connections between mouse and key events and actions

func (*TextView) ToggleBreakpoint added in v0.9.11

func (tv *TextView) ToggleBreakpoint(ln int)

type ThreadView added in v0.9.11

type ThreadView struct {
	gi.Layout
}

ThreadView is a view of the threads

func (*ThreadView) Config added in v0.9.11

func (sv *ThreadView) Config(dv *DebugView)

func (*ThreadView) DebugVw added in v0.9.11

func (sv *ThreadView) DebugVw() *DebugView

func (*ThreadView) ShowThreads added in v0.9.11

func (sv *ThreadView) ShowThreads()

ShowThreads triggers update of view of State.Threads

func (*ThreadView) TableView added in v0.9.11

func (sv *ThreadView) TableView() *giv.TableView

TableView returns the tableview

type VarView added in v0.9.11

type VarView struct {
	gi.Frame

	// variable being edited
	Var *gidebug.Variable `desc:"variable being edited"`

	// frame info
	FrameInfo string `desc:"frame info"`

	// parent DebugView
	DbgView *DebugView `json:"-" xml:"-" desc:"parent DebugView"`
}

VarView represents a struct, creating a property editor of the fields -- constructs Children widgets to show the field names and editor fields for each field, within an overall frame with an optional title, and a button box at the bottom where methods can be invoked

func AddNewVarView added in v0.9.11

func AddNewVarView(parent ki.Ki, name string) *VarView

AddNewVarView adds a new gieditor to given parent node, with given name.

func VarViewDialog added in v0.9.11

func VarViewDialog(vr *gidebug.Variable, frinfo string, dbgVw *DebugView) *VarView

VarViewDialog opens an interactive editor of the given Ki tree, at its root, returns VarView and window

func (*VarView) Config added in v0.9.11

func (vv *VarView) Config()

Config configures the widget

func (*VarView) ConfigSplitView added in v0.9.11

func (vv *VarView) ConfigSplitView()

ConfigSplitView configures the SplitView.

func (*VarView) SetFrameInfo added in v0.9.11

func (vv *VarView) SetFrameInfo(finfo string)

SetFrameInfo sets the frame info

func (*VarView) SetVar added in v0.9.11

func (vv *VarView) SetVar(vr *gidebug.Variable, frinfo string)

SetVar sets the source variable and ensures configuration

func (*VarView) SplitView added in v0.9.11

func (vv *VarView) SplitView() *gi.SplitView

SplitView returns the main SplitView

func (*VarView) StructView added in v0.9.11

func (vv *VarView) StructView() *giv.StructView

StructView returns the main StructView

func (*VarView) TreeView added in v0.9.11

func (vv *VarView) TreeView() *giv.TreeView

TreeView returns the main TreeView

type VarsView added in v0.9.11

type VarsView struct {
	gi.Layout

	// if true, this is global vars, not local ones
	GlobalVars bool `desc:"if true, this is global vars, not local ones"`
}

VarsView is a view of the variables

func (*VarsView) Config added in v0.9.11

func (sv *VarsView) Config(dv *DebugView, globalVars bool)

func (*VarsView) DebugVw added in v0.9.11

func (sv *VarsView) DebugVw() *DebugView

func (*VarsView) ShowVars added in v0.9.11

func (sv *VarsView) ShowVars()

ShowVars triggers update of view of State.Vars

func (*VarsView) TableView added in v0.9.11

func (sv *VarsView) TableView() *giv.TableView

TableView returns the tableview

Jump to

Keyboard shortcuts

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