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
- Variables
- func ArgVarKeys() []string
- func ArgVarPrompts(arg string) (map[string]struct{}, bool)
- func CmdsView(pt *Commands)
- func CommandName(cat, cmd string) string
- func CompleteArg(data any, text string, posLn, posCh int) (md complete.Matches)
- func CompleteArgEdit(data any, text string, cursorPos int, c complete.Completion, seed string) (ed complete.Edit)
- func ConfigOutputTextView(ly *gi.Layout) *giv.TextView
- func FileTreeViewExecCmds(it any, vp *gi.Viewport2D) [][]string
- func InitPrefs()
- func KeyMapsView(km *KeyMaps)
- func LangsView(pt *Langs)
- func MarkupCmdOutput(out []byte) []byte
- func MarkupStderr(out []byte) []byte
- func MarkupStdout(out []byte) []byte
- func MergeAvailCmds()
- func NewDebugger(sup filecat.Supported, path, rootPath string, outbuf *giv.TextBuf, ...) (gidebug.GiDebug, error)
- func OpenIcons() error
- func OpenPaths()
- func PrefsView(pf *Preferences) *gi.Window
- func ProjPrefsView(pf *ProjPrefs) (*giv.StructView, *gi.Window)
- func RegistersView(pt *Registers)
- func RepoCurBranches(repo vci.Repo) (string, []string, error)
- func SavePaths()
- func SetActiveKeyMap(km *KeySeqMap, kmName KeyMapName)
- func SetActiveKeyMapName(mapnm KeyMapName)
- func SetGoMod(gomod bool)
- func SplitsView(pt *Splits)
- type ArgVarInfo
- type ArgVarTypes
- type ArgVarVals
- type BreakView
- type CmdAndArgs
- type CmdArgs
- type CmdName
- type CmdNames
- type CmdRun
- type CmdRuns
- func (rc *CmdRuns) Add(cm *CmdRun)
- func (rc *CmdRuns) AddCmd(name, cmdstr string, cmdargs *CmdAndArgs, ex *exec.Cmd)
- func (rc *CmdRuns) ByName(name string) (*CmdRun, int)
- func (rc *CmdRuns) DeleteByName(name string) bool
- func (rc *CmdRuns) DeleteIdx(idx int)
- func (rc *CmdRuns) KillByName(name string) bool
- type CmdValueView
- type Command
- func (cm *Command) AppendCmdOut(ge Gide, buf *giv.TextBuf, out []byte)
- func (cm *Command) HasPrompts() (map[string]struct{}, bool)
- func (cm Command) Label() string
- func (cm *Command) LangMatch(lang filecat.Supported) bool
- func (cm *Command) PromptUser(ge Gide, buf *giv.TextBuf, pvals map[string]struct{})
- func (cm *Command) Run(ge Gide, buf *giv.TextBuf)
- func (cm *Command) RunAfterPrompts(ge Gide, buf *giv.TextBuf)
- func (cm *Command) RunBuf(ge Gide, buf *giv.TextBuf, cma *CmdAndArgs) bool
- func (cm *Command) RunBufWait(ge Gide, buf *giv.TextBuf, cma *CmdAndArgs) bool
- func (cm *Command) RunNoBuf(ge Gide, cma *CmdAndArgs) bool
- func (cm *Command) RunStatus(ge Gide, buf *giv.TextBuf, cmdstr string, err error, out []byte) bool
- func (cmd *Command) SetCompleter(tf *gi.TextField, id string)
- type Commands
- func (cm *Commands) CmdByName(name CmdName, msg bool) (*Command, int, bool)
- func (cm *Commands) CopyFrom(cp Commands)
- func (cm *Commands) FilterCmdNames(lang filecat.Supported, vcnm giv.VersCtrlName) [][]string
- func (cm *Commands) OpenJSON(filename gi.FileName) error
- func (cm *Commands) OpenPrefs() error
- func (cm *Commands) SaveJSON(filename gi.FileName) error
- func (cm *Commands) SavePrefs() error
- func (cm *Commands) ViewStd()
- type Console
- type DebugBreakStatus
- type DebugView
- func (dv *DebugView) ActionActivate(act *gi.Action)
- func (dv *DebugView) AddBreak(fpath string, line int)
- func (dv DebugView) AllVarVw() *VarsView
- func (dv *DebugView) BackupBreaks()
- func (dv DebugView) BreakVw() *BreakView
- func (dv *DebugView) Config(ge Gide, sup filecat.Supported, exePath string)
- func (dv *DebugView) ConfigTabs()
- func (dv *DebugView) ConfigToolBar()
- func (dv DebugView) ConsoleText() *giv.TextView
- func (dv *DebugView) Continue()
- func (dv *DebugView) DbgCanStep() bool
- func (dv *DebugView) DbgIsActive() bool
- func (dv *DebugView) DbgIsAvail() bool
- func (dv *DebugView) DeleteAllBreaks()
- func (dv *DebugView) DeleteBreak(fpath string, line int)
- func (dv *DebugView) DeleteBreakIdx(bidx int)
- func (dv *DebugView) DeleteBreakImpl(fpath string, line int)
- func (dv *DebugView) DeleteBreakInBuf(fpath string, line int)
- func (dv *DebugView) DeleteCurPCInBuf()
- func (dv *DebugView) Destroy()
- func (dv *DebugView) Detach()
- func (dv *DebugView) FindFrames(fpath string, line int)
- func (dv DebugView) FindFramesVw() *StackView
- func (dv *DebugView) InitState(ds *gidebug.State)
- func (dv *DebugView) ListGlobalVars(filter string)
- func (dv *DebugView) SetBreaks()
- func (dv *DebugView) SetCurPCInBuf(fpath string, line int)
- func (dv *DebugView) SetFrame(depth int)
- func (dv *DebugView) SetStatus(stat gidebug.Status)
- func (dv *DebugView) SetThread(threadID int)
- func (dv *DebugView) SetThreadIdx(thridx int)
- func (dv *DebugView) ShowBreakFile(bidx int)
- func (dv *DebugView) ShowBreaks(selTab bool)
- func (dv *DebugView) ShowFile(fpath string, line int)
- func (dv *DebugView) ShowFindFrames(selTab bool)
- func (dv *DebugView) ShowGlobalVars(selTab bool)
- func (dv *DebugView) ShowStack(selTab bool)
- func (dv *DebugView) ShowTasks(selTab bool)
- func (dv *DebugView) ShowThreads(selTab bool)
- func (dv *DebugView) ShowVar(name string) error
- func (dv *DebugView) ShowVars(selTab bool)
- func (dv *DebugView) SingleStep()
- func (dv DebugView) StackVw() *StackView
- func (dv *DebugView) Start()
- func (dv *DebugView) StepInto()
- func (dv *DebugView) StepOut()
- func (dv *DebugView) StepOver()
- func (dv *DebugView) Stop()
- func (dv *DebugView) Tabs() *gi.TabView
- func (dv DebugView) TaskVw() *TaskView
- func (dv DebugView) ThreadVw() *ThreadView
- func (dv *DebugView) ToolBar() *gi.ToolBar
- func (dv *DebugView) UpdateAllBreaks()
- func (dv *DebugView) UpdateBreakInBuf(fpath string, line int, stat DebugBreakStatus)
- func (dv *DebugView) UpdateFmState()
- func (dv *DebugView) UpdateToolBar()
- func (dv *DebugView) UpdateView()
- func (dv *DebugView) VarValue(varNm string) string
- func (dv DebugView) VarVw() *VarsView
- type FileNode
- type FilePrefs
- type FileSearchResults
- type FileTreeView
- type FindLoc
- type FindParams
- type FindView
- func (fv *FindView) CheckValidRegexp() bool
- func (fv *FindView) CompileRegexp() bool
- func (fv *FindView) Config(ge Gide)
- func (fv *FindView) ConfigToolbar()
- func (fv *FindView) FindAction()
- func (fv *FindView) FindBar() *gi.ToolBar
- func (fv *FindView) FindNextAct() *gi.Action
- func (fv *FindView) FindText() *gi.ComboBox
- func (fv *FindView) HighlightFinds(tv, ftv *giv.TextView, fbStLn, fCount int, find string)
- func (fv *FindView) IgnoreBox() *gi.CheckBox
- func (fv *FindView) LocCombo() *gi.ComboBox
- func (fv *FindView) NextFind()
- func (fv *FindView) OpenFindURL(ur string, ftv *giv.TextView) bool
- func (fv *FindView) Params() *FindParams
- func (fv *FindView) PrevFind()
- func (fv *FindView) RegexpBox() *gi.CheckBox
- func (fv *FindView) ReplBar() *gi.ToolBar
- func (fv *FindView) ReplText() *gi.ComboBox
- func (fv *FindView) ReplaceAction() bool
- func (fv *FindView) ReplaceAll()
- func (fv *FindView) ReplaceAllAction()
- func (fv *FindView) SaveFindString(find string)
- func (fv *FindView) SaveReplString(repl string)
- func (fv *FindView) ShowResults(res []FileSearchResults)
- func (fv *FindView) TextView() *giv.TextView
- func (fv *FindView) TextViewLay() *gi.Layout
- type Gide
- type KeyFuns
- type KeyMapItem
- type KeyMapName
- type KeyMapValueView
- type KeyMaps
- func (km *KeyMaps) CopyFrom(cp KeyMaps)
- func (km *KeyMaps) MapByName(name KeyMapName) (*KeySeqMap, int, bool)
- func (km *KeyMaps) OpenJSON(filename gi.FileName) error
- func (km *KeyMaps) OpenPrefs() error
- func (km *KeyMaps) RevertToStd()
- func (km *KeyMaps) SaveJSON(filename gi.FileName) error
- func (km *KeyMaps) SavePrefs() error
- func (km *KeyMaps) ViewStd()
- type KeyMapsItem
- type KeySeq
- type KeySeqMap
- type LangOpts
- type Langs
- func (lt *Langs) CopyFrom(cp Langs)
- func (lt *Langs) OpenJSON(filename gi.FileName) error
- func (lt *Langs) OpenPrefs() error
- func (lt *Langs) RevertToStd()
- func (lt *Langs) SaveJSON(filename gi.FileName) error
- func (lt *Langs) SavePrefs() error
- func (lt Langs) Validate() bool
- func (lt *Langs) ViewStd()
- type OpenNodes
- func (on *OpenNodes) Add(fn *giv.FileNode) bool
- func (on *OpenNodes) AddImpl(fn *giv.FileNode) bool
- func (on *OpenNodes) ByStringName(name string) *giv.FileNode
- func (on *OpenNodes) Delete(fn *giv.FileNode) bool
- func (on *OpenNodes) DeleteDeleted()
- func (on *OpenNodes) DeleteIdx(idx int)
- func (on *OpenNodes) NChanged() int
- func (on *OpenNodes) Strings() []string
- type Preferences
- func (pf *Preferences) Apply()
- func (pf *Preferences) ApplyEnvVars()
- func (pf *Preferences) Defaults()
- func (pf *Preferences) EditCmds()
- func (pf *Preferences) EditKeyMaps()
- func (pf *Preferences) EditLangOpts()
- func (pf *Preferences) EditRegisters()
- func (pf *Preferences) EditSplits()
- func (pf *Preferences) Open() error
- func (pf *Preferences) Save() error
- func (pf *Preferences) VersionInfo() string
- type ProjPrefs
- type RegisterName
- type RegisterValueView
- type Registers
- type SpellView
- func (sv *SpellView) AcceptSuggestion(s string)
- func (sv *SpellView) ChangeAct() *gi.Action
- func (sv *SpellView) ChangeAction()
- func (sv *SpellView) ChangeAllAct() *gi.Action
- func (sv *SpellView) ChangeAllAction()
- func (sv *SpellView) ChangeBar() *gi.ToolBar
- func (sv *SpellView) ChangeText() *gi.TextField
- func (sv *SpellView) CheckNext()
- func (sv *SpellView) Config(ge Gide, atv *TextView)
- func (sv *SpellView) ConfigToolbar()
- func (sv *SpellView) Destroy()
- func (sv *SpellView) IgnoreAct() *gi.Action
- func (sv *SpellView) IgnoreAction()
- func (sv *SpellView) LearnAct() *gi.Action
- func (sv *SpellView) LearnAction()
- func (sv *SpellView) SkipAct() *gi.Action
- func (sv *SpellView) SkipAction()
- func (sv *SpellView) SpellAction()
- func (sv *SpellView) SpellBar() *gi.ToolBar
- func (sv *SpellView) SuggestView() *giv.SliceView
- func (sv *SpellView) TrainAction()
- func (sv *SpellView) UnkEndPos() lex.Pos
- func (sv *SpellView) UnkStartPos() lex.Pos
- func (sv *SpellView) UnknownBar() *gi.ToolBar
- func (sv *SpellView) UnknownText() *gi.TextField
- type Split
- type SplitName
- type SplitValueView
- type Splits
- func (lt *Splits) Add(name, desc string, splits []float32) (*Split, int)
- func (lt *Splits) CopyFrom(cp Splits)
- func (lt *Splits) FixLen()
- func (lt *Splits) Names() []string
- func (lt *Splits) OpenJSON(filename gi.FileName) error
- func (lt *Splits) OpenPrefs() error
- func (lt *Splits) SaveJSON(filename gi.FileName) error
- func (lt *Splits) SavePrefs() error
- func (lt *Splits) SplitByName(name SplitName) (*Split, int, bool)
- type StackView
- type SymNode
- type SymTreeView
- type SymbolsParams
- type SymbolsView
- func (sv *SymbolsView) Config(ge Gide, sp SymbolsParams)
- func (sv *SymbolsView) ConfigToolbar()
- func (sv *SymbolsView) ConfigTree(scope SymbolsViewScope)
- func (sv *SymbolsView) Frame() *gi.Frame
- func (sv *SymbolsView) OpenFile()
- func (sv *SymbolsView) OpenPackage()
- func (sv *SymbolsView) Params() *SymbolsParams
- func (sv *SymbolsView) RefreshAction()
- func (sv *SymbolsView) ScopeCombo() *gi.ComboBox
- func (sv *SymbolsView) SearchText() *gi.TextField
- func (sv *SymbolsView) SelectSymbol(ssym syms.Symbol)
- func (sv *SymbolsView) ToolBar() *gi.ToolBar
- type SymbolsViewScope
- type TaskView
- type TextView
- func (tv *TextView) ClearBreakpoint(ln int)
- func (tv *TextView) ConnectEvents2D()
- func (tv *TextView) CurDebug() (*DebugView, bool)
- func (tv *TextView) DebugVarValueAtPos(pos image.Point) string
- func (tv *TextView) DoubleClickEvent(tpos lex.Pos)
- func (tv *TextView) FindFrames(ln int)
- func (tv *TextView) FocusChanged2D(change gi.FocusChanges)
- func (tv *TextView) HasBreakpoint(ln int) bool
- func (tv *TextView) HoverEvent()
- func (tv *TextView) LineNoDoubleClick(tpos lex.Pos)
- func (tv *TextView) MakeContextMenu(m *gi.Menu)
- func (tv *TextView) MouseEvent(me *mouse.Event)
- func (tv *TextView) SetBreakpoint(ln int)
- func (tv *TextView) TextViewEvents()
- func (tv *TextView) ToggleBreakpoint(ln int)
- type ThreadView
- type VarView
- func (vv *VarView) Config()
- func (vv *VarView) ConfigSplitView()
- func (vv *VarView) SetFrameInfo(finfo string)
- func (vv *VarView) SetVar(vr *gidebug.Variable, frinfo string)
- func (vv *VarView) SplitView() *gi.SplitView
- func (vv *VarView) StructView() *giv.StructView
- func (vv *VarView) TreeView() *giv.TreeView
- type VarsView
Constants ¶
const ( CmdWait = true CmdNoWait = false CmdFocus = true CmdNoFocus = false CmdConfirm = true CmdNoConfirm = false )
Use these for more obvious command options
const ( Version = "v1.1.11" GitCommit = "f05416c" // the commit JUST BEFORE the release VersionDate = "2023-08-27 22:37" // UTC )
Variables ¶
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
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..
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..
var AvailRegisterNames []string
AvailRegisterNames are the names of the current AvailRegisters -- used for some choosers
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..
var AvailSplitNames []string
AvailSplitNames are the names of the current AvailSplits -- used for some choosers
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..
var BreakViewProps = ki.Props{ "EnumType:Flag": gi.KiT_NodeFlags, "max-width": -1, "max-height": -1, }
BreakViewProps are style properties for DebugView
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.
var CmdOutStatusLen = 80
CmdOutStatusLen is amount of command output to include in the status update
var CmdPrompt1Vals = map[string]string{}
CmdPrompt1Vals holds last values for PromptString1 per command, so that each such command has its own appropriate history
var CmdPrompt2Vals = map[string]string{}
CmdPrompt2Vals holds last values for PromptString2 per command, so that each such command has its own appropriate history
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.
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
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.
var CustomCmdsChanged = false
CustomCmdsChanged is used to update giv.CmdsView toolbars via following menu, toolbar props update methods.
var DebugBreakColors = [DebugBreakStatusN]string{"pink", "red", "orange", "lightblue"}
DebugBreakColors are the colors indicating different breakpoint statuses
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", }
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
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
var DefaultKeyMap = KeyMapName("MacEmacs")
DefaultKeyMap is the overall default keymap -- reinitialized in gimain init() depending on platform
var FileNodeProps map[string]any
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
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
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
var FileTreeViewProps map[string]any
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
var GideType = reflect.TypeOf((*Gide)(nil)).Elem()
GideType is a Gide reflect.Type, suitable for checking for Type.Implements.
var GideViewEditRecents = "<i>Edit Recents...</i>"
GideViewEditRecents defines a string that is added as an item to the recents menu
var GideViewResetRecents = "<i>Reset Recents</i>"
GideViewResetRecents defines a string that is added as an item to the recents menu
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
var KiT_ArgVarTypes = kit.Enums.AddEnumAltLower(ArgVarTypesN, kit.NotBitFlag, nil, "ArgVar")
var KiT_BreakView = kit.Types.AddType(&BreakView{}, BreakViewProps)
var KiT_CmdValueView = kit.Types.AddType(&CmdValueView{}, nil)
var KiT_Commands = kit.Types.AddType(&Commands{}, CommandsProps)
var KiT_Console = kit.Types.AddType(&Console{}, nil)
var KiT_DebugView = kit.Types.AddType(&DebugView{}, DebugViewProps)
var KiT_FileNode = kit.Types.AddType(&FileNode{}, nil)
var KiT_FileTreeView = kit.Types.AddType(&FileTreeView{}, nil)
var KiT_FindLoc = kit.Enums.AddEnumAltLower(FindLocN, kit.NotBitFlag, nil, "FindLoc")
var KiT_FindView = kit.Types.AddType(&FindView{}, FindViewProps)
var KiT_KeyFuns = kit.Enums.AddEnumAltLower(KeyFunsN, kit.NotBitFlag, nil, "KeyFun")
KiT_KeyFuns adds a type to the EnumRegistry
var KiT_KeyMapValueView = kit.Types.AddType(&KeyMapValueView{}, nil)
var KiT_KeyMaps = kit.Types.AddType(&KeyMaps{}, KeyMapsProps)
KiT_KeyMaps registers KeyMaps as a type
var KiT_Langs = kit.Types.AddType(&Langs{}, LangsProps)
var KiT_Preferences = kit.Types.AddType(&Preferences{}, PreferencesProps)
var KiT_ProjPrefs = kit.Types.AddType(&ProjPrefs{}, ProjPrefsProps)
var KiT_RegisterValueView = kit.Types.AddType(&RegisterValueView{}, nil)
var KiT_Registers = kit.Types.AddType(&Registers{}, RegistersProps)
var KiT_SpellView = kit.Types.AddType(&SpellView{}, SpellViewProps)
var KiT_SplitValueView = kit.Types.AddType(&SplitValueView{}, nil)
var KiT_Splits = kit.Types.AddType(&Splits{}, SplitsProps)
var KiT_StackView = kit.Types.AddType(&StackView{}, StackViewProps)
var KiT_SymNode = kit.Types.AddType(&SymNode{}, ki.Props{"EnumType:Flag": ki.KiT_Flags})
var KiT_SymTreeView = kit.Types.AddType(&SymTreeView{}, nil)
var KiT_SymbolsView = kit.Types.AddType(&SymbolsView{}, SymbolsViewProps)
var KiT_TaskView = kit.Types.AddType(&TaskView{}, TaskViewProps)
var KiT_TextView = kit.Types.AddType(&TextView{}, giv.TextViewProps)
var KiT_ThreadView = kit.Types.AddType(&ThreadView{}, ThreadViewProps)
var KiT_VarView = kit.Types.AddType(&VarView{}, VarViewProps)
var KiT_VarsView = kit.Types.AddType(&VarsView{}, VarsViewProps)
var Kit_SymbolsViewScope = kit.Enums.AddEnumAltLower(SymScopeN, kit.NotBitFlag, nil, "SymScope")
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
var Needs2KeyMap gi.KeyMap
Needs2KeyMap is a map of the starting key sequences that require a second key -- auto-generated from active keymap
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
var Prefs = Preferences{}
Prefs are the overall Gide preferences
var PrefsCmdsFileName = "command_prefs.json"
PrefsCmdsFileName is the name of the preferences file in App prefs directory for saving / loading your CustomCmds commands list
var PrefsFileName = "gide_prefs.json"
PrefsFileName is the name of the preferences file in GoGi prefs directory
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
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
var PrefsRegistersFileName = "registers_prefs.json"
PrefsRegistersFileName is the name of the preferences file in App prefs directory for saving / loading the default AvailRegisters
var PrefsSplitsFileName = "splits_prefs.json"
PrefsSplitsFileName is the name of the preferences file in App prefs directory for saving / loading the default AvailSplits
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
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
var SavedPaths gi.FilePaths
SavedPaths is a slice of strings that are file paths
var SavedPathsExtras = []string{gi.MenuTextSeparator, GideViewResetRecents, GideViewEditRecents}
SavedPathsExtras are the reset and edit items we add to the recents menu
var SavedPathsFileName = "gide_saved_paths.json"
SavedPathsFileName is the name of the saved file paths file in GoGi prefs directory
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
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
var StackViewProps = ki.Props{ "EnumType:Flag": gi.KiT_NodeFlags, "max-width": -1, "max-height": -1, }
StackViewProps are style properties for DebugView
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.
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.
var StdLangs = Langs{ filecat.Go: {CmdNames{"Go: Imports File"}}, }
StdLangs is the original compiled-in set of standard language options.
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.
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{}, }
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
var TaskViewProps = ki.Props{ "EnumType:Flag": gi.KiT_NodeFlags, "max-width": -1, "max-height": -1, }
TaskViewProps are style properties for DebugView
var ThreadViewProps = ki.Props{ "EnumType:Flag": gi.KiT_NodeFlags, "max-width": -1, "max-height": -1, }
ThreadViewProps are style properties for DebugView
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, }
var VarsViewProps = ki.Props{ "EnumType:Flag": gi.KiT_NodeFlags, "max-width": -1, "max-height": -1, }
VarsViewProps are style properties for DebugView
Functions ¶
func ArgVarPrompts ¶
ArgVarPrompts returns any Prompt* variables required by this string, false if none
func CommandName ¶ added in v1.1.7
CommandName returns a qualified command name as cat: cmd
func CompleteArg ¶
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
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 MarkupCmdOutput ¶
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 MarkupStdout ¶ added in v0.5.4
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 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
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 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
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 ¶
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
type BreakView ¶ added in v0.9.11
BreakView is a view of the breakpoints
func (*BreakView) ShowBreaks ¶ added in v0.9.11
func (sv *BreakView) ShowBreaks()
ShowBreaks triggers update of view of State.Breaks
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) 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 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 ¶
Command returns command associated with command name in AvailCmds, and false if it doesn't exist
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
type CmdRuns ¶
type CmdRuns []*CmdRun
CmdRuns is a slice list of running commands
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) DeleteByName ¶
DeleteByName deletes command by name
func (*CmdRuns) KillByName ¶
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 ¶
AppendCmdOut appends command output to buffer, applying markup for links
func (*Command) HasPrompts ¶
HasPrompts returns true if any prompts are required before running command, and the set of such args
func (*Command) LangMatch ¶
LangMatch returns true if the given language matches the command Lang constraints
func (*Command) PromptUser ¶
PromptUser prompts for values that need prompting for, and then runs RunAfterPrompts if not otherwise cancelled by user
func (*Command) Run ¶
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 ¶
RunAfterPrompts runs after any prompts have been set, if needed
func (*Command) RunBuf ¶
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 ¶
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
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 ¶
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) FilterCmdNames ¶
FilterCmdNames returns a slice of commands organized by category that are compatible with given language and version control system.
func (*Commands) OpenPrefs ¶
OpenPrefs opens custom Commands from App standard prefs directory, using PrefsCmdsFileName
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 ¶
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
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
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) BackupBreaks ¶ added in v0.9.14
func (dv *DebugView) BackupBreaks()
BackupBreaks makes a backup copy of current breaks
func (*DebugView) Config ¶ added in v0.9.11
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
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
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
DbgIsActive means debugger is started.
func (*DebugView) DbgIsAvail ¶ added in v0.9.11
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
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
DeleteBreakIdx deletes break at given index in list of breaks
func (*DebugView) DeleteBreakImpl ¶ added in v0.9.14
DeleteBreakImpl deletes given breakpoint with no other updates
func (*DebugView) DeleteBreakInBuf ¶ added in v0.9.14
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) FindFrames ¶ added in v0.9.11
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
FindFramesVw returns the find frames view from tabs
func (*DebugView) InitState ¶ added in v0.9.11
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
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
SetCurPCInBuf sets the current PC location in given file line is 1-based line number
func (*DebugView) SetThread ¶ added in v0.9.11
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
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
ShowBreakFile shows the file for given break index
func (*DebugView) ShowBreaks ¶ added in v0.9.11
ShowBreaks shows the current breaks
func (*DebugView) ShowFindFrames ¶ added in v0.9.11
ShowFindFrames shows the current find frames
func (*DebugView) ShowGlobalVars ¶ added in v0.9.11
ShowGlobalVars shows the current allvars
func (*DebugView) ShowThreads ¶ added in v0.9.11
ShowThreads shows the current threads
func (*DebugView) ShowVar ¶ added in v0.9.11
ShowVar shows info on a given variable within the current frame scope in a text view dialog
func (*DebugView) SingleStep ¶ added in v0.9.11
func (dv *DebugView) SingleStep()
StepSingle steps a single cpu instruction.
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) ThreadVw ¶ added in v0.9.11
func (dv DebugView) ThreadVw() *ThreadView
ThreadVw returns the thread view from tabs
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
type FileNode ¶
FileNode is Gide version of FileNode for FileTree view
func (*FileNode) CopyFieldsFrom ¶ added in v0.9.11
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 ¶
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
type FileSearchResults ¶
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 (FindLoc) MarshalJSON ¶
func (*FindLoc) UnmarshalJSON ¶
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
CheckValidRegexp returns false if using regexp and it is not valid
func (*FindView) CompileRegexp ¶ added in v1.0.2
CompileRegexp compiles the regexp if necessary -- returns false if it is invalid
func (*FindView) FindAction ¶
func (fv *FindView) FindAction()
FindAction runs a new find with current params
func (*FindView) FindNextAct ¶
FindNextAct returns the find next action in toolbar -- selected first
func (*FindView) HighlightFinds ¶
HighlightFinds highlights all the find results in ftv buffer
func (*FindView) OpenFindURL ¶
OpenFindURL opens given find:/// url from Find
func (*FindView) ReplaceAction ¶
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 ¶
SaveFindString saves the given find string to the find params history and current str
func (*FindView) SaveReplString ¶
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) TextViewLay ¶
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.
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 ¶
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 (KeyFuns) MarshalJSON ¶
MarshalJSON saves the KeyFuns in JSON format
func (*KeyFuns) UnmarshalJSON ¶
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) 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) OpenPrefs ¶
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.
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 ¶
KeySeq defines a multiple-key sequence to initiate a key function
func ChordForFun ¶
ChordForFun returns first key sequence trigger for given KeyFun in ActiveKeyMap
func (KeySeq) MarshalText ¶
MarshalText is required for JSON encoding of struct keys
func (*KeySeq) UnmarshalText ¶
UnmarshalText is required for JSON decoding of struct keys
type KeySeqMap ¶
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 ¶
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 ¶
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) OpenPrefs ¶
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) SavePrefs ¶
SavePrefs saves Langs to App standard prefs directory, using PrefsLangsFileName
type OpenNodes ¶
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 ¶
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
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 ¶
ByStringName returns the open node with given strings name
func (*OpenNodes) Delete ¶
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
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) RunExecIsExec ¶ added in v0.9.11
RunExecIsExec returns true if the RunExec is actually executable
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 ¶
Registers is a list of named strings
var AvailRegisters Registers
AvailRegisters are available named registers. can be loaded / saved / edited with preferences.
func (*Registers) OpenPrefs ¶
OpenPrefs opens Registers from 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 ¶
AcceptSuggestion replaces the misspelled word with the word in the ChangeText field
func (*SpellView) ChangeAction ¶
func (sv *SpellView) ChangeAction()
ChangeAction replaces the known word with the selected suggested word and call CheckNextAction
func (*SpellView) ChangeAllAct ¶
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) ChangeText ¶
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) IgnoreAction ¶
func (sv *SpellView) IgnoreAction()
IgnoreAction will skip this and future instances of misspelled/unknown word and call CheckNextAction
func (*SpellView) LearnAction ¶
func (sv *SpellView) LearnAction()
LearnAction will add the current unknown word to corpus and call CheckNext
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) SuggestView ¶
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
UnkEndPos returns the end position of the current unknown word
func (*SpellView) UnkStartPos ¶ added in v0.9.14
UnkStartPos returns the start position of the current unknown word
func (*SpellView) UnknownBar ¶
UnknownBar returns the toolbar that displays the unknown word
func (*SpellView) UnknownText ¶
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) SaveSplits ¶
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
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) FixLen ¶ added in v1.0.0
func (lt *Splits) FixLen()
FixLen ensures that there are exactly 4 splits in each
func (*Splits) OpenPrefs ¶
OpenPrefs opens Splits from App standard prefs directory, using PrefSplitsFileName
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
type SymNode ¶ added in v0.5.6
SymNode represents a language symbol -- the name of the node is the name of the symbol. Some symbols, e.g. type have children
type SymTreeView ¶ added in v0.9.15
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
TaskView is a view of the threads
type TextView ¶ added in v0.5.7
TextView is the Gide-specific version of the TextView, with support for setting / clearing breakpoints, etc
func AddNewTextView ¶ added in v0.9.15
AddNewTextView adds a new textview to given parent node, with given name.
func (*TextView) ClearBreakpoint ¶ added in v0.9.11
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
CurDebug returns the current debugger, true if it is present
func (*TextView) DebugVarValueAtPos ¶ added in v0.9.14
DebugVarValueAtPos returns debugger variable value for given mouse position
func (*TextView) DoubleClickEvent ¶ added in v0.9.14
DoubleClickEvent processes double-clicks NOT on the line-number section
func (*TextView) FindFrames ¶ added in v0.9.11
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
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
LineNoDoubleClick processes double-clicks on the line-number section
func (*TextView) MakeContextMenu ¶ added in v0.5.7
MakeContextMenu builds the textview context menu
func (*TextView) MouseEvent ¶ added in v0.9.11
MouseEvent handles the mouse.Event
func (*TextView) SetBreakpoint ¶ added in v0.9.11
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
type ThreadView ¶ added in v0.9.11
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
AddNewVarView adds a new gieditor to given parent node, with given name.
func VarViewDialog ¶ added in v0.9.11
VarViewDialog opens an interactive editor of the given Ki tree, at its root, returns VarView and window
func (*VarView) ConfigSplitView ¶ added in v0.9.11
func (vv *VarView) ConfigSplitView()
ConfigSplitView configures the SplitView.
func (*VarView) SetFrameInfo ¶ added in v0.9.11
SetFrameInfo sets the frame info
func (*VarView) StructView ¶ added in v0.9.11
func (vv *VarView) StructView() *giv.StructView
StructView returns the main StructView
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