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 CompleteArg(data interface{}, text string, pos token.Position) (md complete.MatchData)
- func CompleteArgEdit(data interface{}, text string, cursorPos int, c complete.Completion, ...) (ed complete.EditData)
- func FileTreeViewExecCmds(it interface{}, 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 OpenIcons() error
- func OpenPaths()
- func PrefsView(pf *Preferences) (*giv.StructView, *gi.Window)
- func ProjPrefsView(pf *ProjPrefs) (*giv.StructView, *gi.Window)
- func RegistersView(pt *Registers)
- func SavePaths()
- func SetActiveKeyMap(km *KeySeqMap, kmName KeyMapName)
- func SetActiveKeyMapName(mapnm KeyMapName)
- func SplitsView(pt *Splits)
- func VersCtrlCmdNames(vcnm giv.VersCtrlName, cmds []string) []string
- type ArgVarInfo
- type ArgVarTypes
- type ArgVarVals
- 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) LangCmdNames(lang filecat.Supported) []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 EditorPrefs
- type FileNode
- type FilePrefs
- type FileSearchResults
- type FileTreeView
- type FindLoc
- type FindParams
- type FindView
- func (fv *FindView) ConfigToolbar()
- func (fv *FindView) CurDirBox() *gi.CheckBox
- 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) ReplBar() *gi.ToolBar
- func (fv *FindView) ReplText() *gi.ComboBox
- func (fv *FindView) ReplaceAction() bool
- func (fv *FindView) ReplaceAllAction()
- func (fv *FindView) SaveFindString(find string)
- func (fv *FindView) SaveReplString(repl string)
- func (fv *FindView) StdConfig() kit.TypeAndNameList
- func (fv *FindView) StdFindConfig() (mods, updt bool)
- func (fv *FindView) TextView() *giv.TextView
- func (fv *FindView) TextViewLay() *gi.Layout
- func (fv *FindView) UpdateView(ge Gide)
- 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)
- 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) Defaults()
- func (pf *Preferences) EditCmds()
- func (pf *Preferences) EditHiStyles()
- 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 SpellParams
- type SpellView
- func (sv *SpellView) AcceptSuggestion(s string)
- func (sv *SpellView) AdjustTextPos(tp giv.TextPos) giv.TextPos
- 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) CheckAct() *gi.Action
- func (sv *SpellView) CheckNext()
- func (sv *SpellView) ConfigToolbar()
- func (sv *SpellView) IgnoreAct() *gi.Action
- func (sv *SpellView) IgnoreAction()
- func (sv *SpellView) LearnAct() *gi.Action
- func (sv *SpellView) LearnAction()
- func (sv *SpellView) OpenSpellURL(ur string, ftv *giv.TextView) bool
- func (sv *SpellView) SetUnknownAndSuggest(unknown gi.TextWord, suggests []string)
- func (sv *SpellView) SkipAct() *gi.Action
- func (sv *SpellView) SkipAction()
- func (sv *SpellView) SpellAction()
- func (sv *SpellView) SpellBar() *gi.ToolBar
- func (sv *SpellView) SpellNextAct() *gi.Action
- func (sv *SpellView) StdConfig() kit.TypeAndNameList
- func (sv *SpellView) StdSpellConfig() (mods, updt bool)
- func (sv *SpellView) SuggestBar() *gi.ToolBar
- func (sv *SpellView) SuggestView() *giv.SliceView
- func (sv *SpellView) TextView() *giv.TextView
- func (sv *SpellView) TextViewLay() *gi.Layout
- func (sv *SpellView) TrainAction()
- func (sv *SpellView) UnknownBar() *gi.ToolBar
- func (sv *SpellView) UnknownEndPos() giv.TextPos
- func (sv *SpellView) UnknownStartPos() giv.TextPos
- func (sv *SpellView) UnknownText() *gi.TextField
- func (sv *SpellView) UpdateView(ge Gide, sp SpellParams)
- 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) 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 SymNode
- type SymTree
- type SymbolsParams
- type SymbolsView
- func (sv *SymbolsView) ConfigToolbar()
- func (sv *SymbolsView) ConfigTree()
- func (sv *SymbolsView) OpenSymbolsURL(ur string, ftv *giv.TextView) bool
- func (sv *SymbolsView) SelectSymbol(ssym syms.Symbol)
- func (sv *SymbolsView) StdConfig() kit.TypeAndNameList
- func (sv *SymbolsView) StdSymbolsConfig() (mods, updt bool)
- func (sv *SymbolsView) SymbolsAction()
- func (sv *SymbolsView) SymbolsBar() *gi.ToolBar
- func (sv *SymbolsView) SymbolsTree() *gi.Frame
- func (sv *SymbolsView) UpdateView(ge Gide, sp SymbolsParams)
Constants ¶
const ( Version = "v0.5.6" GitCommit = "027697e" // the commit JUST BEFORE the release VersionDate = "2019-01-04 13:50" // UTC )
Variables ¶
var ArgVars = map[string]ArgVarInfo{ "{FilePath}": ArgVarInfo{"Current file name with full path.", ArgVarFile}, "{FileName}": ArgVarInfo{"Current file name only, without path.", ArgVarFile}, "{FileExt}": ArgVarInfo{"Extension of current file name.", ArgVarExt}, "{FileExtLC}": ArgVarInfo{"Extension of current file name, lowercase.", ArgVarExt}, "{FileNameNoExt}": ArgVarInfo{"Current file name without path and extension.", ArgVarFile}, "{FileDir}": ArgVarInfo{"Name only of current file's directory.", ArgVarDir}, "{FileDirPath}": ArgVarInfo{"Full path to current file's directory.", ArgVarDir}, "{FileDirProjRel}": ArgVarInfo{"Path to current file's directory relative to project root.", ArgVarDir}, "{ProjDir}": ArgVarInfo{"Current project directory name, without full path.", ArgVarDir}, "{ProjPath}": ArgVarInfo{"Full path to current project directory.", ArgVarDir}, "{BuildDir}": ArgVarInfo{"Full path to BuildDir specified in project prefs -- the default Build.", ArgVarDir}, "{BuildDirRel}": ArgVarInfo{"Path to BuildDir relative to project root.", ArgVarDir}, "{BuildTarg}": ArgVarInfo{"Build target specified in prefs BuildTarg, just filename by itself, without path.", ArgVarFile}, "{BuildTargPath}": ArgVarInfo{"Full path to build target specified in prefs BuildTarg.", ArgVarFile}, "{BuildTargDirPath}": ArgVarInfo{"Full path to build target directory, without filename.", ArgVarDir}, "{BuildTargDirPathRel}": ArgVarInfo{"Project-relative path to build target directory, without filename.", ArgVarDir}, "{RunExec}": ArgVarInfo{"Run-time executable file RunExec specified in project prefs -- just the raw name of the file, without path.", ArgVarFile}, "{RunExecPath}": ArgVarInfo{"Full path to the run-time executable file RunExec specified in project prefs.", ArgVarFile}, "{RunExecDirPath}": ArgVarInfo{"Full path to the directory of the run-time executable file RunExec specified in project prefs.", ArgVarDir}, "{RunExecDirPathRel}": ArgVarInfo{"Project-root relative path to the directory of the run-time executable file RunExec specified in project prefs.", ArgVarDir}, "{CurLine}": ArgVarInfo{"Cursor current line number (starts at 1).", ArgVarPos}, "{CurCol}": ArgVarInfo{"Cursor current column number (starts at 0).", ArgVarPos}, "{SelStartLine}": ArgVarInfo{"Selection starting line (same as CurLine if no selection).", ArgVarPos}, "{SelStartCol}": ArgVarInfo{"Selection starting column (same as CurCol if no selection).", ArgVarPos}, "{SelEndLine}": ArgVarInfo{"Selection ending line (same as CurLine if no selection).", ArgVarPos}, "{SelEndCol}": ArgVarInfo{"Selection ending column (same as CurCol if no selection).", ArgVarPos}, "{CurSel}": ArgVarInfo{"Currently selected text.", ArgVarText}, "{CurLineText}": ArgVarInfo{"Current line text under cursor.", ArgVarText}, "{CurWord}": ArgVarInfo{"Current word under cursor.", ArgVarText}, "{PromptFilePath}": ArgVarInfo{"Prompt user for a file, and this is the full path to that file.", ArgVarPrompt}, "{PromptFileName}": ArgVarInfo{"Prompt user for a file, and this is the filename (only) of that file.", ArgVarPrompt}, "{PromptFileDir}": ArgVarInfo{"Prompt user for a file, and this is the directory name (only) of that file.", ArgVarPrompt}, "{PromptFileDirPath}": ArgVarInfo{"Prompt user for a file, and this is the full path to that directory.", ArgVarPrompt}, "{PromptFileDirProjRel}": ArgVarInfo{"Prompt user for a file, and this is the path of that directory relative to the project root.", ArgVarPrompt}, "{PromptString1}": ArgVarInfo{"Prompt user for a string -- this is it.", ArgVarPrompt}, "{PromptString2}": ArgVarInfo{"Prompt user for another string -- this is it.", ArgVarPrompt}, }
ArgVars are variables that can be used for arguments to commands in CmdAndArgs
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 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 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 interface{}, act *gi.Action) { act.SetActiveState(CustomCmdsChanged && cmi.(*Commands) == &CustomCmds) }), }}, {"sep-file", ki.BlankProp{}}, {"OpenJSON", ki.Props{ "label": "Open from file", "desc": "You can save and open commands to / from files to share, experiment, transfer, etc", "shortcut": "Command+O", "Args": ki.PropSlice{ {"File Name", ki.Props{ "ext": ".json", }}, }, }}, {"SaveJSON", ki.Props{ "label": "Save to file", "desc": "You can save and open commands to / from files to share, experiment, transfer, etc", "Args": ki.PropSlice{ {"File Name", ki.Props{ "ext": ".json", }}, }, }}, }}, {"Edit", "Copy Cut Paste Dupe"}, {"Window", "Windows"}, }, "ToolBar": ki.PropSlice{ {"SavePrefs", ki.Props{ "desc": "saves Commands to App standard prefs directory, in file proj_types_prefs.json, which will be loaded automatically at startup if prefs SaveCommands is checked (should be if you're using custom commands)", "icon": "file-save", "updtfunc": giv.ActionUpdateFunc(func(cmi interface{}, act *gi.Action) { act.SetActiveState(CustomCmdsChanged && cmi.(*Commands) == &CustomCmds) }), }}, {"sep-file", ki.BlankProp{}}, {"OpenJSON", ki.Props{ "label": "Open from file", "icon": "file-open", "desc": "You can save and open commands to / from files to share, experiment, transfer, etc", "Args": ki.PropSlice{ {"File Name", ki.Props{ "ext": ".json", }}, }, }}, {"SaveJSON", ki.Props{ "label": "Save to file", "icon": "file-save", "desc": "You can save and open commands to / from files to share, experiment, transfer, etc", "Args": ki.PropSlice{ {"File Name", ki.Props{ "ext": ".json", }}, }, }}, {"sep-std", ki.BlankProp{}}, {"ViewStd", ki.Props{ "desc": "Shows the standard commands that are compiled into the program (edits will not be saved -- even though the viewer is editable). Custom commands override standard ones of the same name, so that is the way to change any existing commands.", "updtfunc": giv.ActionUpdateFunc(func(cmi interface{}, act *gi.Action) { act.SetActiveState(cmi.(*Commands) != &StdCmds) }), }}, }, }
CommandsProps define the ToolBar and MenuBar for TableView of Commands, e.g., CmdsView
var CustomCmdsChanged = false
CustomCmdsChanged is used to update giv.CmdsView toolbars via following menu, toolbar props update methods.
var DefaultKeyMap = KeyMapName("MacEmacs")
DefaultKeyMap is the overall default keymap -- reinitialized in gimain init() depending on platform
var FileNodeProps = ki.Props{ "CallMethods": ki.PropSlice{ {"RenameFile", ki.Props{ "label": "Rename", "desc": "Rename file to new file name", "Args": ki.PropSlice{ {"New Name", ki.Props{ "default-field": "Name", "width": 60, }}, }, }}, }, }
var FileTreeActiveDirFunc = giv.ActionUpdateFunc(func(fni interface{}, act *gi.Action) { ft := fni.(ki.Ki).Embed(KiT_FileTreeView).(*FileTreeView) fn := ft.FileNode() if fn != nil { act.SetActiveState(fn.IsDir()) } })
FileTreeActiveDirFunc is an ActionUpdateFunc that activates action if node is a dir
var FileTreeInactiveDirFunc = giv.ActionUpdateFunc(func(fni interface{}, act *gi.Action) { ft := fni.(ki.Ki).Embed(KiT_FileTreeView).(*FileTreeView) fn := ft.FileNode() if fn != nil { act.SetInactiveState(fn.IsDir()) } })
FileTreeInactiveDirFunc is an ActionUpdateFunc that inactivates action if node is a dir
var FileTreeViewProps = ki.Props{ "indent": units.NewValue(2, units.Ch), "spacing": units.NewValue(.5, units.Ch), "border-width": units.NewValue(0, units.Px), "border-radius": units.NewValue(0, units.Px), "padding": units.NewValue(0, units.Px), "margin": units.NewValue(1, units.Px), "text-align": gi.AlignLeft, "vertical-align": gi.AlignTop, "color": &gi.Prefs.Colors.Font, "background-color": "inherit", ".exec": ki.Props{ "font-weight": gi.WeightBold, }, ".open": ki.Props{ "font-style": gi.FontItalic, }, ".notinvcs": ki.Props{ "color": "#ce4252", }, ".modified": ki.Props{ "color": "#4b7fd1", }, ".added": ki.Props{ "color": "#52af36", }, "#icon": ki.Props{ "width": units.NewValue(1, units.Em), "height": units.NewValue(1, units.Em), "margin": units.NewValue(0, units.Px), "padding": units.NewValue(0, units.Px), "fill": &gi.Prefs.Colors.Icon, "stroke": &gi.Prefs.Colors.Font, }, "#branch": ki.Props{ "icon": "widget-wedge-down", "icon-off": "widget-wedge-right", "margin": units.NewValue(0, units.Px), "padding": units.NewValue(0, units.Px), "background-color": color.Transparent, "max-width": units.NewValue(.8, units.Em), "max-height": units.NewValue(.8, units.Em), }, "#space": ki.Props{ "width": units.NewValue(.5, units.Em), }, "#label": ki.Props{ "margin": units.NewValue(0, units.Px), "padding": units.NewValue(0, units.Px), "min-width": units.NewValue(16, units.Ch), }, "#menu": ki.Props{ "indicator": "none", }, giv.TreeViewSelectors[giv.TreeViewActive]: ki.Props{}, giv.TreeViewSelectors[giv.TreeViewSel]: ki.Props{ "background-color": &gi.Prefs.Colors.Select, }, giv.TreeViewSelectors[giv.TreeViewFocus]: ki.Props{ "background-color": &gi.Prefs.Colors.Control, }, "CtxtMenuActive": ki.PropSlice{ {"ViewFiles", ki.Props{ "label": "View", "updtfunc": FileTreeInactiveDirFunc, }}, {"ShowFileInfo", ki.Props{ "label": "File Info", }}, {"ExecCmdFiles", ki.Props{ "label": "Exec Cmd", "submenu-func": giv.SubMenuFunc(FileTreeViewExecCmds), "Args": ki.PropSlice{ {"Cmd Name", ki.Props{}}, }, }}, {"DuplicateFiles", ki.Props{ "label": "Duplicate", "updtfunc": FileTreeInactiveDirFunc, "shortcut": gi.KeyFunDuplicate, }}, {"DeleteFiles", ki.Props{ "label": "Delete", "desc": "Ok to delete file(s)? This is not undoable and is not moving to trash / recycle bin", "shortcut": gi.KeyFunDelete, }}, {"RenameFiles", ki.Props{ "label": "Rename", "desc": "Rename file to new file name", }}, {"sep-open", ki.BlankProp{}}, {"OpenDirs", ki.Props{ "label": "Open Dir", "desc": "open given folder to see files within", "updtfunc": FileTreeActiveDirFunc, }}, {"NewFile", ki.Props{ "label": "New File...", "desc": "make a new file in this folder", "shortcut": gi.KeyFunInsert, "updtfunc": FileTreeActiveDirFunc, "Args": ki.PropSlice{ {"File Name", ki.Props{ "width": 60, }}, {"Add To Version Control", ki.Props{}}, }, }}, {"NewFolder", ki.Props{ "label": "New Folder...", "desc": "make a new folder within this folder", "shortcut": gi.KeyFunInsertAfter, "updtfunc": FileTreeActiveDirFunc, "Args": ki.PropSlice{ {"Folder Name", ki.Props{ "width": 60, }}, }, }}, {"sep-vcs", ki.BlankProp{}}, {"AddToVcs", ki.Props{ "desc": "Add file to version control git/svn", "updtfunc": giv.FileTreeActiveNotInVcsFunc, "label-func": giv.VcsLabelFunc, }}, {"RemoveFromVcs", ki.Props{ "desc": "Remove file from version control git/svn", "updtfunc": giv.FileTreeActiveInVcsFunc, "label-func": giv.VcsLabelFunc, }}, {"CommitToVcs", ki.Props{ "desc": "Commit file to version control", "updtfunc": giv.FileTreeActiveInVcsModifiedFunc, "label-func": giv.VcsLabelFunc, }}, {"RevertVcs", ki.Props{ "label": "Revert", "desc": "Revert file to last commit", "updtfunc": giv.FileTreeActiveInVcsModifiedFunc, }}, }, }
var FindViewProps = ki.Props{ "background-color": &gi.Prefs.Colors.Background, "color": &gi.Prefs.Colors.Font, "max-width": -1, "max-height": -1, }
FindViewProps are style properties for FindView
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 interface{}, act *gi.Action) { act.SetActiveState(AvailKeyMapsChanged && kmi.(*KeyMaps) == &AvailKeyMaps) }, }}, {"sep-file", ki.BlankProp{}}, {"OpenJSON", ki.Props{ "label": "Open from file", "desc": "You can save and open key maps to / from files to share, experiment, transfer, etc", "shortcut": "Command+O", "Args": ki.PropSlice{ {"File Name", ki.Props{ "ext": ".json", }}, }, }}, {"SaveJSON", ki.Props{ "label": "Save to file", "desc": "You can save and open key maps to / from files to share, experiment, transfer, etc", "Args": ki.PropSlice{ {"File Name", ki.Props{ "ext": ".json", }}, }, }}, {"RevertToStd", ki.Props{ "desc": "This reverts the keymaps to using the StdKeyMaps that are compiled into the program and have all the lastest key functions defined. If you have edited your maps, and are finding things not working, it is a good idea to save your current maps and try this, or at least do ViewStdMaps to see the current standards. <b>Your current map edits will be lost if you proceed!</b> Continue?", "confirm": true, }}, }}, {"Edit", "Copy Cut Paste Dupe"}, {"Window", "Windows"}, }, "ToolBar": ki.PropSlice{ {"SavePrefs", ki.Props{ "desc": "saves KeyMaps to App standard prefs directory, in file key_maps_prefs.json, which will be loaded automatically at startup if prefs SaveKeyMaps is checked (should be if you're using custom keymaps)", "icon": "file-save", "updtfunc": func(kmi interface{}, act *gi.Action) { act.SetActiveState(AvailKeyMapsChanged && kmi.(*KeyMaps) == &AvailKeyMaps) }, }}, {"sep-file", ki.BlankProp{}}, {"OpenJSON", ki.Props{ "label": "Open from file", "icon": "file-open", "desc": "You can save and open key maps to / from files to share, experiment, transfer, etc", "Args": ki.PropSlice{ {"File Name", ki.Props{ "ext": ".json", }}, }, }}, {"SaveJSON", ki.Props{ "label": "Save to file", "icon": "file-save", "desc": "You can save and open key maps to / from files to share, experiment, transfer, etc", "Args": ki.PropSlice{ {"File Name", ki.Props{ "ext": ".json", }}, }, }}, {"sep-std", ki.BlankProp{}}, {"ViewStd", ki.Props{ "desc": "Shows the standard maps that are compiled into the program and have all the lastest key functions bound to standard key chords. Useful for comparing against custom maps.", "confirm": true, "updtfunc": func(kmi interface{}, act *gi.Action) { act.SetActiveStateUpdt(kmi.(*KeyMaps) != &StdKeyMaps) }, }}, {"RevertToStd", ki.Props{ "icon": "update", "desc": "This reverts the keymaps to using the StdKeyMaps that are compiled into the program and have all the lastest key functions bound to standard key chords. If you have edited your maps, and are finding things not working, it is a good idea to save your current maps and try this, or at least do ViewStdMaps to see the current standards. <b>Your current map edits will be lost if you proceed!</b> Continue?", "confirm": true, "updtfunc": func(kmi interface{}, act *gi.Action) { act.SetActiveStateUpdt(kmi.(*KeyMaps) != &StdKeyMaps) }, }}, }, }
KeyMapsProps define the ToolBar and MenuBar for TableView of KeyMaps, e.g., giv.KeyMapsView
var KiT_ArgVarTypes = kit.Enums.AddEnumAltLower(ArgVarTypesN, false, nil, "ArgVar")
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_FileNode = kit.Types.AddType(&FileNode{}, FileNodeProps)
var KiT_FileTreeView = kit.Types.AddType(&FileTreeView{}, nil)
var KiT_FindView = kit.Types.AddType(&FindView{}, FindViewProps)
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_SymNode = kit.Types.AddType(&SymNode{}, nil)
var KiT_SymTree = kit.Types.AddType(&SymTree{}, SymTreeProps)
var KiT_SymbolsView = kit.Types.AddType(&SymbolsView{}, SymbolsViewProps)
var LangsProps = ki.Props{ "MainMenu": ki.PropSlice{ {"AppMenu", ki.BlankProp{}}, {"File", ki.PropSlice{ {"OpenPrefs", ki.Props{}}, {"SavePrefs", ki.Props{ "shortcut": "Command+S", "updtfunc": giv.ActionUpdateFunc(func(lti interface{}, act *gi.Action) { act.SetActiveState(AvailLangsChanged && lti.(*Langs) == &AvailLangs) }), }}, {"sep-file", ki.BlankProp{}}, {"OpenJSON", ki.Props{ "label": "Open from file", "desc": "You can save and open language options to / from files to share, experiment, transfer, etc", "shortcut": "Command+O", "Args": ki.PropSlice{ {"File Name", ki.Props{ "ext": ".json", }}, }, }}, {"SaveJSON", ki.Props{ "label": "Save to file", "desc": "You can save and open language options to / from files to share, experiment, transfer, etc", "Args": ki.PropSlice{ {"File Name", ki.Props{ "ext": ".json", }}, }, }}, {"RevertToStd", ki.Props{ "desc": "This reverts the language options to using the StdLangs that are compiled into the program and have all the lastest standards. <b>Your current edits will be lost if you proceed!</b> Continue?", "confirm": true, }}, }}, {"Edit", "Copy Cut Paste Dupe"}, {"Window", "Windows"}, }, "ToolBar": ki.PropSlice{ {"SavePrefs", ki.Props{ "desc": "saves Langs to App standard prefs directory, in file lang_prefs.json, which will be loaded automatically at startup if prefs SaveLangs is checked (should be if you're using custom language options)", "icon": "file-save", "updtfunc": giv.ActionUpdateFunc(func(lti interface{}, act *gi.Action) { act.SetActiveState(AvailLangsChanged && lti.(*Langs) == &AvailLangs) }), }}, {"sep-file", ki.BlankProp{}}, {"OpenJSON", ki.Props{ "label": "Open from file", "icon": "file-open", "desc": "You can save and open language options to / from files to share, experiment, transfer, etc", "Args": ki.PropSlice{ {"File Name", ki.Props{ "ext": ".json", }}, }, }}, {"SaveJSON", ki.Props{ "label": "Save to file", "icon": "file-save", "desc": "You can save and open language options to / from files to share, experiment, transfer, etc", "Args": ki.PropSlice{ {"File Name", ki.Props{ "ext": ".json", }}, }, }}, {"sep-std", ki.BlankProp{}}, {"ViewStd", ki.Props{ "desc": "Shows the standard language options that are compiled into the program and have all the latest changes. Useful for comparing against custom langs.", "updtfunc": giv.ActionUpdateFunc(func(lti interface{}, act *gi.Action) { act.SetActiveState(lti.(*Langs) != &StdLangs) }), }}, {"RevertToStd", ki.Props{ "icon": "update", "desc": "This reverts the language options to using the StdLangs that are compiled into the program and have all the lastest standards. <b>Your current edits will be lost if you proceed!</b> Continue?", "confirm": true, "updtfunc": giv.ActionUpdateFunc(func(lti interface{}, act *gi.Action) { act.SetActiveState(lti.(*Langs) != &StdLangs) }), }}, }, }
LangsProps define the ToolBar and MenuBar for TableView of Langs, e.g., giv.LangsView
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 interface{}, act *gi.Action) { pf := pfi.(*Preferences) act.SetActiveState(pf.Changed) }), }}, {"sep-close", ki.BlankProp{}}, {"Close Window", ki.BlankProp{}}, }}, {"Edit", "Copy Cut Paste"}, {"Window", "Windows"}, }, "ToolBar": ki.PropSlice{ {"Apply", ki.Props{ "desc": "Applies current prefs settings so they affect actual functionality.", "icon": "update", }}, {"Save", ki.Props{ "desc": "Saves current preferences to standard prefs.json file, which is auto-loaded at startup.", "icon": "file-save", "updtfunc": giv.ActionUpdateFunc(func(pfi interface{}, act *gi.Action) { pf := pfi.(*Preferences) act.SetActiveStateUpdt(pf.Changed) }), }}, {"VersionInfo", ki.Props{ "desc": "shows current Gide version information", "icon": "info", "show-return": true, }}, {"sep-key", ki.BlankProp{}}, {"EditKeyMaps", ki.Props{ "icon": "keyboard", "desc": "opens the KeyMapsView editor to create new keymaps / save / load from other files, etc. Current keymaps are saved and loaded with preferences automatically if SaveKeyMaps is clicked (will be turned on automatically if you open this editor).", }}, {"EditLangOpts", ki.Props{ "icon": "file-text", "desc": "opens the LangsView editor to customize options different language / data / file types. Current customized settings are saved and loaded with preferences automatically if SaveLangOpts is clicked (will be turned on automatically if you open this editor).", }}, {"EditCmds", ki.Props{ "icon": "file-binary", "desc": "opens the CmdsView editor to add custom commands you can run, in addition to standard commands built into the system. Current customized settings are saved and loaded with preferences automatically if SaveCmds is clicked (will be turned on automatically if you open this editor).", }}, {"EditSplits", ki.Props{ "icon": "file-binary", "desc": "opens the SplitsView editor of saved named splitter settings. Current customized settings are saved and loaded with preferences automatically.", }}, {"EditRegisters", ki.Props{ "icon": "file-binary", "desc": "opens the RegistersView editor of saved named text registers. Current values are saved and loaded with preferences automatically.", }}, {"EditHiStyles", ki.Props{ "icon": "file-binary", "desc": "opens the HiStylesView editor of highlighting styles.", }}, }, }
PreferencesProps define the ToolBar and MenuBar for StructView, e.g., giv.PrefsView
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 interface{}, act *gi.Action) { act.SetActiveState(AvailRegistersChanged && ari.(*Registers) == &AvailRegisters) }), }}, {"sep-file", ki.BlankProp{}}, {"OpenJSON", ki.Props{ "label": "Open from file", "desc": "You can save and open named registers to / from files to share, experiment, transfer, etc", "shortcut": "Command+O", "Args": ki.PropSlice{ {"File Name", ki.Props{ "ext": ".json", }}, }, }}, {"SaveJSON", ki.Props{ "label": "Save to file", "desc": "You can save and open named registers to / from files to share, experiment, transfer, etc", "Args": ki.PropSlice{ {"File Name", ki.Props{ "ext": ".json", }}, }, }}, }}, {"Edit", "Copy Cut Paste Dupe"}, {"Window", "Windows"}, }, "ToolBar": ki.PropSlice{ {"SavePrefs", ki.Props{ "desc": "saves Registers to App standard prefs directory, in file registers_prefs.json, which will be loaded automatically at startup)", "icon": "file-save", "updtfunc": giv.ActionUpdateFunc(func(ari interface{}, act *gi.Action) { act.SetActiveState(AvailRegistersChanged && ari.(*Registers) == &AvailRegisters) }), }}, {"sep-file", ki.BlankProp{}}, {"OpenJSON", ki.Props{ "label": "Open from file", "icon": "file-open", "desc": "You can save and open named registers to / from files to share, experiment, transfer, etc", "Args": ki.PropSlice{ {"File Name", ki.Props{ "ext": ".json", }}, }, }}, {"SaveJSON", ki.Props{ "label": "Save to file", "icon": "file-save", "desc": "You can save and open named registers to / from files to share, experiment, transfer, etc", "Args": ki.PropSlice{ {"File Name", ki.Props{ "ext": ".json", }}, }, }}, }, }
RegistersProps define the ToolBar and MenuBar for TableView of Registers
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{ "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 interface{}, act *gi.Action) { act.SetActiveState(AvailSplitsChanged && spi.(*Splits) == &AvailSplits) }), }}, {"sep-file", ki.BlankProp{}}, {"OpenJSON", ki.Props{ "label": "Open from file", "desc": "You can save and open named splits to / from files to share, experiment, transfer, etc", "shortcut": "Command+O", "Args": ki.PropSlice{ {"File Name", ki.Props{ "ext": ".json", }}, }, }}, {"SaveJSON", ki.Props{ "label": "Save to file", "desc": "You can save and open named splits to / from files to share, experiment, transfer, etc", "Args": ki.PropSlice{ {"File Name", ki.Props{ "ext": ".json", }}, }, }}, }}, {"Edit", "Copy Cut Paste Dupe"}, {"Window", "Windows"}, }, "ToolBar": ki.PropSlice{ {"SavePrefs", ki.Props{ "desc": "saves Splits to App standard prefs directory, in file splits_prefs.json, which will be loaded automatically at startup)", "icon": "file-save", "updtfunc": giv.ActionUpdateFunc(func(spi interface{}, act *gi.Action) { act.SetActiveState(AvailSplitsChanged && spi.(*Splits) == &AvailSplits) }), }}, {"sep-file", ki.BlankProp{}}, {"OpenJSON", ki.Props{ "label": "Open from file", "icon": "file-open", "desc": "You can save and open named splits to / from files to share, experiment, transfer, etc", "Args": ki.PropSlice{ {"File Name", ki.Props{ "ext": ".json", }}, }, }}, {"SaveJSON", ki.Props{ "label": "Save to file", "icon": "file-save", "desc": "You can save and open named splits to / from files to share, experiment, transfer, etc", "Args": ki.PropSlice{ {"File Name", ki.Props{ "ext": ".json", }}, }, }}, }, }
SplitsProps define the ToolBar and MenuBar for TableView of Splits
var StdCmds = Commands{ {"Run Proj", "run RunExec executable set in project", filecat.Any, []CmdAndArgs{CmdAndArgs{"{RunExecPath}", nil}}, "{RunExecDirPath}", false, false, false}, {"Run Prompt", "run any command you enter at the prompt", filecat.Any, []CmdAndArgs{CmdAndArgs{"{PromptString1}", nil}}, "{FileDirPath}", false, false, false}, {"Make", "run make with no args", filecat.Any, []CmdAndArgs{CmdAndArgs{"make", nil}}, "{FileDirPath}", false, false, false}, {"Make Prompt", "run make with prompted make target", filecat.Any, []CmdAndArgs{CmdAndArgs{"make", []string{"{PromptString1}"}}}, "{FileDirPath}", false, false, false}, {"Imports Go File", "run goimports on file", filecat.Go, []CmdAndArgs{CmdAndArgs{"goimports", []string{"-w", "{FilePath}"}}}, "{FileDirPath}", true, false, false}, {"Fmt Go File", "run go fmt on file", filecat.Go, []CmdAndArgs{CmdAndArgs{"gofmt", []string{"-w", "{FilePath}"}}}, "{FileDirPath}", true, false, false}, {"Build Go Dir", "run go build to build in current dir", filecat.Go, []CmdAndArgs{CmdAndArgs{"go", []string{"build", "-v"}}}, "{FileDirPath}", false, false, false}, {"Build Go Proj", "run go build for project BuildDir", filecat.Go, []CmdAndArgs{CmdAndArgs{"go", []string{"build", "-v"}}}, "{BuildDir}", false, false, false}, {"Install Go Proj", "run go install for project BuildDir", filecat.Go, []CmdAndArgs{CmdAndArgs{"go", []string{"install", "-v"}}}, "{BuildDir}", false, false, false}, {"Generate Go", "run go generate in current dir", filecat.Go, []CmdAndArgs{CmdAndArgs{"go", []string{"generate"}}}, "{FileDirPath}", false, false, false}, {"Test Go", "run go test in current dir", filecat.Go, []CmdAndArgs{CmdAndArgs{"go", []string{"test", "-v"}}}, "{FileDirPath}", false, false, false}, {"Vet Go", "run go vet in current dir", filecat.Go, []CmdAndArgs{CmdAndArgs{"go", []string{"vet"}}}, "{FileDirPath}", false, false, false}, {"Get Go", "run go get on package you enter at prompt", filecat.Go, []CmdAndArgs{CmdAndArgs{"go", []string{"get", "{PromptString1}"}}}, "{FileDirPath}", false, false, false}, {"Get Go Updt", "run go get -u (updt) on package you enter at prompt", filecat.Go, []CmdAndArgs{CmdAndArgs{"go", []string{"get", "{PromptString1}"}}}, "{FileDirPath}", false, false, false}, {"Add Git", "git add file", filecat.Any, []CmdAndArgs{CmdAndArgs{"git", []string{"add", "{FilePath}"}}}, "{FileDirPath}", false, false, false}, {"Checkout Git", "git checkout file or directory -- WARNING will overwrite local changes!", filecat.Any, []CmdAndArgs{CmdAndArgs{"git", []string{"checkout", "{FilePath}"}}}, "{FileDirPath}", false, false, true}, {"Status Git", "git status", filecat.Any, []CmdAndArgs{CmdAndArgs{"git", []string{"status"}}}, "{FileDirPath}", false, false, false}, {"Diff Git", "git diff -- see changes since last checkin", filecat.Any, []CmdAndArgs{CmdAndArgs{"git", []string{"diff"}}}, "{FileDirPath}", false, false, false}, {"Log Git", "git log", filecat.Any, []CmdAndArgs{CmdAndArgs{"git", []string{"log"}}}, "{FileDirPath}", false, false, false}, {"Commit Git", "git commit", filecat.Any, []CmdAndArgs{CmdAndArgs{"git", []string{"commit", "-am", "{PromptString1}"}}}, "{FileDirPath}", true, false, false}, {"Pull Git ", "git pull", filecat.Any, []CmdAndArgs{CmdAndArgs{"git", []string{"pull"}}}, "{FileDirPath}", false, false, false}, {"Push Git ", "git push", filecat.Any, []CmdAndArgs{CmdAndArgs{"git", []string{"push"}}}, "{FileDirPath}", false, false, false}, {"Add SVN", "svn add file", filecat.Any, []CmdAndArgs{CmdAndArgs{"svn", []string{"add", "{FilePath}"}}}, "{FileDirPath}", false, false, false}, {"Status SVN", "svn status", filecat.Any, []CmdAndArgs{CmdAndArgs{"svn", []string{"status"}}}, "{FileDirPath}", false, false, false}, {"Info SVN", "svn info", filecat.Any, []CmdAndArgs{CmdAndArgs{"svn", []string{"info"}}}, "{FileDirPath}", false, false, false}, {"Log SVN", "svn log", filecat.Any, []CmdAndArgs{CmdAndArgs{"svn", []string{"log", "-v"}}}, "{FileDirPath}", false, false, false}, {"Commit SVN", "svn commit", filecat.Any, []CmdAndArgs{CmdAndArgs{"svn", []string{"commit", "-m", "{PromptString1}"}}}, "{FileDirPath}", true, false, false}, {"Update SVN", "svn update", filecat.Any, []CmdAndArgs{CmdAndArgs{"svn", []string{"update"}}}, "{FileDirPath}", false, false, false}, {"LaTeX PDF", "run PDFLaTeX on file", filecat.TeX, []CmdAndArgs{CmdAndArgs{"pdflatex", []string{"-file-line-error", "-interaction=nonstopmode", "{FilePath}"}}}, "{FileDirPath}", false, false, false}, {"BibTeX", "run BibTeX on file", filecat.TeX, []CmdAndArgs{CmdAndArgs{"bibtex", []string{"{FileNameNoExt}"}}}, "{FileDirPath}", false, false, false}, {"Open File", "open file using OS 'open' command", filecat.Any, []CmdAndArgs{CmdAndArgs{"open", []string{"{FilePath}"}}}, "{FileDirPath}", false, false, false}, {"Open Target File", "open project target file using OS 'open' command", filecat.Any, []CmdAndArgs{CmdAndArgs{"open", []string{"{RunExecPath}"}}}, "{FileDirPath}", false, false, false}, {"List Dir", "list current dir", filecat.Any, []CmdAndArgs{CmdAndArgs{"ls", []string{"-la"}}}, "{FileDirPath}", false, false, false}, {"Grep", "recursive grep of all files for prompted value", filecat.Any, []CmdAndArgs{CmdAndArgs{"grep", []string{"-R", "-e", "{PromptString1}", "{FileDirPath}"}}}, "{FileDirPath}", false, false, false}, }
StdCmds is the original compiled-in set of standard commands.
var StdKeyMaps = KeyMaps{ {"MacStd", "Standard Mac KeyMap", KeySeqMap{ KeySeq{"Control+Tab", ""}: KeyFunNextPanel, KeySeq{"Shift+Control+Tab", ""}: KeyFunPrevPanel, KeySeq{"Control+M", "o"}: KeyFunNextPanel, KeySeq{"Control+M", "Control+O"}: KeyFunNextPanel, KeySeq{"Control+M", "p"}: KeyFunPrevPanel, KeySeq{"Control+M", "Control+P"}: KeyFunPrevPanel, KeySeq{"Control+O", ""}: KeyFunFileOpen, KeySeq{"Control+M", "f"}: KeyFunFileOpen, KeySeq{"Control+M", "Control+F"}: KeyFunFileOpen, KeySeq{"Control+M", "b"}: KeyFunBufSelect, KeySeq{"Control+M", "Control+B"}: KeyFunBufSelect, KeySeq{"Control+S", ""}: KeyFunBufSave, KeySeq{"Shift+Control+S", ""}: KeyFunBufSaveAs, KeySeq{"Control+M", "s"}: KeyFunBufSave, KeySeq{"Control+M", "Control+S"}: KeyFunBufSave, KeySeq{"Control+M", "w"}: KeyFunBufSaveAs, KeySeq{"Control+M", "Control+W"}: KeyFunBufSaveAs, KeySeq{"Control+M", "k"}: KeyFunBufClose, KeySeq{"Control+M", "Control+K"}: KeyFunBufClose, KeySeq{"Control+M", "c"}: KeyFunExecCmd, KeySeq{"Control+M", "Control+C"}: KeyFunExecCmd, KeySeq{"Control+M", "n"}: KeyFunBufClone, KeySeq{"Control+M", "Control+N"}: KeyFunBufClone, KeySeq{"Control+M", "x"}: KeyFunRegCopy, KeySeq{"Control+M", "g"}: KeyFunRegPaste, KeySeq{"Control+/", ""}: KeyFunCommentOut, KeySeq{"Control+M", "t"}: KeyFunCommentOut, KeySeq{"Control+M", "Control+T"}: KeyFunCommentOut, KeySeq{"Control+M", "i"}: KeyFunIndent, KeySeq{"Control+M", "Control+I"}: KeyFunIndent, KeySeq{"Control+M", "j"}: KeyFunJump, KeySeq{"Control+M", "Control+J"}: KeyFunJump, KeySeq{"Control+M", "v"}: KeyFunSetSplit, KeySeq{"Control+M", "Control+V"}: KeyFunSetSplit, KeySeq{"Control+M", "m"}: KeyFunBuildProj, KeySeq{"Control+M", "Control+M"}: KeyFunBuildProj, KeySeq{"Control+M", "r"}: KeyFunRunProj, KeySeq{"Control+M", "Control+R"}: KeyFunRunProj, }}, {"MacEmacs", "Mac with emacs-style navigation -- emacs wins in conflicts", KeySeqMap{ KeySeq{"Control+Tab", ""}: KeyFunNextPanel, KeySeq{"Shift+Control+Tab", ""}: KeyFunPrevPanel, KeySeq{"Control+X", "o"}: KeyFunNextPanel, KeySeq{"Control+X", "Control+O"}: KeyFunNextPanel, KeySeq{"Control+X", "p"}: KeyFunPrevPanel, KeySeq{"Control+X", "Control+P"}: KeyFunPrevPanel, KeySeq{"Control+X", "f"}: KeyFunFileOpen, KeySeq{"Control+X", "Control+F"}: KeyFunFileOpen, KeySeq{"Control+X", "b"}: KeyFunBufSelect, KeySeq{"Control+X", "Control+B"}: KeyFunBufSelect, KeySeq{"Control+X", "s"}: KeyFunBufSave, KeySeq{"Control+X", "Control+S"}: KeyFunBufSave, KeySeq{"Control+X", "w"}: KeyFunBufSaveAs, KeySeq{"Control+X", "Control+W"}: KeyFunBufSaveAs, KeySeq{"Control+X", "k"}: KeyFunBufClose, KeySeq{"Control+X", "Control+K"}: KeyFunBufClose, KeySeq{"Control+X", "c"}: KeyFunExecCmd, KeySeq{"Control+X", "Control+C"}: KeyFunExecCmd, KeySeq{"Control+C", "c"}: KeyFunExecCmd, KeySeq{"Control+C", "Control+C"}: KeyFunExecCmd, KeySeq{"Control+C", "o"}: KeyFunBufClone, KeySeq{"Control+C", "Control+O"}: KeyFunBufClone, KeySeq{"Control+X", "x"}: KeyFunRegCopy, KeySeq{"Control+X", "g"}: KeyFunRegPaste, KeySeq{"Control+C", "k"}: KeyFunCommentOut, KeySeq{"Control+C", "Control+K"}: KeyFunCommentOut, KeySeq{"Control+X", "i"}: KeyFunIndent, KeySeq{"Control+X", "Control+I"}: KeyFunIndent, KeySeq{"Control+X", "j"}: KeyFunJump, KeySeq{"Control+X", "Control+J"}: KeyFunJump, KeySeq{"Control+X", "v"}: KeyFunSetSplit, KeySeq{"Control+X", "Control+V"}: KeyFunSetSplit, KeySeq{"Control+X", "m"}: KeyFunBuildProj, KeySeq{"Control+X", "Control+M"}: KeyFunBuildProj, KeySeq{"Control+X", "r"}: KeyFunRunProj, KeySeq{"Control+X", "Control+R"}: KeyFunRunProj, }}, {"LinuxEmacs", "Linux with emacs-style navigation -- emacs wins in conflicts", KeySeqMap{ KeySeq{"Control+Tab", ""}: KeyFunNextPanel, KeySeq{"Shift+Control+Tab", ""}: KeyFunPrevPanel, KeySeq{"Control+X", "o"}: KeyFunNextPanel, KeySeq{"Control+X", "Control+O"}: KeyFunNextPanel, KeySeq{"Control+X", "p"}: KeyFunPrevPanel, KeySeq{"Control+X", "Control+P"}: KeyFunPrevPanel, KeySeq{"Control+X", "f"}: KeyFunFileOpen, KeySeq{"Control+X", "Control+F"}: KeyFunFileOpen, KeySeq{"Control+X", "b"}: KeyFunBufSelect, KeySeq{"Control+X", "Control+B"}: KeyFunBufSelect, KeySeq{"Control+X", "s"}: KeyFunBufSave, KeySeq{"Control+X", "Control+S"}: KeyFunBufSave, KeySeq{"Control+X", "w"}: KeyFunBufSaveAs, KeySeq{"Control+X", "Control+W"}: KeyFunBufSaveAs, KeySeq{"Control+X", "k"}: KeyFunBufClose, KeySeq{"Control+X", "Control+K"}: KeyFunBufClose, KeySeq{"Control+X", "c"}: KeyFunExecCmd, KeySeq{"Control+X", "Control+C"}: KeyFunExecCmd, KeySeq{"Control+C", "c"}: KeyFunExecCmd, KeySeq{"Control+C", "Control+C"}: KeyFunExecCmd, KeySeq{"Control+C", "o"}: KeyFunBufClone, KeySeq{"Control+C", "Control+O"}: KeyFunBufClone, KeySeq{"Control+X", "x"}: KeyFunRegCopy, KeySeq{"Control+X", "g"}: KeyFunRegPaste, KeySeq{"Control+C", "k"}: KeyFunCommentOut, KeySeq{"Control+C", "Control+K"}: KeyFunCommentOut, KeySeq{"Control+X", "i"}: KeyFunIndent, KeySeq{"Control+X", "Control+I"}: KeyFunIndent, KeySeq{"Control+X", "j"}: KeyFunJump, KeySeq{"Control+X", "Control+J"}: KeyFunJump, KeySeq{"Control+X", "v"}: KeyFunSetSplit, KeySeq{"Control+X", "Control+V"}: KeyFunSetSplit, KeySeq{"Control+M", "m"}: KeyFunBuildProj, KeySeq{"Control+M", "Control+M"}: KeyFunBuildProj, KeySeq{"Control+M", "r"}: KeyFunRunProj, KeySeq{"Control+M", "Control+R"}: KeyFunRunProj, }}, {"LinuxStd", "Standard Linux KeySeqMap", KeySeqMap{ KeySeq{"Control+Tab", ""}: KeyFunNextPanel, KeySeq{"Shift+Control+Tab", ""}: KeyFunPrevPanel, KeySeq{"Control+M", "o"}: KeyFunNextPanel, KeySeq{"Control+M", "Control+O"}: KeyFunNextPanel, KeySeq{"Control+M", "p"}: KeyFunPrevPanel, KeySeq{"Control+M", "Control+P"}: KeyFunPrevPanel, KeySeq{"Control+O", ""}: KeyFunFileOpen, KeySeq{"Control+M", "f"}: KeyFunFileOpen, KeySeq{"Control+M", "Control+F"}: KeyFunFileOpen, KeySeq{"Control+M", "b"}: KeyFunBufSelect, KeySeq{"Control+M", "Control+B"}: KeyFunBufSelect, KeySeq{"Control+S", ""}: KeyFunBufSave, KeySeq{"Shift+Control+S", ""}: KeyFunBufSaveAs, KeySeq{"Control+M", "s"}: KeyFunBufSave, KeySeq{"Control+M", "Control+S"}: KeyFunBufSave, KeySeq{"Control+M", "w"}: KeyFunBufSaveAs, KeySeq{"Control+M", "Control+W"}: KeyFunBufSaveAs, KeySeq{"Control+M", "k"}: KeyFunBufClose, KeySeq{"Control+M", "Control+K"}: KeyFunBufClose, KeySeq{"Control+M", "c"}: KeyFunExecCmd, KeySeq{"Control+M", "Control+C"}: KeyFunExecCmd, KeySeq{"Control+M", "n"}: KeyFunBufClone, KeySeq{"Control+M", "Control+N"}: KeyFunBufClone, KeySeq{"Control+M", "x"}: KeyFunRegCopy, KeySeq{"Control+M", "g"}: KeyFunRegPaste, KeySeq{"Control+/", ""}: KeyFunCommentOut, KeySeq{"Control+M", "t"}: KeyFunCommentOut, KeySeq{"Control+M", "Control+T"}: KeyFunCommentOut, KeySeq{"Control+M", "i"}: KeyFunIndent, KeySeq{"Control+M", "Control+I"}: KeyFunIndent, KeySeq{"Control+M", "j"}: KeyFunJump, KeySeq{"Control+M", "Control+J"}: KeyFunJump, KeySeq{"Control+M", "v"}: KeyFunSetSplit, KeySeq{"Control+M", "Control+V"}: KeyFunSetSplit, KeySeq{"Control+M", "m"}: KeyFunBuildProj, KeySeq{"Control+M", "Control+M"}: KeyFunBuildProj, KeySeq{"Control+M", "r"}: KeyFunRunProj, KeySeq{"Control+M", "Control+R"}: KeyFunRunProj, }}, {"WindowsStd", "Standard Windows KeySeqMap", KeySeqMap{ KeySeq{"Control+Tab", ""}: KeyFunNextPanel, KeySeq{"Shift+Control+Tab", ""}: KeyFunPrevPanel, KeySeq{"Control+M", "o"}: KeyFunNextPanel, KeySeq{"Control+M", "Control+O"}: KeyFunNextPanel, KeySeq{"Control+M", "p"}: KeyFunPrevPanel, KeySeq{"Control+M", "Control+P"}: KeyFunPrevPanel, KeySeq{"Control+O", ""}: KeyFunFileOpen, KeySeq{"Control+M", "f"}: KeyFunFileOpen, KeySeq{"Control+M", "Control+F"}: KeyFunFileOpen, KeySeq{"Control+M", "b"}: KeyFunBufSelect, KeySeq{"Control+M", "Control+B"}: KeyFunBufSelect, KeySeq{"Control+S", ""}: KeyFunBufSave, KeySeq{"Shift+Control+S", ""}: KeyFunBufSaveAs, KeySeq{"Control+M", "s"}: KeyFunBufSave, KeySeq{"Control+M", "Control+S"}: KeyFunBufSave, KeySeq{"Control+M", "w"}: KeyFunBufSaveAs, KeySeq{"Control+M", "Control+W"}: KeyFunBufSaveAs, KeySeq{"Control+M", "k"}: KeyFunBufClose, KeySeq{"Control+M", "Control+K"}: KeyFunBufClose, KeySeq{"Control+M", "c"}: KeyFunExecCmd, KeySeq{"Control+M", "Control+C"}: KeyFunExecCmd, KeySeq{"Control+M", "n"}: KeyFunBufClone, KeySeq{"Control+M", "Control+N"}: KeyFunBufClone, KeySeq{"Control+M", "x"}: KeyFunRegCopy, KeySeq{"Control+M", "g"}: KeyFunRegPaste, KeySeq{"Control+/", ""}: KeyFunCommentOut, KeySeq{"Control+M", "t"}: KeyFunCommentOut, KeySeq{"Control+M", "Control+T"}: KeyFunCommentOut, KeySeq{"Control+M", "i"}: KeyFunIndent, KeySeq{"Control+M", "Control+I"}: KeyFunIndent, KeySeq{"Control+M", "j"}: KeyFunJump, KeySeq{"Control+M", "Control+J"}: KeyFunJump, KeySeq{"Control+M", "v"}: KeyFunSetSplit, KeySeq{"Control+M", "Control+V"}: KeyFunSetSplit, KeySeq{"Control+M", "m"}: KeyFunBuildProj, KeySeq{"Control+M", "Control+M"}: KeyFunBuildProj, KeySeq{"Control+M", "r"}: KeyFunRunProj, KeySeq{"Control+M", "Control+R"}: KeyFunRunProj, }}, {"ChromeStd", "Standard chrome-browser and linux-under-chrome bindings", KeySeqMap{ KeySeq{"Control+Tab", ""}: KeyFunNextPanel, KeySeq{"Shift+Control+Tab", ""}: KeyFunPrevPanel, KeySeq{"Control+M", "o"}: KeyFunNextPanel, KeySeq{"Control+M", "Control+O"}: KeyFunNextPanel, KeySeq{"Control+M", "p"}: KeyFunPrevPanel, KeySeq{"Control+M", "Control+P"}: KeyFunPrevPanel, KeySeq{"Control+O", ""}: KeyFunFileOpen, KeySeq{"Control+M", "f"}: KeyFunFileOpen, KeySeq{"Control+M", "Control+F"}: KeyFunFileOpen, KeySeq{"Control+M", "b"}: KeyFunBufSelect, KeySeq{"Control+M", "Control+B"}: KeyFunBufSelect, KeySeq{"Control+S", ""}: KeyFunBufSave, KeySeq{"Shift+Control+S", ""}: KeyFunBufSaveAs, KeySeq{"Control+M", "s"}: KeyFunBufSave, KeySeq{"Control+M", "Control+S"}: KeyFunBufSave, KeySeq{"Control+M", "w"}: KeyFunBufSaveAs, KeySeq{"Control+M", "Control+W"}: KeyFunBufSaveAs, KeySeq{"Control+M", "k"}: KeyFunBufClose, KeySeq{"Control+M", "Control+K"}: KeyFunBufClose, KeySeq{"Control+M", "c"}: KeyFunExecCmd, KeySeq{"Control+M", "Control+C"}: KeyFunExecCmd, KeySeq{"Control+M", "n"}: KeyFunBufClone, KeySeq{"Control+M", "Control+N"}: KeyFunBufClone, KeySeq{"Control+M", "x"}: KeyFunRegCopy, KeySeq{"Control+M", "g"}: KeyFunRegPaste, KeySeq{"Control+/", ""}: KeyFunCommentOut, KeySeq{"Control+M", "t"}: KeyFunCommentOut, KeySeq{"Control+M", "Control+T"}: KeyFunCommentOut, KeySeq{"Control+M", "i"}: KeyFunIndent, KeySeq{"Control+M", "Control+I"}: KeyFunIndent, KeySeq{"Control+M", "j"}: KeyFunJump, KeySeq{"Control+M", "Control+J"}: KeyFunJump, KeySeq{"Control+M", "v"}: KeyFunSetSplit, KeySeq{"Control+M", "Control+V"}: KeyFunSetSplit, KeySeq{"Control+M", "m"}: KeyFunBuildProj, KeySeq{"Control+M", "Control+M"}: KeyFunBuildProj, KeySeq{"Control+M", "r"}: KeyFunRunProj, KeySeq{"Control+M", "Control+R"}: KeyFunRunProj, }}, }
StdKeyMaps is the original compiled-in set of standard keymaps that have the lastest key functions bound to standard key chords.
var StdLangs = Langs{ filecat.Go: {CmdNames{"Imports Go File"}}, }
StdLangs is the original compiled-in set of standard language options.
var StdSplits = Splits{ {"Code", "2 text views, main tabs, no vis tabs", []float32{.1, .325, .325, .25, 0}}, {"Vis", "1 text view, main and vis tabs", []float32{.1, .3, 0, .3, .3}}, {"Small", "1 text view, and main tabs", []float32{.1, .5, 0, .4, 0}}, {"All", "All panels open", []float32{.1, .25, .25, .2, .2}}, }
StdSplits is the original compiled-in set of standard named splits.
var SymTreeProps = ki.Props{}
var SymbolsViewProps = ki.Props{ "background-color": &gi.Prefs.Colors.Background, "color": &gi.Prefs.Colors.Font, "max-width": -1, "max-height": -1, }
SymbolsViewProps are style properties for SymbolsView
Functions ¶
func ArgVarPrompts ¶
ArgVarPrompts returns any Prompt* variables required by this string, false if none
func CompleteArg ¶
CompleteArg supplies directory variables to the completer
func CompleteArgEdit ¶
func CompleteArgEdit(data interface{}, text string, cursorPos int, c complete.Completion, seed string) (ed complete.EditData)
CompleteArgEdit edits completer text field after the user chooses from the candidate completions
func FileTreeViewExecCmds ¶
func FileTreeViewExecCmds(it interface{}, vp *gi.Viewport2D) []string
FileTreeViewExecCmds gets list of available commands for given file node, as a submenu-func
func 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 PrefsView ¶
func PrefsView(pf *Preferences) (*giv.StructView, *gi.Window)
PrefsView opens a view of user preferences, returns structview and window
func ProjPrefsView ¶
func ProjPrefsView(pf *ProjPrefs) (*giv.StructView, *gi.Window)
ProjPrefsView opens a view of project preferences (settings), returns structview and window
func RegistersView ¶
func RegistersView(pt *Registers)
RegistersView opens a view of a commands table
func SetActiveKeyMap ¶
func SetActiveKeyMap(km *KeySeqMap, kmName KeyMapName)
SetActiveKeyMap sets the current ActiveKeyMap, calling Update on the map prior to setting it to ensure that it is a valid, complete map
func SetActiveKeyMapName ¶
func SetActiveKeyMapName(mapnm KeyMapName)
SetActiveKeyMapName sets the current ActiveKeyMap by name from those defined in AvailKeyMaps, calling Update on the map prior to setting it to ensure that it is a valid, complete map
func VersCtrlCmdNames ¶
func VersCtrlCmdNames(vcnm giv.VersCtrlName, cmds []string) []string
VersCtrlCmdNames returns a slice of commands that contain in their name the specific version control name, but NOT the others -- takes the output of LangCmdNames
Types ¶
type ArgVarInfo ¶
type ArgVarInfo struct { Desc string `desc:"description of arg var"` Type ArgVarTypes `desc:"type of variable -- used for checking usage and other special features such as prompting"` }
ArgVarInfo has info about argument variables that fill in relevant values for commands, used in ArgVars list of variables
type ArgVarTypes ¶
type ArgVarTypes int32
ArgVarTypes describe the type of information in the arg var -- used for checking usage and special features.
const ( // ArgVarFile is a file name, not a directory ArgVarFile ArgVarTypes = iota // ArgVarDir is a directory name, not a file ArgVarDir // ArgVarExt is a file extension ArgVarExt // ArgVarPos is a text position ArgVarPos // ArgVarText is text from a buffer ArgVarText // ArgVarPrompt is a user-prompted variable ArgVarPrompt // ArgVarTypesN is the number of ArgVarTypes ArgVarTypesN )
func (*ArgVarTypes) FromString ¶
func (i *ArgVarTypes) FromString(s string) error
func (ArgVarTypes) MarshalJSON ¶
func (kf ArgVarTypes) MarshalJSON() ([]byte, error)
MarshalJSON saves arg variables to a JSON-formatted file
func (ArgVarTypes) String ¶
func (i ArgVarTypes) String() string
func (*ArgVarTypes) UnmarshalJSON ¶
func (kf *ArgVarTypes) UnmarshalJSON(b []byte) error
UnmarshalJSON decodes arg variables from a JSON-formatted file
type ArgVarVals ¶
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 CmdAndArgs ¶
type CmdAndArgs struct { Cmd string `` /* 145-byte string literal not displayed */ Args CmdArgs `` /* 336-byte string literal not displayed */ }
CmdAndArgs contains the name of an external program to execute and args to pass to that program
func (*CmdAndArgs) BindArgs ¶
func (cm *CmdAndArgs) BindArgs(avp *ArgVarVals) []string
BindArgs replaces any variables in the args with their values, and returns resulting args
func (*CmdAndArgs) HasPrompts ¶
func (cm *CmdAndArgs) HasPrompts() (map[string]struct{}, bool)
HasPrompts returns true if any prompts are required before running command, and the set of such args
func (*CmdAndArgs) 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.
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 string `desc:"Name of command being run -- same as Command.Name"` CmdStr string `desc:"command string"` CmdArgs *CmdAndArgs `desc:"Details of the command and args"` Exec *exec.Cmd `desc:"exec.Cmd for the command"` }
CmdRun tracks running commands
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 { Name string `width:"20" desc:"name of this command (must be unique in list of commands)"` Desc string `width:"40" desc:"brief description of this command"` Lang filecat.Supported `` /* 176-byte string literal not displayed */ Cmds []CmdAndArgs `tableview-select:"-" desc:"sequence of commands to run for this overall command."` Dir string `` /* 258-byte string literal not displayed */ Wait bool `` /* 206-byte string literal not displayed */ Focus bool `desc:"if true, keyboard focus is directed to the command output tab panel after the command runs."` Confirm bool `desc:"if true, command requires Ok / Cancel confirmation dialog -- only needed for non-prompt commands"` }
Command defines different types of commands that can be run in the project. The output of the commands shows up in an associated tab.
func (*Command) AppendCmdOut ¶
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.
var CustomCmds Commands
CustomCmds is user-specific list of commands saved in preferences available for all Gide projects. These will override StdCmds with the same names.
func (*Commands) CmdByName ¶
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 that are compatible with given language and version control system.
func (*Commands) LangCmdNames ¶
LangCmdNames returns a slice of commands that are compatible with given language.
func (*Commands) OpenPrefs ¶
OpenPrefs opens custom Commands from App standard prefs directory, using PrefsCmdsFileName
type Console ¶
type Console struct { StdoutWrite *os.File `json:"-" xml:"-" desc:"std out writer -- set to os.Stdout"` StdoutRead *os.File `json:"-" xml:"-" desc:"std out reader -- used to read os.Stdout"` StderrWrite *os.File `json:"-" xml:"-" desc:"std err writer -- set to os.Stderr"` StderrRead *os.File `json:"-" xml:"-" desc:"std err reader -- used to read os.Stderr"` Buf *giv.TextBuf `json:"-" xml:"-" desc:"text buffer holding all output"` Cancel bool `json:"-" xml:"-" desc:"set to true to cancel monitoring"` Mu sync.Mutex `json:"-" xml:"-" desc:"mutex protecting updating of buffer between out / err"` OrgoutWrite *os.File `json:"-" xml:"-" desc:"original os.Stdout writer"` OrgerrWrite *os.File `json:"-" xml:"-" desc:"original os.Stderr writer"` }
Console redirects our os.Stdout and os.Stderr to a buffer for display within app
var TheConsole Console
func (*Console) Init ¶
func (cn *Console) Init()
Init initializes the console -- sets up the capture, Buf, and starts the routine that monitors output
func (*Console) MonitorErr ¶
func (cn *Console) MonitorErr()
MonitorErr monitors std error and appends it to the buffer should be in a separate routine
func (*Console) MonitorOut ¶
func (cn *Console) MonitorOut()
MonitorOut monitors std output and appends it to the buffer should be in a separate routine
type EditorPrefs ¶
type EditorPrefs struct { TabSize int `desc:"size of a tab, in chars -- also determines indent level for space indent"` SpaceIndent bool `desc:"use spaces for indentation, otherwise tabs"` WordWrap bool `desc:"wrap lines at word boundaries -- otherwise long lines scroll off the end"` LineNos bool `desc:"show line numbers"` Completion bool `desc:"use the completion system to suggest options while typing"` SpellCorrect bool `desc:"suggest corrections for unknown words while typing"` AutoIndent bool `desc:"automatically indent lines when enter, tab, }, etc pressed"` EmacsUndo bool `` /* 165-byte string literal not displayed */ DepthColor bool `desc:"colorize the background according to nesting depth"` }
EditorPrefs contains editor preferences
func (*EditorPrefs) ConfigTextBuf ¶ added in v0.5.4
func (pf *EditorPrefs) ConfigTextBuf(tb *giv.TextBuf)
ConfigTextBuf sets TextBuf Opts according to prefs
func (*EditorPrefs) Defaults ¶
func (pf *EditorPrefs) Defaults()
Defaults are the defaults for EditorPrefs
type FileNode ¶
FileNode is Gide version of FileNode for FileTree view
func (*FileNode) ExecCmdFile ¶
func (fn *FileNode) ExecCmdFile()
ExecCmdFile pops up a menu to select a command appropriate for the given node, and shows output in MainTab with name of command
func (*FileNode) ExecCmdNameFile ¶
ExecCmdNameFile executes given command name on node
type FilePrefs ¶
type FilePrefs struct {
DirsOnTop bool `desc:"if true, then all directories are placed at the top of the tree view -- otherwise everything is alpha sorted"`
}
FilePrefs contains file view preferences
type FileSearchResults ¶
type FileSearchResults struct { Node *giv.FileNode Count int Matches []giv.FileSearchMatch }
FileSearchResults is used to report search results
func FileTreeSearch ¶
func FileTreeSearch(start *giv.FileNode, find string, ignoreCase bool, loc FindLoc, activeDir string, langs []filecat.Supported) []FileSearchResults
FileTreeSearch returns list of all nodes starting at given node of given language(s) that contain the given string (non regexp version), sorted in descending order by number of occurrences -- ignoreCase transforms everything into lowercase
type FileTreeView ¶
type FileTreeView struct {
giv.FileTreeView
}
FileTreeView is a TreeView that knows how to operate on FileNode nodes
func (*FileTreeView) ExecCmdFiles ¶
func (ft *FileTreeView) ExecCmdFiles(cmdNm string)
ExecCmdFiles calls given command on selected files
func (*FileTreeView) FileNode ¶
func (ft *FileTreeView) FileNode() *FileNode
FileNode returns the SrcNode as a *gide* FileNode
func (*FileTreeView) ViewFiles ¶
func (ft *FileTreeView) ViewFiles()
ViewFiles calls ViewFile on selected files
type FindLoc ¶
type FindLoc int
FindLoc corresponds to the search scope
const ( // FindLocAll finds in all open folders in the left file browser FindLocAll FindLoc = iota // FindLocFile only finds in the current active file FindLocFile // FindLocDir only finds in the directory of the current active file FindLocDir // FindLocNotTop finds in all open folders *except* the top-level folder FindLocNotTop // FindLocN is the number of find locations (scopes) FindLocN )
func (*FindLoc) FromString ¶
func (*FindLoc) UnmarshalJSON ¶
UnmarshalJSON decodes
type FindParams ¶
type FindParams struct { Find string `desc:"find string"` Replace string `desc:"replace string"` IgnoreCase bool `desc:"ignore case"` Langs []filecat.Supported `desc:"languages for files to search"` Loc FindLoc `desc:"locations to search in"` FindHist []string `desc:"history of finds"` ReplHist []string `desc:"history of replaces"` }
FindParams are parameters for find / replace
type FindView ¶
type FindView struct { gi.Layout Gide Gide `json:"-" xml:"-" desc:"parent gide project"` LangVV giv.ValueView `desc:"langs value view"` Time time.Time `desc:"time of last find"` }
FindView is a find / replace widget that displays results in a TextView and has a toolbar for controlling find / replace process.
func (*FindView) 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
func (*FindView) ReplaceAllAction ¶
func (fv *FindView) ReplaceAllAction()
ReplaceAllAction performs replace all
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) StdConfig ¶
func (fv *FindView) StdConfig() kit.TypeAndNameList
StdConfig returns a TypeAndNameList for configuring a standard Frame -- can modify as desired before calling ConfigChildren on Frame using this
func (*FindView) StdFindConfig ¶
StdFindConfig configures a standard setup of the overall layout -- returns mods, updt from ConfigChildren and does NOT call UpdateEnd
func (*FindView) TextViewLay ¶
TextViewLay returns the find results TextView layout
func (*FindView) UpdateView ¶
UpdateView updates view with current settings
type Gide ¶
type Gide interface { gi.Node2D // VPort returns the viewport for the view VPort() *gi.Viewport2D // ProjPrefs() returns the gide.ProjPrefs ProjPrefs() *ProjPrefs // CmdRuns returns the CmdRuns manager of running commands, used extensively // in commands.go CmdRuns() *CmdRuns // ArgVarVals returns the ArgVarVals argument variable values ArgVarVals() *ArgVarVals // SetStatus updates the statusbar label with given message, along with other status info SetStatus(msg string) // SelectMainTabByName Selects given main tab, and returns all of its contents as well. SelectMainTabByName(label string) (gi.Node2D, int, bool) // FocusOnMainTabs moves keyboard focus to MainTabs panel -- returns false if nothing at that tab FocusOnMainTabs() bool // NextViewFileNode sets the next text view to view file in given node (opens // buffer if not already opened) -- if already being viewed, that is // activated, returns text view and index NextViewFileNode(fn *giv.FileNode) (*giv.TextView, int) // ActiveTextView returns the currently-active TextView ActiveTextView() *giv.TextView // ConfigOutputTextView configures a command-output textview within given parent layout ConfigOutputTextView(ly *gi.Layout) *giv.TextView // ExecCmdFileNode pops up a menu to select a command appropriate for the given node, // and shows output in MainTab with name of command ExecCmdFileNode(fn *giv.FileNode) // ExecCmdNameFileNode executes command of given name on given node ExecCmdNameFileNode(fn *giv.FileNode, cmdNm CmdName, sel bool, clearBuf bool) // ExecCmdNameFileName executes command of given name on given file name ExecCmdNameFileName(fn string, cmdNm CmdName, sel bool, clearBuf bool) // Find does Find / Replace in files, using given options and filters -- opens up a // main tab with the results and further controls. Find(find, repl string, ignoreCase bool, loc FindLoc, langs []filecat.Supported) // ParseOpenFindURL parses and opens given find:/// url from Find, return text // region encoded in url, and starting line of results in find buffer, and // number of results returned -- for parsing all the find results ParseOpenFindURL(ur string, ftv *giv.TextView) (tv *giv.TextView, reg giv.TextRegion, findBufStLn, findCount int, ok bool) // Spell checks spelling in files Spell() // Symbols calls a function to parse file or package Symbols() }
Gide provides the interface for the GideView functionality that is needed by the core gide infrastructure, to allow GideView to be in a separate package. It is not intended to be the full functionality of the GideView.
type KeyFuns ¶
type KeyFuns int32
KeyFuns (i.e. gide.KeytFuns) are special functions for the overall control of the system -- moving between windows, running commands, etc. Multi-key sequences can be used.
const ( KeyFunNil KeyFuns = iota KeyFunNeeds2 // special internal signal returned by KeyFun indicating need for second key KeyFunNextPanel // move to next panel to the right KeyFunPrevPanel // move to prev panel to the left KeyFunFileOpen // open a new file in active textview KeyFunBufSelect // select an open buffer to edit in active textview KeyFunBufClone // open active file in other view KeyFunBufSave // save active textview buffer to its file KeyFunBufSaveAs // save as active textview buffer to its file KeyFunBufClose // close active textview buffer KeyFunExecCmd // execute a command on active textview buffer KeyFunRegCopy // copy selection to named register KeyFunRegPaste // paste selection from named register KeyFunCommentOut // comment out region KeyFunIndent // indent region KeyFunJump // jump to line (same as gi.KeyFunJump) KeyFunSetSplit // set named splitter config KeyFunBuildProj // build overall project KeyFunRunProj // run overall project KeyFunsN )
func KeyFun ¶
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 { Keys KeySeq `desc:"the key chord sequence that activates a function"` Fun KeyFuns `desc:"the function of that key"` }
KeyMapItem records one element of the key map -- used for organizing the map.
type KeyMapName ¶
type KeyMapName string
KeyMapName has an associated ValueView for selecting from the list of available key map names, for use in preferences etc.
var ActiveKeyMapName KeyMapName
ActiveKeyMapName is the name of the active keymap
func (KeyMapName) ValueView ¶
func (kn KeyMapName) ValueView() giv.ValueView
ValueView registers KeyMapValueView as the viewer of KeyMapName
type KeyMapValueView ¶
type KeyMapValueView struct {
giv.ValueViewBase
}
KeyMapValueView presents an action for displaying an KeyMapName and selecting from KeyMapChooserDialog
func (*KeyMapValueView) Activate ¶
func (vv *KeyMapValueView) Activate(vp *gi.Viewport2D, dlgRecv ki.Ki, dlgFunc ki.RecvFunc)
func (*KeyMapValueView) ConfigWidget ¶
func (vv *KeyMapValueView) ConfigWidget(widg gi.Node2D)
func (*KeyMapValueView) HasAction ¶
func (vv *KeyMapValueView) HasAction() bool
func (*KeyMapValueView) UpdateWidget ¶
func (vv *KeyMapValueView) UpdateWidget()
func (*KeyMapValueView) WidgetType ¶
func (vv *KeyMapValueView) WidgetType() reflect.Type
type KeyMaps ¶
type KeyMaps []KeyMapsItem
KeyMaps is a list of KeyMap's -- users can edit these in Prefs -- to create a custom one, just duplicate an existing map, rename, and customize
var AvailKeyMaps KeyMaps
AvailKeyMaps is the current list of available keymaps for use -- can be loaded / saved / edited with preferences. This is set to StdKeyMaps at startup.
func (*KeyMaps) 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 string `width:"20" desc:"name of keymap"` Desc string `desc:"description of keymap -- good idea to include source it was derived from"` Map KeySeqMap `` /* 127-byte string literal not displayed */ }
KeyMapsItem is an entry in a KeyMaps list
func (KeyMapsItem) Label ¶
func (km KeyMapsItem) Label() string
Label satisfies the Labeler interface
type KeySeq ¶
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 {
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
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 { HiStyle histyle.StyleName `desc:"highilighting style / theme"` FontFamily gi.FontName `desc:"monospaced font family for editor"` Files FilePrefs `desc:"file view preferences"` Editor EditorPrefs `view:"inline" desc:"editor preferences"` KeyMap KeyMapName `desc:"key map for gide-specific keyboard sequences"` SaveKeyMaps bool `` /* 403-byte string literal not displayed */ SaveLangOpts bool `` /* 231-byte string literal not displayed */ SaveCmds bool `` /* 228-byte string literal not displayed */ Changed bool `` /* 164-byte string literal not displayed */ }
Preferences are the overall user preferences for Gide.
func (*Preferences) Apply ¶
func (pf *Preferences) Apply()
Apply preferences updates things according with settings
func (*Preferences) Defaults ¶
func (pf *Preferences) Defaults()
Defaults are the defaults for Preferences
func (*Preferences) EditCmds ¶
func (pf *Preferences) EditCmds()
EditCmds opens the CmdsView editor to customize commands you can run.
func (*Preferences) EditHiStyles ¶
func (pf *Preferences) EditHiStyles()
EditHiStyles opens the HiStyleView editor to customize highlighting styles
func (*Preferences) EditKeyMaps ¶
func (pf *Preferences) EditKeyMaps()
EditKeyMaps opens the KeyMapsView editor to create new keymaps / save / load from other files, etc. Current avail keymaps are saved and loaded with preferences automatically.
func (*Preferences) EditLangOpts ¶ added in v0.5.4
func (pf *Preferences) EditLangOpts()
EditLangOpts opens the LangsView editor to customize options for each type of language / data / file type.
func (*Preferences) EditRegisters ¶
func (pf *Preferences) EditRegisters()
EditRegisters opens the RegistersView editor to customize saved registers
func (*Preferences) EditSplits ¶
func (pf *Preferences) EditSplits()
EditSplits opens the SplitsView editor to customize saved splitter settings
func (*Preferences) Open ¶
func (pf *Preferences) Open() error
Open preferences from GoGi standard prefs directory, and applies them
func (*Preferences) Save ¶
func (pf *Preferences) Save() error
Save Preferences to GoGi standard prefs directory
func (*Preferences) VersionInfo ¶ added in v0.5.1
func (pf *Preferences) VersionInfo() string
VersionInfo returns Gide version information
type ProjPrefs ¶
type ProjPrefs struct { Files FilePrefs `desc:"file view preferences"` Editor EditorPrefs `view:"inline" desc:"editor preferences"` SplitName SplitName `desc:"current named-split config in use for configuring the splitters"` MainLang filecat.Supported `` /* 135-byte string literal not displayed */ VersCtrl giv.VersCtrlName `desc:"the type of version control system used in this project (git, svn, etc) -- filters commands available"` ProjFilename gi.FileName `` /* 131-byte string literal not displayed */ ProjRoot gi.FileName `` /* 217-byte string literal not displayed */ BuildCmds CmdNames `desc:"command(s) to run for main Build button"` BuildDir gi.FileName `` /* 165-byte string literal not displayed */ BuildTarg gi.FileName `desc:"build target for main Build button, if relevant for your BuildCmds"` RunExec gi.FileName `desc:"executable to run for this project via main Run button -- called by standard Run Proj command"` RunCmds CmdNames `desc:"command(s) to run for main Run button (typically Run Proj)"` Find FindParams `view:"-" desc:"saved find params"` Spell SpellParams `view:"-" desc:"saved spell params"` Symbols SymbolsParams `view:"-" desc:"saved structure params"` OpenDirs giv.OpenDirMap `view:"-" desc:"open directories"` Register RegisterName `view:"-" desc:"last register used"` Splits []float32 `view:"-" desc:"current splitter splits"` Changed bool `` /* 164-byte string literal not displayed */ }
ProjPrefs are the preferences for saving for a project -- this IS the project file
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 SpellParams ¶
type SpellParams struct { }
SpellParams are parameters for spell check and correction
type SpellView ¶
type SpellView struct { gi.Layout Gide Gide `json:"-" xml:"-" desc:"parent gide project"` Spell SpellParams `desc:"params for spelling"` Unknown gi.TextWord `desc:"current unknown/misspelled word"` Suggestions []string `desc:"a list of suggestions from spell checker"` ChangeOffset int `desc:"compensation for change word length different than original word"` PreviousLine int `desc:"line of previous unknown word"` CurrentLine int `desc:"line of current unknown word"` LastAction *gi.Action `desc:"last user action (ignore, change, learn)"` }
SpellView is a widget that displays results of spell check
func (*SpellView) AcceptSuggestion ¶
AcceptSuggestion replaces the misspelled word with the word in the ChangeText field
func (*SpellView) AdjustTextPos ¶
AdjustTextPos adjust the character position to compensate for replacement text being different length than original text
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) OpenSpellURL ¶
OpenSpellURL opens given spell:/// url from Find
func (*SpellView) SetUnknownAndSuggest ¶
SetUnknownAndSuggest sets the textfield unknown with the best suggestion and fills the suggestions with all suggestions up to the max
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) SpellNextAct ¶
SpellNextAct returns the spell next action from toolbar
func (*SpellView) StdConfig ¶
func (sv *SpellView) StdConfig() kit.TypeAndNameList
StdConfig returns a TypeAndNameList for configuring a standard Frame -- can modify as desired before calling ConfigChildren on Frame using this
func (*SpellView) StdSpellConfig ¶
StdSpellConfig configures a standard setup of the overall layout -- returns mods, updt from ConfigChildren and does NOT call UpdateEnd
func (*SpellView) SuggestBar ¶
SuggestBar returns the suggest toolbar
func (*SpellView) SuggestView ¶
SuggestView returns the view for the list of suggestions
func (*SpellView) TextViewLay ¶
TextViewLay returns the spell check results TextView layout
func (*SpellView) TrainAction ¶
func (sv *SpellView) TrainAction()
TrainAction allows you to train on additional text files and also to rebuild the spell model
func (*SpellView) UnknownBar ¶
UnknownBar returns the toolbar that displays the unknown word
func (*SpellView) UnknownEndPos ¶
UnknownEndPos returns the end position of the current unknown word adjusted for any prior replacement text
func (*SpellView) UnknownStartPos ¶
UnknownStartPos returns the start position of the current unknown word adjusted for any prior replacement text
func (*SpellView) UnknownText ¶
UnknownText returns the unknown word textfield from toolbar
func (*SpellView) UpdateView ¶
func (sv *SpellView) UpdateView(ge Gide, sp SpellParams)
UpdateView updates view with current settings
type Split ¶
type Split struct { Name string `desc:"name of splitter config"` Desc string `desc:"brief description"` Splits []float32 `min:"0" max:"1" step:".05" fixed-len:"5" desc:"splitter panel proportions"` }
Split is a named splitter configuration
func (*Split) 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) OpenPrefs ¶
OpenPrefs opens Splits from App standard prefs directory, using PrefSplitsFileName
type SymNode ¶ added in v0.5.6
type SymNode struct { ki.Node Symbol syms.Symbol `desc:"a string"` SRoot *SymTree `json:"-" xml:"-" desc:"root of the tree -- has global state"` }
SymNode represents a language symbol -- the name of the node is the name of the symbol. Some symbols, e.g. type have children
type SymTree ¶ added in v0.5.6
type SymTree struct { SymNode NodeType reflect.Type `view:"-" json:"-" qxml:"-" desc:"type of node to create -- defaults to giv.FileNode but can use custom node types"` View *SymbolsView }
SymTree is the root of a tree representing symbols of a package or file
func (*SymTree) OpenTree ¶ added in v0.5.6
func (st *SymTree) OpenTree(view *SymbolsView)
OpenTree opens a SymTree of symbols from a file or package parse
type SymbolsParams ¶ added in v0.5.6
type SymbolsParams struct { }
SymbolsParams are parameters for structure view of file or package
type SymbolsView ¶ added in v0.5.6
type SymbolsView struct { gi.Layout Gide Gide `json:"-" xml:"-" desc:"parent gide project"` SymParams SymbolsParams `desc:"params for structure display"` SymsTree SymTree `desc:"all the syms for the file or package in a tree"` }
SymbolsView is a widget that displays results of a file or package parse
func (*SymbolsView) ConfigToolbar ¶ added in v0.5.6
func (sv *SymbolsView) ConfigToolbar()
ConfigToolbar adds toolbar.
func (*SymbolsView) ConfigTree ¶ added in v0.5.6
func (sv *SymbolsView) ConfigTree()
ConfigTree adds a treeview to the symbolsview
func (*SymbolsView) OpenSymbolsURL ¶ added in v0.5.6
func (sv *SymbolsView) OpenSymbolsURL(ur string, ftv *giv.TextView) bool
OpenSymbolsURL opens given symbols:/// url from Find
func (*SymbolsView) SelectSymbol ¶ added in v0.5.6
func (sv *SymbolsView) SelectSymbol(ssym syms.Symbol)
func (*SymbolsView) StdConfig ¶ added in v0.5.6
func (sv *SymbolsView) StdConfig() kit.TypeAndNameList
StdConfig returns a TypeAndNameList for configuring a standard Frame -- can modify as desired before calling ConfigChildren on Frame using this
func (*SymbolsView) StdSymbolsConfig ¶ added in v0.5.6
func (sv *SymbolsView) StdSymbolsConfig() (mods, updt bool)
StdSymbolsConfig configures a standard setup of the overall layout -- returns mods, updt from ConfigChildren and does NOT call UpdateEnd
func (*SymbolsView) SymbolsAction ¶ added in v0.5.6
func (sv *SymbolsView) SymbolsAction()
SymbolsAction runs a new parse with current params
func (*SymbolsView) SymbolsBar ¶ added in v0.5.6
func (sv *SymbolsView) SymbolsBar() *gi.ToolBar
SymbolsBar returns the spell toolbar
func (*SymbolsView) SymbolsTree ¶ added in v0.5.6
func (sv *SymbolsView) SymbolsTree() *gi.Frame
SymbolsBar returns the spell toolbar
func (*SymbolsView) UpdateView ¶ added in v0.5.6
func (sv *SymbolsView) UpdateView(ge Gide, sp SymbolsParams)
UpdateView updates view with current settings