diff --git a/code/README.md b/code/README.md
index 9d8416e0..6a0b16d5 100644
--- a/code/README.md
+++ b/code/README.md
@@ -1,8 +1,8 @@
![alt tag](logo/code_icon.png)
-**Code** is a flexible IDE (integrated development environment) framework in pure Go, using the [GoGi](https://cogentcore.org/core/gi) GUI (for which it serves as a continuous testing platform :) and the [GoPi](https://cogentcore.org/core/pi) interactive parser for syntax highlighting and more advanced IDE code processing.
+**Code** is a flexible IDE (integrated development environment) framework in pure Go, using the [Cogent Core](https://cogentcore.org/core/gi) GUI (for which it serves as a continuous testing platform :) and the [GoPi](https://cogentcore.org/core/pi) interactive parser for syntax highlighting and more advanced IDE code processing.
-See the [Wiki](https://cogentcore.org/cogent/code/wiki) for more docs, [Install](https://cogentcore.org/cogent/code/wiki/Install) instructions (`go install cogentcore.org/cogent/code/cmd/code@latest` should work if GoGi system libraries are in place), and [Google Groups goki-gi](https://groups.google.com/forum/#!forum/goki-gi) emailing list.
+See the [Wiki](https://cogentcore.org/cogent/code/wiki) for more docs, [Install](https://cogentcore.org/cogent/code/wiki/Install) instructions (`go install cogentcore.org/cogent/code/cmd/code@latest` should work if Cogent Core system libraries are in place), and [Google Groups goki-gi](https://groups.google.com/forum/#!forum/goki-gi) emailing list.
[![Go Report Card](https://goreportcard.com/badge/cogentcore.org/cogent/code/v2)](https://goreportcard.com/report/cogentcore.org/cogent/code/v2)
[![GoDoc](https://godoc.org/cogentcore.org/cogent/code/v2?status.svg)](https://godoc.org/cogentcore.org/cogent/code/v2)
diff --git a/code/cdebug/vars.go b/code/cdebug/vars.go
index f72d6fd6..5d788613 100644
--- a/code/cdebug/vars.go
+++ b/code/cdebug/vars.go
@@ -213,7 +213,7 @@ type VarParams struct {
}
// Params are overall debugger parameters
-type Params struct {
+type Params struct { //gti:add
// mode for running the debugger
Mode Modes `xml:"-" toml:"-" json:"-" view:"-"`
@@ -221,7 +221,10 @@ type Params struct {
// process id number to attach to, for Attach mode
PID uint64 `xml:"-" toml:"-" json:"-" view:"-"`
- // optional extra args to pass to the debugger. Use double-dash -- and then add args to pass args to the executable (double-dash is by itself as a separate arg first)
+ // optional extra args to pass to the debugger.
+ // Use -- double-dash and then add args to pass args to the executable
+ // (double-dash is by itself as a separate arg first).
+ // For Debug test, must use -test.run instead of plain -run to specify tests to run.
Args []string
// status function for debugger updating status
diff --git a/code/cmd/pie/pie.go b/code/cmd/pie/pie.go
index 8f7d4e3f..f56eaae9 100644
--- a/code/cmd/pie/pie.go
+++ b/code/cmd/pie/pie.go
@@ -7,7 +7,7 @@ package main
func main() {
/*
goosi.TheApp.SetName("pie")
- goosi.TheApp.SetAbout(`Pie
is the interactive parser (pi) editor written in the GoGi graphical interface system, within the Goki tree framework. See Code on GitHub and Code wiki for documentation.
+ goosi.TheApp.SetAbout(`Pie
is the interactive parser (pi) editor written in the Cogent Core graphical interface system, within the Goki tree framework. See Code on GitHub and Code wiki for documentation.
Version: ` + pi.VersionInfo())
diff --git a/code/code/argvars.go b/code/code/argvars.go
index dacb9e63..fdb38e13 100644
--- a/code/code/argvars.go
+++ b/code/code/argvars.go
@@ -84,7 +84,7 @@ var ArgVars = map[string]ArgVarInfo{
type ArgVarVals map[string]string
// Set sets the current values for arg variables -- prompts must be already set!
-func (avp *ArgVarVals) Set(fpath string, ppref *ProjPrefs, tv *texteditor.Editor) {
+func (avp *ArgVarVals) Set(fpath string, ppref *ProjSettings, tv *texteditor.Editor) {
if *avp == nil {
*avp = make(ArgVarVals, len(ArgVars))
}
diff --git a/code/code/argvars_test.go b/code/code/argvars_test.go
index ba53b9e7..85becb9c 100644
--- a/code/code/argvars_test.go
+++ b/code/code/argvars_test.go
@@ -21,7 +21,7 @@ func TestBind(t *testing.T) {
fpath := "/Users/oreilly/go/src/cogentcore.org/cogent/code/argvars_test.go"
projpath := "/Users/oreilly/go/src/github.com"
- pp := ProjPrefs{}
+ pp := ProjSettings{}
pp.ProjRoot = gi.Filename(projpath)
var avp ArgVarVals
diff --git a/code/code/code.go b/code/code/code.go
index 92552d5f..8c4d3c2e 100644
--- a/code/code/code.go
+++ b/code/code/code.go
@@ -26,8 +26,8 @@ import (
type Code interface {
gi.Widget
- // ProjPrefs returns the code.ProjPrefs
- ProjPrefs() *ProjPrefs
+ // ProjSettings returns the code.ProjSettings
+ ProjSettings() *ProjSettings
// FileTree returns the code.Files file tree
FileTree() *filetree.Tree
@@ -37,7 +37,7 @@ type Code interface {
LastSaveTime() time.Time
// VersCtrl returns the version control system in effect, using the file tree detected
- // version or whatever is set in project preferences
+ // version or whatever is set in project settings
VersCtrl() filetree.VersCtrlName
// CmdRuns returns the CmdRuns manager of running commands, used extensively
@@ -87,7 +87,7 @@ type Code interface {
// ActiveTextEditor returns the currently-active TextEditor
ActiveTextEditor() *TextEditor
- // SetActiveTextEditor sets the given textview as the active one, and returns its index
+ // SetActiveTextEditor sets the given texteditor as the active one, and returns its index
SetActiveTextEditor(av *TextEditor) int
// ActiveFileNode returns the file node for the active file -- nil if none
@@ -130,8 +130,11 @@ type Code interface {
// called prior to rename.
CloseOpenNodes(nodes []*FileNode)
+ // CurOpenNodes returns the current open nodes list
+ CurOpenNodes() *OpenNodes
+
// LookupFun is the completion system Lookup function that makes a custom
- // textview dialog that has option to edit resulting file.
+ // texteditor dialog that has option to edit resulting file.
LookupFun(data any, text string, posLn, posCh int) (ld complete.Lookup)
// Spell checks spelling in active text view
diff --git a/code/code/commands.go b/code/code/commands.go
index a8d87bb9..7f913029 100644
--- a/code/code/commands.go
+++ b/code/code/commands.go
@@ -646,7 +646,7 @@ func MarkupCmdOutput(out []byte) []byte {
type Commands []*Command
// CmdName has an associated ValueView for selecting from the list of
-// available command names, for use in preferences etc.
+// available command names, for use in settings etc.
// Formatted as Cat: Name as in Command.Label()
type CmdName string
@@ -676,7 +676,7 @@ func (cn *CmdNames) Add(cmd CmdName) {
// the same names.
var AvailCmds Commands
-// CustomCmds is user-specific list of commands saved in preferences available
+// CustomCmds is user-specific list of commands saved in settings available
// for all Code projects. These will override StdCmds with the same names.
var CustomCmds = Commands{}
@@ -723,7 +723,7 @@ func (cm *Commands) CmdByName(name CmdName, msg bool) (*Command, int, bool) {
return nil, -1, false
}
-// PrefsCmdsFilename is the name of the preferences file in App prefs
+// PrefsCmdsFilename is the name of the settings file in App prefs
// directory for saving / loading your CustomCmds commands list
var PrefsCmdsFilename = "command_prefs.toml"
diff --git a/code/code/debugview.go b/code/code/debugview.go
index 9d028ddb..222dac3b 100644
--- a/code/code/debugview.go
+++ b/code/code/debugview.go
@@ -58,7 +58,7 @@ var Debuggers = map[fi.Known]func(path, rootPath string, outbuf *texteditor.Buf,
func NewDebugger(sup fi.Known, path, rootPath string, outbuf *texteditor.Buf, pars *cdebug.Params) (cdebug.GiDebug, error) {
df, ok := Debuggers[sup]
if !ok {
- err := fmt.Errorf("Gi Debug: File type %v not supported -- change the MainLang in File/Project Prefs.. to a supported language (Go only option so far)", sup)
+ err := fmt.Errorf("Gi Debug: File type %v not supported -- change the MainLang in File/Project Settings.. to a supported language (Go only option so far)", sup)
log.Println(err)
return nil, err
}
@@ -173,8 +173,8 @@ func (dv *DebugView) Start() {
if dv.Dbg != nil {
dv.Detach()
}
- rootPath := string(dv.Code.ProjPrefs().ProjRoot)
- pars := &dv.Code.ProjPrefs().Debug
+ rootPath := string(dv.Code.ProjSettings().ProjRoot)
+ pars := &dv.Code.ProjSettings().Debug
dv.State.Mode = pars.Mode
pars.StatFunc = func(stat cdebug.Status) {
updt := dv.UpdateStartAsync()
@@ -933,6 +933,14 @@ func (dv *DebugView) ConfigToolbar() {
OnClick(func(e events.Event) {
giv.CallFunc(dv, dv.ListGlobalVars)
})
+
+ gi.NewButton(tb).SetText("Params").SetIcon(icons.Edit).
+ SetTooltip("edit the debugger parameters (e.g., for passing args: use -- (double dash) to separate args passed to program vs. those passed to the debugger itself)").
+ StyleFirst(func(s *styles.Style) { s.SetEnabled(dv.DbgIsAvail()) }).
+ OnClick(func(e events.Event) {
+ DebugSettingsView(&dv.Code.ProjSettings().Debug)
+ })
+
}
//////////////////////////////////////////////////////////////////////////////////////
diff --git a/code/code/doc.go b/code/code/doc.go
index 55fdf0d8..48cd7684 100644
--- a/code/code/doc.go
+++ b/code/code/doc.go
@@ -4,7 +4,7 @@
// Package code provides all the code infrastructure and supporting gui
// for filetree, commands, console, and 2-sequence key functions,
-// preferences, splitviews, etc.
+// settings, splitviews, etc.
//
// CodeView is in a separate codev directory so that other packages can
// tap into the code infrastructure, and be callable directly from the
diff --git a/code/code/enumgen.go b/code/code/enumgen.go
index ca892189..3b0d34bf 100644
--- a/code/code/enumgen.go
+++ b/code/code/enumgen.go
@@ -139,32 +139,32 @@ const FindLocN FindLoc = 5
// Re-run the enumgen command to generate them again.
func _FindLocNoOp() {
var x [1]struct{}
- _ = x[FindLocAll-(0)]
- _ = x[FindLocOpen-(1)]
+ _ = x[FindLocOpen-(0)]
+ _ = x[FindLocAll-(1)]
_ = x[FindLocFile-(2)]
_ = x[FindLocDir-(3)]
_ = x[FindLocNotTop-(4)]
}
var _FindLocNameToValueMap = map[string]FindLoc{
- `All`: 0,
- `Open`: 1,
+ `Open`: 0,
+ `All`: 1,
`File`: 2,
`Dir`: 3,
`NotTop`: 4,
}
var _FindLocDescMap = map[FindLoc]string{
- 0: `FindLocAll finds in all directories under the root path`,
- 1: `FindOpen finds in all open folders in the left file browser`,
+ 0: `FindOpen finds in all open folders in the left file browser`,
+ 1: `FindLocAll finds in all directories under the root path. can be slow for large file trees`,
2: `FindLocFile only finds in the current active file`,
3: `FindLocDir only finds in the directory of the current active file`,
4: `FindLocNotTop finds in all open folders *except* the top-level folder`,
}
var _FindLocMap = map[FindLoc]string{
- 0: `All`,
- 1: `Open`,
+ 0: `Open`,
+ 1: `All`,
2: `File`,
3: `Dir`,
4: `NotTop`,
@@ -308,13 +308,13 @@ var _KeyFunsDescMap = map[KeyFuns]string{
1: `special internal signal returned by KeyFun indicating need for second key`,
2: `move to next panel to the right`,
3: `move to prev panel to the left`,
- 4: `open a new file in active textview`,
- 5: `select an open buffer to edit in active textview`,
+ 4: `open a new file in active texteditor`,
+ 5: `select an open buffer to edit in active texteditor`,
6: `open active file in other view`,
- 7: `save active textview buffer to its file`,
- 8: `save as active textview buffer to its file`,
- 9: `close active textview buffer`,
- 10: `execute a command on active textview buffer`,
+ 7: `save active texteditor buffer to its file`,
+ 8: `save as active texteditor buffer to its file`,
+ 9: `close active texteditor buffer`,
+ 10: `execute a command on active texteditor buffer`,
11: `copy rectangle`,
12: `cut rectangle`,
13: `paste rectangle`,
diff --git a/code/code/filetree.go b/code/code/filetree.go
index 58974afa..58debf25 100644
--- a/code/code/filetree.go
+++ b/code/code/filetree.go
@@ -78,8 +78,8 @@ func (fn *FileNode) SetRunExec() {
}
ge, ok := ParentCode(fn.This())
if ok {
- ge.ProjPrefs().RunExec = fn.FPath
- ge.ProjPrefs().BuildDir = gi.Filename(filepath.Dir(string(fn.FPath)))
+ ge.ProjSettings().RunExec = fn.FPath
+ ge.ProjSettings().BuildDir = gi.Filename(filepath.Dir(string(fn.FPath)))
}
}
@@ -237,6 +237,16 @@ func (on *OpenNodes) NChanged() int {
return cnt
}
+// FindPath finds node for given path, nil if not found
+func (on *OpenNodes) FindPath(path string) *filetree.Node {
+ for _, f := range *on {
+ if f.FPath == gi.Filename(path) {
+ return f
+ }
+ }
+ return nil
+}
+
//////////////////////////////////////////////////////////////////////////
// Search
@@ -250,14 +260,14 @@ type FileSearchResults struct {
// FileTreeSearch returns list of all nodes starting at given node of given
// language(s) that contain the given string, sorted in descending order by number
// of occurrences -- ignoreCase transforms everything into lowercase
-func FileTreeSearch(start *filetree.Node, find string, ignoreCase, regExp bool, loc FindLoc, activeDir string, langs []fi.Known) []FileSearchResults {
+func FileTreeSearch(ge Code, start *filetree.Node, find string, ignoreCase, regExp bool, loc FindLoc, activeDir string, langs []fi.Known) []FileSearchResults {
fb := []byte(find)
fsz := len(find)
if fsz == 0 {
return nil
}
if loc == FindLocAll {
- return FindAll(start, find, ignoreCase, regExp, langs)
+ return FindAll(ge, start, find, ignoreCase, regExp, langs)
}
var re *regexp.Regexp
var err error
@@ -331,7 +341,7 @@ func FileTreeSearch(start *filetree.Node, find string, ignoreCase, regExp bool,
// starting at given node of given language(s) that contain the given string,
// sorted in descending order by number of occurrences. ignoreCase transforms
// everything into lowercase.
-func FindAll(start *filetree.Node, find string, ignoreCase, regExp bool, langs []fi.Known) []FileSearchResults {
+func FindAll(ge Code, start *filetree.Node, find string, ignoreCase, regExp bool, langs []fi.Known) []FileSearchResults {
fb := []byte(find)
fsz := len(find)
if fsz == 0 {
@@ -374,14 +384,14 @@ func FindAll(start *filetree.Node, find string, ignoreCase, regExp bool, langs [
return nil
}
}
- sfn, found := start.FindFile(path)
+ ofn := ge.CurOpenNodes().FindPath(path)
var cnt int
var matches []textbuf.Match
- if found && sfn.IsOpen() && sfn.Buf != nil {
+ if ofn != nil && ofn.Buf != nil {
if regExp {
- cnt, matches = sfn.Buf.SearchRegexp(re)
+ cnt, matches = ofn.Buf.SearchRegexp(re)
} else {
- cnt, matches = sfn.Buf.Search(fb, ignoreCase, false)
+ cnt, matches = ofn.Buf.Search(fb, ignoreCase, false)
}
} else {
if regExp {
@@ -391,10 +401,15 @@ func FindAll(start *filetree.Node, find string, ignoreCase, regExp bool, langs [
}
}
if cnt > 0 {
- if found {
- mls = append(mls, FileSearchResults{sfn, cnt, matches})
+ if ofn != nil {
+ mls = append(mls, FileSearchResults{ofn, cnt, matches})
} else {
- fmt.Println("file not found in FindFile:", path)
+ sfn, found := start.FindFile(path)
+ if found {
+ mls = append(mls, FileSearchResults{sfn, cnt, matches})
+ } else {
+ fmt.Println("file not found in FindFile:", path)
+ }
}
}
return nil
diff --git a/code/code/findview.go b/code/code/findview.go
index 225d4414..724be808 100644
--- a/code/code/findview.go
+++ b/code/code/findview.go
@@ -30,11 +30,11 @@ import (
type FindLoc int32 //enums:enum -trim-prefix FindLoc
const (
- // FindLocAll finds in all directories under the root path
- FindLocAll FindLoc = iota
-
// FindOpen finds in all open folders in the left file browser
- FindLocOpen
+ FindLocOpen FindLoc = iota
+
+ // FindLocAll finds in all directories under the root path. can be slow for large file trees
+ FindLocAll
// FindLocFile only finds in the current active file
FindLocFile
@@ -94,7 +94,7 @@ type FindView struct {
// Params returns the find params
func (fv *FindView) Params() *FindParams {
- return &fv.Code.ProjPrefs().Find
+ return &fv.Code.ProjSettings().Find
}
// ShowResults shows the results in the buffer
diff --git a/code/code/gtigen.go b/code/code/gtigen.go
index 1d2b0a12..80eae947 100644
--- a/code/code/gtigen.go
+++ b/code/code/gtigen.go
@@ -284,14 +284,16 @@ func (t *FindView) SetTooltip(v string) *FindView { t.Tooltip = v; return t }
// SetStackTop sets the [FindView.StackTop]
func (t *FindView) SetStackTop(v int) *FindView { t.StackTop = v; return t }
-var _ = gti.AddType(>i.Type{Name: "cogentcore.org/cogent/code/code.SettingsData", IDName: "settings-data", Doc: "SettingsData is the data type for the overall user settings for Code.", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Methods: []gti.Method{{Name: "Apply", Doc: "Apply preferences updates things according with settings", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}, {Name: "VersionInfo", Doc: "VersionInfo returns Code version information", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Returns: []string{"string"}}, {Name: "EditKeyMaps", Doc: "EditKeyMaps opens the KeyMapsView editor to create new keymaps / save /\nload from other files, etc. Current avail keymaps are saved and loaded\nwith preferences automatically.", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}, {Name: "EditLangOpts", Doc: "EditLangOpts opens the LangsView editor to customize options for each type of\nlanguage / data / file type.", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}, {Name: "EditCmds", Doc: "EditCmds opens the CmdsView editor to customize commands you can run.", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}, {Name: "EditSplits", Doc: "EditSplits opens the SplitsView editor to customize saved splitter settings", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}, {Name: "EditRegisters", Doc: "EditRegisters opens the RegistersView editor to customize saved registers", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}}, Embeds: []gti.Field{{Name: "SettingsBase"}}, Fields: []gti.Field{{Name: "Files", Doc: "file view settings"}, {Name: "EnvVars", Doc: "environment variables to set for this app -- if run from the command line, standard shell environment variables are inherited, but on some OS's (Mac), they are not set when run as a gui app"}, {Name: "KeyMap", Doc: "key map for code-specific keyboard sequences"}, {Name: "SaveKeyMaps", Doc: "if set, the current available set of key maps is saved to your preferences directory, and automatically loaded at startup -- this should be set if you are using custom key maps, but it may be safer to keep it OFF if you are not using custom key maps, so that you'll always have the latest compiled-in standard key maps with all the current key functions bound to standard key chords"}, {Name: "SaveLangOpts", Doc: "if set, the current customized set of language options (see Edit Lang Opts) is saved / loaded along with other preferences -- if not set, then you always are using the default compiled-in standard set (which will be updated)"}, {Name: "SaveCmds", Doc: "if set, the current customized set of command parameters (see Edit Cmds) is saved / loaded along with other preferences -- if not set, then you always are using the default compiled-in standard set (which will be updated)"}}})
+var _ = gti.AddType(>i.Type{Name: "cogentcore.org/cogent/code/code.KeyMaps", IDName: "key-maps", Doc: "KeyMaps is a list of KeyMap's -- users can edit these in Prefs -- to create\na custom one, just duplicate an existing map, rename, and customize", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Methods: []gti.Method{{Name: "Open", Doc: "Open opens keymaps from a json-formatted file.", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Args: []string{"filename"}, Returns: []string{"error"}}, {Name: "Save", Doc: "Save saves keymaps to a json-formatted file.", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Args: []string{"filename"}, Returns: []string{"error"}}, {Name: "OpenSettings", Doc: "OpenSettings opens KeyMaps from App standard prefs directory, using PrefsKeyMapsFilename", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Returns: []string{"error"}}, {Name: "SavePrefs", Doc: "SavePrefs saves KeyMaps to App standard prefs directory, using PrefsKeyMapsFilename", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Returns: []string{"error"}}, {Name: "RevertToStd", Doc: "RevertToStd reverts this map to using the StdKeyMaps that are compiled into\nthe program and have all the lastest key functions bound to standard\nvalues. If you have edited your maps, and are finding things not working,\nit is a good idea to save your current maps and try this,\nor at least do ViewStdMaps to see the current standards.\nYour current map edits will be lost if you proceed!", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}, {Name: "ViewStd", Doc: "ViewStd shows the standard maps that are compiled into the program and have\nall the lastest key functions bound to standard values. Useful for\ncomparing against custom maps.", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}}})
+
+var _ = gti.AddType(>i.Type{Name: "cogentcore.org/cogent/code/code.SettingsData", IDName: "settings-data", Doc: "SettingsData is the data type for the overall user settings for Code.", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Methods: []gti.Method{{Name: "Apply", Doc: "Apply settings updates things according with settings", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}, {Name: "VersionInfo", Doc: "VersionInfo returns Code version information", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Returns: []string{"string"}}, {Name: "EditKeyMaps", Doc: "EditKeyMaps opens the KeyMapsView editor to create new keymaps / save /\nload from other files, etc. Current avail keymaps are saved and loaded\nwith settings automatically.", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}, {Name: "EditLangOpts", Doc: "EditLangOpts opens the LangsView editor to customize options for each type of\nlanguage / data / file type.", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}, {Name: "EditCmds", Doc: "EditCmds opens the CmdsView editor to customize commands you can run.", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}, {Name: "EditSplits", Doc: "EditSplits opens the SplitsView editor to customize saved splitter settings", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}, {Name: "EditRegisters", Doc: "EditRegisters opens the RegistersView editor to customize saved registers", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}}, Embeds: []gti.Field{{Name: "SettingsBase"}}, Fields: []gti.Field{{Name: "Files", Doc: "file view settings"}, {Name: "EnvVars", Doc: "environment variables to set for this app -- if run from the command line, standard shell environment variables are inherited, but on some OS's (Mac), they are not set when run as a gui app"}, {Name: "KeyMap", Doc: "key map for code-specific keyboard sequences"}, {Name: "SaveKeyMaps", Doc: "if set, the current available set of key maps is saved to your settings directory, and automatically loaded at startup -- this should be set if you are using custom key maps, but it may be safer to keep it OFF if you are not using custom key maps, so that you'll always have the latest compiled-in standard key maps with all the current key functions bound to standard key chords"}, {Name: "SaveLangOpts", Doc: "if set, the current customized set of language options (see Edit Lang Opts) is saved / loaded along with other settings -- if not set, then you always are using the default compiled-in standard set (which will be updated)"}, {Name: "SaveCmds", Doc: "if set, the current customized set of command parameters (see Edit Cmds) is saved / loaded along with other settings -- if not set, then you always are using the default compiled-in standard set (which will be updated)"}}})
var _ = gti.AddType(>i.Type{Name: "cogentcore.org/cogent/code/code.FileSettings", IDName: "file-settings", Doc: "FileSettings contains file view settings", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Fields: []gti.Field{{Name: "DirsOnTop", Doc: "if true, then all directories are placed at the top of the tree view -- otherwise everything is alpha sorted"}}})
-var _ = gti.AddType(>i.Type{Name: "cogentcore.org/cogent/code/code.ProjPrefs", IDName: "proj-prefs", Doc: "ProjPrefs are the preferences for saving for a project -- this IS the project file", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Methods: []gti.Method{{Name: "Open", Doc: "Open open from file", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Args: []string{"filename"}, Returns: []string{"error"}}, {Name: "Save", Doc: "Save save to file", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Args: []string{"filename"}, Returns: []string{"error"}}}, Fields: []gti.Field{{Name: "Files", Doc: "file view preferences"}, {Name: "Editor", Doc: "editor preferences"}, {Name: "SplitName", Doc: "current named-split config in use for configuring the splitters"}, {Name: "MainLang", Doc: "the language associated with the most frequently-encountered file extension in the file tree -- can be manually set here as well"}, {Name: "VersCtrl", Doc: "the type of version control system used in this project (git, svn, etc) -- filters commands available"}, {Name: "ProjFilename", Doc: "current project filename for saving / loading specific Code configuration information in a .code file (optional)"}, {Name: "ProjRoot", Doc: "root directory for the project -- all projects must be organized within a top-level root directory, with all the files therein constituting the scope of the project -- by default it is the path for ProjFilename"}, {Name: "GoMod", Doc: "if true, use Go modules, otherwise use GOPATH -- this sets your effective GO111MODULE environment variable accordingly, dynamically -- updated by toolbar checkbox, dynamically"}, {Name: "BuildCmds", Doc: "command(s) to run for main Build button"}, {Name: "BuildDir", Doc: "build directory for main Build button -- set this to the directory where you want to build the main target for this project -- avail as {BuildDir} in commands"}, {Name: "BuildTarg", Doc: "build target for main Build button, if relevant for your BuildCmds"}, {Name: "RunExec", Doc: "executable to run for this project via main Run button -- called by standard Run Proj command"}, {Name: "RunCmds", Doc: "command(s) to run for main Run button (typically Run Proj)"}, {Name: "Debug", Doc: "custom debugger parameters for this project"}, {Name: "Find", Doc: "saved find params"}, {Name: "Symbols", Doc: "saved structure params"}, {Name: "Dirs", Doc: "directory properties"}, {Name: "Register", Doc: "last register used"}, {Name: "Splits", Doc: "current splitter splits"}}})
+var _ = gti.AddType(>i.Type{Name: "cogentcore.org/cogent/code/code.ProjSettings", IDName: "proj-settings", Doc: "ProjSettings are the settings for saving for a project. This IS the project file", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Methods: []gti.Method{{Name: "Open", Doc: "Open open from file", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Args: []string{"filename"}, Returns: []string{"error"}}, {Name: "Save", Doc: "Save save to file", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Args: []string{"filename"}, Returns: []string{"error"}}}, Fields: []gti.Field{{Name: "Files", Doc: "file view settings"}, {Name: "Editor", Doc: "editor settings"}, {Name: "SplitName", Doc: "current named-split config in use for configuring the splitters"}, {Name: "MainLang", Doc: "the language associated with the most frequently-encountered file\nextension in the file tree -- can be manually set here as well"}, {Name: "VersCtrl", Doc: "the type of version control system used in this project (git, svn, etc).\nfilters commands available"}, {Name: "ProjFilename", Doc: "current project filename for saving / loading specific Code\nconfiguration information in a .code file (optional)"}, {Name: "ProjRoot", Doc: "root directory for the project. all projects must be organized within\na top-level root directory, with all the files therein constituting\nthe scope of the project. By default it is the path for ProjFilename"}, {Name: "GoMod", Doc: "if true, use Go modules, otherwise use GOPATH -- this sets your effective GO111MODULE environment variable accordingly, dynamically -- updated by toolbar checkbox, dynamically"}, {Name: "BuildCmds", Doc: "command(s) to run for main Build button"}, {Name: "BuildDir", Doc: "build directory for main Build button -- set this to the directory where you want to build the main target for this project -- avail as {BuildDir} in commands"}, {Name: "BuildTarg", Doc: "build target for main Build button, if relevant for your BuildCmds"}, {Name: "RunExec", Doc: "executable to run for this project via main Run button -- called by standard Run Proj command"}, {Name: "RunCmds", Doc: "command(s) to run for main Run button (typically Run Proj)"}, {Name: "Debug", Doc: "custom debugger parameters for this project"}, {Name: "Find", Doc: "saved find params"}, {Name: "Symbols", Doc: "saved structure params"}, {Name: "Dirs", Doc: "directory properties"}, {Name: "Register", Doc: "last register used"}, {Name: "Splits", Doc: "current splitter splits"}}})
// SpellViewType is the [gti.Type] for [SpellView]
-var SpellViewType = gti.AddType(>i.Type{Name: "cogentcore.org/cogent/code/code.SpellView", IDName: "spell-view", Doc: "SpellView is a widget that displays results of spell check", Embeds: []gti.Field{{Name: "Layout"}}, Fields: []gti.Field{{Name: "Code", Doc: "parent code project"}, {Name: "Text", Doc: "textview that we're spell-checking"}, {Name: "Errs", Doc: "current spelling errors"}, {Name: "CurLn", Doc: "current line in text we're on"}, {Name: "CurIdx", Doc: "current index in Errs we're on"}, {Name: "UnkLex", Doc: "current unknown lex token"}, {Name: "UnkWord", Doc: "current unknown word"}, {Name: "Suggest", Doc: "a list of suggestions from spell checker"}, {Name: "LastAction", Doc: "last user action (ignore, change, learn)"}}, Instance: &SpellView{}})
+var SpellViewType = gti.AddType(>i.Type{Name: "cogentcore.org/cogent/code/code.SpellView", IDName: "spell-view", Doc: "SpellView is a widget that displays results of spell check", Embeds: []gti.Field{{Name: "Layout"}}, Fields: []gti.Field{{Name: "Code", Doc: "parent code project"}, {Name: "Text", Doc: "texteditor that we're spell-checking"}, {Name: "Errs", Doc: "current spelling errors"}, {Name: "CurLn", Doc: "current line in text we're on"}, {Name: "CurIdx", Doc: "current index in Errs we're on"}, {Name: "UnkLex", Doc: "current unknown lex token"}, {Name: "UnkWord", Doc: "current unknown word"}, {Name: "Suggest", Doc: "a list of suggestions from spell checker"}, {Name: "LastAction", Doc: "last user action (ignore, change, learn)"}}, Instance: &SpellView{}})
// NewSpellView adds a new [SpellView] with the given name to the given parent:
// SpellView is a widget that displays results of spell check
@@ -310,7 +312,7 @@ func (t *SpellView) New() ki.Ki { return &SpellView{} }
func (t *SpellView) SetCode(v Code) *SpellView { t.Code = v; return t }
// SetText sets the [SpellView.Text]:
-// textview that we're spell-checking
+// texteditor that we're spell-checking
func (t *SpellView) SetText(v *TextEditor) *SpellView { t.Text = v; return t }
// SetErrs sets the [SpellView.Errs]:
diff --git a/code/code/keyfun.go b/code/code/keyfun.go
index 99ac3e86..6c801029 100644
--- a/code/code/keyfun.go
+++ b/code/code/keyfun.go
@@ -38,19 +38,19 @@ const (
KeyFunNextPanel
// move to prev panel to the left
KeyFunPrevPanel
- // open a new file in active textview
+ // open a new file in active texteditor
KeyFunFileOpen
- // select an open buffer to edit in active textview
+ // select an open buffer to edit in active texteditor
KeyFunBufSelect
// open active file in other view
KeyFunBufClone
- // save active textview buffer to its file
+ // save active texteditor buffer to its file
KeyFunBufSave
- // save as active textview buffer to its file
+ // save as active texteditor buffer to its file
KeyFunBufSaveAs
- // close active textview buffer
+ // close active texteditor buffer
KeyFunBufClose
- // execute a command on active textview buffer
+ // execute a command on active texteditor buffer
KeyFunExecCmd
// copy rectangle
KeyFunRectCopy
@@ -289,7 +289,7 @@ func (km *KeySeqMap) Update(kmName KeyMapName) {
// KeyMaps -- list of KeyMap's
// KeyMapName has an associated ValueView for selecting from the list of
-// available key map names, for use in preferences etc.
+// available key map names, for use in settings etc.
type KeyMapName string
// DefaultKeyMap is the overall default keymap -- reinitialized in gimain init()
@@ -316,10 +316,10 @@ func (km KeyMapsItem) Label() string {
// 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
-type KeyMaps []KeyMapsItem
+type KeyMaps []KeyMapsItem //gti:add
// AvailKeyMaps is the current list of available keymaps for use -- can be
-// loaded / saved / edited with preferences. This is set to StdKeyMaps at
+// loaded / saved / edited with settings. This is set to StdKeyMaps at
// startup.
var AvailKeyMaps KeyMaps
@@ -339,7 +339,7 @@ func (km *KeyMaps) MapByName(name KeyMapName) (*KeySeqMap, int, bool) {
return nil, -1, false
}
-// PrefsKeyMapsFilename is the name of the preferences file in App prefs
+// PrefsKeyMapsFilename is the name of the settings file in App prefs
// directory for saving / loading the default AvailKeyMaps key maps list
var PrefsKeyMapsFilename = "key_maps_prefs.json"
diff --git a/code/code/langs.go b/code/code/langs.go
index 52432793..c02f720a 100644
--- a/code/code/langs.go
+++ b/code/code/langs.go
@@ -25,7 +25,7 @@ type LangOpts struct {
type Langs map[fi.Known]*LangOpts
// AvailLangs is the current set of language options -- can be
-// loaded / saved / edited with preferences. This is set to StdLangs at
+// loaded / saved / edited with settings. This is set to StdLangs at
// startup.
var AvailLangs Langs
@@ -48,7 +48,7 @@ func (lt Langs) Validate() bool {
return ok
}
-// PrefsLangsFilename is the name of the preferences file in App prefs
+// PrefsLangsFilename is the name of the settings file in App prefs
// directory for saving / loading the default AvailLangs languages list
var PrefsLangsFilename = "lang_prefs.toml"
diff --git a/code/code/registers.go b/code/code/registers.go
index 6efaf25c..5d34c9a6 100644
--- a/code/code/registers.go
+++ b/code/code/registers.go
@@ -20,7 +20,7 @@ type Registers map[string]string
type RegisterName string
// AvailRegisters are available named registers. can be loaded / saved /
-// edited with preferences.
+// edited with settings.
var AvailRegisters Registers
// AvailRegisterNames are the names of the current AvailRegisters -- used for some choosers
@@ -40,7 +40,7 @@ func (lt *Registers) Names() []string {
return nms
}
-// PrefsRegistersFilename is the name of the preferences file in App prefs
+// PrefsRegistersFilename is the name of the settings file in App prefs
// directory for saving / loading the default AvailRegisters
var PrefsRegistersFilename = "registers_prefs.toml"
diff --git a/code/code/settings.go b/code/code/settings.go
index a00aa06a..e1d048be 100644
--- a/code/code/settings.go
+++ b/code/code/settings.go
@@ -15,8 +15,10 @@ import (
"cogentcore.org/core/fi"
"cogentcore.org/core/filetree"
"cogentcore.org/core/gi"
+ "cogentcore.org/core/giv"
"cogentcore.org/core/grows/tomls"
"cogentcore.org/core/grr"
+ "cogentcore.org/core/icons"
)
func init() {
@@ -48,13 +50,13 @@ type SettingsData struct { //gti:add
// key map for code-specific keyboard sequences
KeyMap KeyMapName
- // if set, the current available set of key maps is saved to your preferences directory, and automatically loaded at startup -- this should be set if you are using custom key maps, but it may be safer to keep it OFF if you are not using custom key maps, so that you'll always have the latest compiled-in standard key maps with all the current key functions bound to standard key chords
+ // if set, the current available set of key maps is saved to your settings directory, and automatically loaded at startup -- this should be set if you are using custom key maps, but it may be safer to keep it OFF if you are not using custom key maps, so that you'll always have the latest compiled-in standard key maps with all the current key functions bound to standard key chords
SaveKeyMaps bool
- // if set, the current customized set of language options (see Edit Lang Opts) is saved / loaded along with other preferences -- if not set, then you always are using the default compiled-in standard set (which will be updated)
+ // if set, the current customized set of language options (see Edit Lang Opts) is saved / loaded along with other settings -- if not set, then you always are using the default compiled-in standard set (which will be updated)
SaveLangOpts bool
- // if set, the current customized set of command parameters (see Edit Cmds) is saved / loaded along with other preferences -- if not set, then you always are using the default compiled-in standard set (which will be updated)
+ // if set, the current customized set of command parameters (see Edit Cmds) is saved / loaded along with other settings -- if not set, then you always are using the default compiled-in standard set (which will be updated)
SaveCmds bool
}
@@ -76,7 +78,7 @@ type FileSettings struct { //gti:add
// return nil
// }
-// Defaults are the defaults for Preferences
+// Defaults are the defaults for Settings
func (se *SettingsData) Defaults() {
se.Files.Defaults()
se.KeyMap = DefaultKeyMap
@@ -134,7 +136,7 @@ func (se *SettingsData) Open() error {
return err
}
-// Apply preferences updates things according with settings
+// Apply settings updates things according with settings
func (se *SettingsData) Apply() { //gti:add
if se.KeyMap != "" {
SetActiveKeyMapName(se.KeyMap) // fills in missing pieces
@@ -166,9 +168,18 @@ func (se *SettingsData) VersionInfo() string { //gti:add
return vinfo
}
+func (se *SettingsData) ConfigToolbar(tb *gi.Toolbar) {
+ giv.NewFuncButton(tb, se.VersionInfo).SetShowReturn(true).SetIcon(icons.Info)
+ giv.NewFuncButton(tb, se.EditKeyMaps).SetIcon(icons.Keyboard)
+ giv.NewFuncButton(tb, se.EditLangOpts).SetIcon(icons.Subtitles)
+ giv.NewFuncButton(tb, se.EditCmds).SetIcon(icons.KeyboardCommandKey)
+ giv.NewFuncButton(tb, se.EditSplits).SetIcon(icons.VerticalSplit)
+ giv.NewFuncButton(tb, se.EditRegisters).SetIcon(icons.Variables)
+}
+
// 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.
+// with settings automatically.
func (se *SettingsData) EditKeyMaps() { //gti:add
se.SaveKeyMaps = true
KeyMapsView(&AvailKeyMaps)
@@ -208,30 +219,35 @@ func (se *SettingsData) EditRegisters() { //gti:add
}
//////////////////////////////////////////////////////////////////////////////////////
-// Project Prefs
+// Project Settings
-// ProjPrefs are the preferences for saving for a project -- this IS the project file
-type ProjPrefs struct { //gti:add
+// ProjSettings are the settings for saving for a project. This IS the project file
+type ProjSettings struct { //gti:add
- // file view preferences
+ // file view settings
Files FileSettings
- // editor preferences
+ // editor settings
Editor gi.EditorSettings `view:"inline"`
// current named-split config in use for configuring the splitters
SplitName SplitName
- // the language associated with the most frequently-encountered file extension in the file tree -- can be manually set here as well
+ // the language associated with the most frequently-encountered file
+ // extension in the file tree -- can be manually set here as well
MainLang fi.Known
- // the type of version control system used in this project (git, svn, etc) -- filters commands available
+ // the type of version control system used in this project (git, svn, etc).
+ // filters commands available
VersCtrl filetree.VersCtrlName
- // current project filename for saving / loading specific Code configuration information in a .code file (optional)
+ // current project filename for saving / loading specific Code
+ // configuration information in a .code file (optional)
ProjFilename gi.Filename `ext:".code"`
- // root directory for the project -- all projects must be organized within a top-level root directory, with all the files therein constituting the scope of the project -- by default it is the path for ProjFilename
+ // root directory for the project. all projects must be organized within
+ // a top-level root directory, with all the files therein constituting
+ // the scope of the project. By default it is the path for ProjFilename
ProjRoot gi.Filename
// if true, use Go modules, otherwise use GOPATH -- this sets your effective GO111MODULE environment variable accordingly, dynamically -- updated by toolbar checkbox, dynamically
@@ -271,7 +287,7 @@ type ProjPrefs struct { //gti:add
Splits []float32 `view:"-"`
}
-func (se *ProjPrefs) Update() {
+func (se *ProjSettings) Update() {
if se.BuildDir != se.ProjRoot {
if se.BuildTarg == se.ProjRoot {
se.BuildTarg = se.BuildDir
@@ -282,20 +298,20 @@ func (se *ProjPrefs) Update() {
}
}
-// Open open from file
-func (se *ProjPrefs) Open(filename gi.Filename) error { //gti:add
+// Open open from file
+func (se *ProjSettings) Open(filename gi.Filename) error { //gti:add
err := grr.Log(tomls.Open(se, string(filename)))
se.VersCtrl = filetree.VersCtrlName(strings.ToLower(string(se.VersCtrl))) // official names are lowercase now
return err
}
-// Save save to file
-func (se *ProjPrefs) Save(filename gi.Filename) error { //gti:add
+// Save save to file
+func (se *ProjSettings) Save(filename gi.Filename) error { //gti:add
return grr.Log(tomls.Save(se, string(filename)))
}
// RunExecIsExec returns true if the RunExec is actually executable
-func (se *ProjPrefs) RunExecIsExec() bool {
+func (se *ProjSettings) RunExecIsExec() bool {
fi, err := fi.NewFileInfo(string(se.RunExec))
if err != nil {
return false
@@ -310,7 +326,7 @@ var (
// SavedPaths is a slice of strings that are file paths
SavedPaths gi.FilePaths
- // SavedPathsFilename is the name of the saved file paths file in GoGi prefs directory
+ // SavedPathsFilename is the name of the saved file paths file in Cogent Core prefs directory
SavedPathsFilename = "code_saved_paths.json"
// CodeViewResetRecents defines a string that is added as an item to the recents menu
diff --git a/code/code/spellview.go b/code/code/spellview.go
index e1356e93..a3e8d99d 100644
--- a/code/code/spellview.go
+++ b/code/code/spellview.go
@@ -26,7 +26,7 @@ type SpellView struct {
// parent code project
Code Code `json:"-" xml:"-" copier:"-"`
- // textview that we're spell-checking
+ // texteditor that we're spell-checking
Text *TextEditor `json:"-" xml:"-" copier:"-"`
// current spelling errors
diff --git a/code/code/splits.go b/code/code/splits.go
index cc730170..2c3422f4 100644
--- a/code/code/splits.go
+++ b/code/code/splits.go
@@ -47,7 +47,7 @@ type Splits []*Split
type SplitName string
// AvailSplits are available named splitter settings. can be loaded / saved /
-// edited with preferences. This is set to StdSplits at startup.
+// edited with settings. This is set to StdSplits at startup.
var AvailSplits Splits
// AvailSplitNames are the names of the current AvailSplits -- used for some choosers
@@ -89,7 +89,7 @@ func (lt *Splits) Names() []string {
return nms
}
-// PrefsSplitsFilename is the name of the preferences file in App prefs
+// PrefsSplitsFilename is the name of the settings file in App prefs
// directory for saving / loading the default AvailSplits
var PrefsSplitsFilename = "splits_prefs.json"
diff --git a/code/code/symbolsview.go b/code/code/symbolsview.go
index bed97759..a016eec8 100644
--- a/code/code/symbolsview.go
+++ b/code/code/symbolsview.go
@@ -47,7 +47,7 @@ type SymbolsView struct {
// Params returns the symbols params
func (sv *SymbolsView) Params() *SymbolsParams {
- return &sv.Code.ProjPrefs().Symbols
+ return &sv.Code.ProjSettings().Symbols
}
//////////////////////////////////////////////////////////////////////////////////////
@@ -196,7 +196,7 @@ func SelectSymbol(ge Code, ssym syms.Symbol) {
ge.FocusOnTabs()
}
-// OpenPackage opens package-level symbols for current active textview
+// OpenPackage opens package-level symbols for current active texteditor
func (sv *SymbolsView) OpenPackage() {
ge := sv.Code
tv := ge.ActiveTextEditor()
@@ -212,7 +212,7 @@ func (sv *SymbolsView) OpenPackage() {
sv.Syms.OpenSyms(pkg, "", sv.Match)
}
-// OpenFile opens file-level symbols for current active textview
+// OpenFile opens file-level symbols for current active texteditor
func (sv *SymbolsView) OpenFile() {
ge := sv.Code
tv := ge.ActiveTextEditor()
diff --git a/code/code/texteditor.go b/code/code/texteditor.go
index 5349b1f3..a6dc02d7 100644
--- a/code/code/texteditor.go
+++ b/code/code/texteditor.go
@@ -187,7 +187,7 @@ func (ed *TextEditor) LineNoDoubleClick(tpos lex.Pos) {
ed.SetNeedsRender(true)
}
-// ConfigOutputTextEditor configures a command-output textview within given parent layout
+// ConfigOutputTextEditor configures a command-output texteditor within given parent layout
func ConfigOutputTextEditor(ed *texteditor.Editor) {
ed.SetReadOnly(true)
ed.Style(func(s *styles.Style) {
diff --git a/code/code/values.go b/code/code/values.go
index 7bec01b8..805647af 100644
--- a/code/code/values.go
+++ b/code/code/values.go
@@ -7,6 +7,7 @@ package code
import (
"strings"
+ "cogentcore.org/cogent/code/cdebug"
"cogentcore.org/core/events"
"cogentcore.org/core/gi"
"cogentcore.org/core/giv"
@@ -31,7 +32,7 @@ func KeyMapsView(km *KeyMaps) {
})
d.AddAppBar(func(tb *gi.Toolbar) {
giv.NewFuncButton(tb, km.SavePrefs).
- SetText("Save to preferences").SetIcon(icons.Save).SetKey(keyfun.Save).
+ SetText("Save to settings").SetIcon(icons.Save).SetKey(keyfun.Save).
StyleFirst(func(s *styles.Style) { s.SetEnabled(AvailKeyMapsChanged && km == &AvailKeyMaps) })
oj := giv.NewFuncButton(tb, km.Open).SetText("Open").SetIcon(icons.Open).SetKey(keyfun.Open)
oj.Args[0].SetTag("ext", ".toml")
@@ -54,50 +55,53 @@ func KeyMapsView(km *KeyMaps) {
//////////////////////////////////////////////////////////////////////////////////////
// PrefsView
-// PrefsView opens a view of user preferences,
+// PrefsView opens a view of user settings,
// returns structview if new (nil if recycled)
func PrefsView(pf *SettingsData) *giv.StructView {
if gi.ActivateExistingMainWindow(pf) {
return nil
}
- d := gi.NewBody().SetTitle("Code Preferences")
+ d := gi.NewBody().SetTitle("Code Settings")
tv := giv.NewStructView(d).SetStruct(pf)
d.Scene.Data = pf
/*
- d.AddAppBar(func(tb *gi.Toolbar) {
- giv.NewFuncButton(tb, pf.Apply).SetIcon(icons.Done)
- giv.NewFuncButton(tb, pf.Save).SetText("Save to prefs").
- SetIcon(icons.Save).SetKey(keyfun.Save).
- StyleFirst(func(s *styles.Style) { s.SetEnabled(pf.Changed) })
- giv.NewFuncButton(tb, pf.VersionInfo).SetShowReturn(true).SetIcon(icons.Info)
- giv.NewFuncButton(tb, pf.EditKeyMaps).SetIcon(icons.Keyboard)
- giv.NewFuncButton(tb, pf.EditLangOpts).SetIcon(icons.Subtitles)
- giv.NewFuncButton(tb, pf.EditCmds).SetIcon(icons.KeyboardCommandKey)
- giv.NewFuncButton(tb, pf.EditSplits).SetIcon(icons.VerticalSplit)
- giv.NewFuncButton(tb, pf.EditRegisters).SetIcon(icons.Variables)
-
- tb.AddOverflowMenu(func(m *gi.Scene) {
- giv.NewFuncButton(m, pf.Open).SetText("Open prefs").SetIcon(icons.Open).SetKey(keyfun.OpenAlt1)
- })
- })
- */
+ */
d.NewWindow().Run()
return tv
}
//////////////////////////////////////////////////////////////////////////////////////
-// ProjPrefsView
+// ProjSettingsView
+
+// ProjSettingsView opens a view of project settings,
+// returns structview if not already open
+func ProjSettingsView(pf *ProjSettings) *giv.StructView {
+ if gi.ActivateExistingMainWindow(pf) {
+ return nil
+ }
+ d := gi.NewBody().SetTitle("Code project settings")
+ d.Scene.Data = pf
+ gi.NewLabel(d).SetText("Settings are saved in the project .code file, along with other current state (open directories, splitter settings, etc). Do Save All or Save Project to save.")
+ tv := giv.NewStructView(d).SetStruct(pf)
+ tv.OnChange(func(e events.Event) {
+ pf.Update()
+ gi.ErrorSnackbar(d, pf.Save(pf.ProjFilename), "Error saving "+string(pf.ProjFilename)+" settings")
+ })
+ d.NewWindow().Run()
+ return tv
+}
-// ProjPrefsView opens a view of project preferences (settings),
+// DebugSettingsView opens a view of project Debug settings,
// returns structview if not already open
-func ProjPrefsView(pf *ProjPrefs) *giv.StructView {
+func DebugSettingsView(pf *cdebug.Params) *giv.StructView {
if gi.ActivateExistingMainWindow(pf) {
return nil
}
- d := gi.NewBody().SetTitle("Project preferences are saved in the project .code file, along with other current state (open directories, splitter settings, etc) -- do Save Project to save.")
+ d := gi.NewBody().SetTitle("Project debug settings")
d.Scene.Data = pf
+ gi.NewLabel(d).SetText("For args: Use -- double-dash and then add args to pass args to the executable (double-dash is by itself as a separate arg first). For Debug test, must use -test.run instead of plain -run to specify tests to run")
tv := giv.NewStructView(d).SetStruct(pf)
d.NewWindow().Run()
return tv
@@ -183,7 +187,7 @@ func LangsView(pt *Langs) {
d.AddAppBar(func(tb *gi.Toolbar) {
giv.NewFuncButton(tb, pt.SavePrefs).
- SetText("Save to preferences").SetIcon(icons.Save).SetKey(keyfun.Save).
+ SetText("Save to settings").SetIcon(icons.Save).SetKey(keyfun.Save).
StyleFirst(func(s *styles.Style) { s.SetEnabled(AvailLangsChanged && pt == &AvailLangs) })
oj := giv.NewFuncButton(tb, pt.Open).SetText("Open").SetIcon(icons.Open).SetKey(keyfun.Open)
oj.Args[0].SetTag("ext", ".toml")
diff --git a/code/codev/appbar.go b/code/codev/appbar.go
index 1c639797..fbfd6410 100644
--- a/code/codev/appbar.go
+++ b/code/codev/appbar.go
@@ -39,11 +39,11 @@ func (ge *CodeView) ConfigToolbar(tb *gi.Toolbar) { //gti:add
giv.NewFuncButton(tb, ge.UpdateFiles).SetText("").SetIcon(icons.Refresh).SetShortcut("Command+U")
sm := gi.NewSwitch(tb, "go-mod").SetText("Go Mod").SetTooltip("Toggles the use of go modules -- saved with project -- if off, uses old school GOPATH mode")
sm.Style(func(s *styles.Style) {
- sm.SetChecked(ge.Prefs.GoMod)
+ sm.SetChecked(ge.Settings.GoMod)
})
sm.OnChange(func(e events.Event) {
- ge.Prefs.GoMod = sm.StateIs(states.Checked)
- code.SetGoMod(ge.Prefs.GoMod)
+ ge.Settings.GoMod = sm.StateIs(states.Checked)
+ code.SetGoMod(ge.Settings.GoMod)
})
gi.NewSeparator(tb)
@@ -130,7 +130,7 @@ func (ge *CodeView) ConfigToolbar(tb *gi.Toolbar) { //gti:add
mb := gi.NewButton(mm).SetText(sp).OnClick(func(e events.Event) {
ge.SplitsSetView(sn)
})
- if sn == ge.Prefs.SplitName {
+ if sn == ge.Settings.SplitName {
mb.SetSelected(true)
}
}
@@ -143,7 +143,7 @@ func (ge *CodeView) ConfigToolbar(tb *gi.Toolbar) { //gti:add
mb := gi.NewButton(mm).SetText(sp).OnClick(func(e events.Event) {
ge.SplitsSave(sn)
})
- if sn == ge.Prefs.SplitName {
+ if sn == ge.Settings.SplitName {
mb.SetSelected(true)
}
}
@@ -166,7 +166,7 @@ func (ge *CodeView) ConfigToolbar(tb *gi.Toolbar) { //gti:add
gi.NewSeparator(mm)
- giv.NewFuncButton(mm, ge.EditProjPrefs).SetText("Project Prefs").
+ giv.NewFuncButton(mm, ge.EditProjSettings).SetText("Project Settings").
SetIcon(icons.Edit)
giv.NewFuncButton(mm, ge.SaveProj).SetText("Save Project").
@@ -316,7 +316,7 @@ func (ge *CodeView) ResourceFiles() uri.URIs {
// ResourceCommands adds the commands
func (ge *CodeView) ResourceCommands() uri.URIs {
- lang := ge.Prefs.MainLang
+ lang := ge.Settings.MainLang
vcnm := ge.VersCtrl()
fn := ge.ActiveFileNode()
if fn != nil {
diff --git a/code/codev/codeview.go b/code/codev/codeview.go
index 870fdf57..8faf5062 100644
--- a/code/codev/codeview.go
+++ b/code/codev/codeview.go
@@ -42,7 +42,7 @@ type CodeView struct {
// current project filename for saving / loading specific Code configuration information in a .code file (optional)
ProjFilename gi.Filename `ext:".code"`
- // filename of the currently-active textview
+ // filename of the currently-active texteditor
ActiveFilename gi.Filename `set:"-"`
// language for current active filename
@@ -66,7 +66,7 @@ type CodeView struct {
// all the files in the project directory and subdirectories
Files *filetree.Tree `set:"-" json:"-"`
- // index of the currently-active textview -- new files will be viewed in other views if available
+ // index of the currently-active texteditor -- new files will be viewed in other views if available
ActiveTextEditorIdx int `set:"-" json:"-"`
// list of open nodes, most recent first
@@ -84,8 +84,8 @@ type CodeView struct {
// current arg var vals
ArgVals code.ArgVarVals `set:"-" json:"-" xml:"-"`
- // preferences for this project -- this is what is saved in a .code project file
- Prefs code.ProjPrefs `set:"-"`
+ // settings for this project -- this is what is saved in a .code project file
+ Settings code.ProjSettings `set:"-"`
// current debug view
CurDbg *code.DebugView `set:"-"`
@@ -111,8 +111,8 @@ func (ge *CodeView) OnInit() {
////////////////////////////////////////////////////////
// Code interface
-func (ge *CodeView) ProjPrefs() *code.ProjPrefs {
- return &ge.Prefs
+func (ge *CodeView) ProjSettings() *code.ProjSettings {
+ return &ge.Settings
}
func (ge *CodeView) FileTree() *filetree.Tree {
@@ -124,9 +124,9 @@ func (ge *CodeView) LastSaveTime() time.Time {
}
// VersCtrl returns the version control system in effect, using the file tree detected
-// version or whatever is set in project preferences
+// version or whatever is set in project settings
func (ge *CodeView) VersCtrl() filetree.VersCtrlName {
- vc := ge.Prefs.VersCtrl
+ vc := ge.Settings.VersCtrl
return vc
}
@@ -142,6 +142,10 @@ func (ge *CodeView) ArgVarVals() *code.ArgVarVals {
return &ge.ArgVals
}
+func (ge *CodeView) CurOpenNodes() *code.OpenNodes {
+ return &ge.OpenNodes
+}
+
func (ge *CodeView) FocusOnTabs() bool {
return ge.FocusOnPanel(TabsIdx)
}
@@ -224,7 +228,7 @@ func (ge *CodeView) SetWindowNameTitle() {
pnm := ge.Name()
winm := "cocode-" + pnm
win.SetName(winm)
- win.SetTitle(winm + ": " + string(ge.Prefs.ProjRoot))
+ win.SetTitle(winm + ": " + string(ge.Settings.ProjRoot))
tab := ge.Scene.GetTopAppBar()
if tab != nil {
aci := tab.ChildByName("app-chooser", 1)
@@ -255,9 +259,9 @@ func (ge *CodeView) OpenPath(path gi.Filename) *CodeView { //gti:add
ge.ProjRoot = gi.Filename(root)
ge.SetName(pnm)
ge.Scene.SetName(pnm)
- ge.Prefs.ProjFilename = gi.Filename(filepath.Join(root, pnm+".code"))
- ge.ProjFilename = ge.Prefs.ProjFilename
- ge.Prefs.ProjRoot = ge.ProjRoot
+ ge.Settings.ProjFilename = gi.Filename(filepath.Join(root, pnm+".code"))
+ ge.ProjFilename = ge.Settings.ProjFilename
+ ge.Settings.ProjRoot = ge.ProjRoot
ge.GuessMainLang()
ge.LangDefaults()
ge.SetWindowNameTitle()
@@ -277,20 +281,20 @@ func (ge *CodeView) OpenProj(filename gi.Filename) *CodeView { //gti:add
return OpenCodeProj(string(filename))
}
ge.Defaults()
- if err := ge.Prefs.Open(filename); err != nil {
- slog.Error("Project Prefs had a loading error", "error", err)
- if ge.Prefs.ProjRoot == "" {
+ if err := ge.Settings.Open(filename); err != nil {
+ slog.Error("Project Settings had a loading error", "error", err)
+ if ge.Settings.ProjRoot == "" {
root, _, _, _ := ProjPathParse(string(filename))
- ge.Prefs.ProjRoot = gi.Filename(root)
+ ge.Settings.ProjRoot = gi.Filename(root)
ge.GuessMainLang()
}
}
- ge.Prefs.ProjFilename = filename // should already be set but..
- _, pnm, _, ok := ProjPathParse(string(ge.Prefs.ProjRoot))
+ ge.Settings.ProjFilename = filename // should already be set but..
+ _, pnm, _, ok := ProjPathParse(string(ge.Settings.ProjRoot))
if ok {
- code.SetGoMod(ge.Prefs.GoMod)
- os.Chdir(string(ge.Prefs.ProjRoot))
- ge.ProjRoot = gi.Filename(ge.Prefs.ProjRoot)
+ code.SetGoMod(ge.Settings.GoMod)
+ os.Chdir(string(ge.Settings.ProjRoot))
+ ge.ProjRoot = gi.Filename(ge.Settings.ProjRoot)
code.SavedPaths.AddPath(string(filename), gi.SystemSettings.SavedPathsMax)
code.SavePaths()
ge.SetName(pnm)
@@ -314,9 +318,9 @@ func (ge *CodeView) NewProj(path gi.Filename, folder string, mainLang fi.Known,
return nil
}
nge := ge.OpenPath(gi.Filename(np))
- nge.Prefs.MainLang = mainLang
+ nge.Settings.MainLang = mainLang
if versCtrl != "" {
- nge.Prefs.VersCtrl = versCtrl
+ nge.Settings.VersCtrl = versCtrl
}
return nge
}
@@ -341,10 +345,10 @@ func (ge *CodeView) NewFile(filename string, addToVcs bool) { //gti:add
// SaveProj saves project file containing custom project settings, in a
// standard toml-formatted file
func (ge *CodeView) SaveProj() { //gti:add
- if ge.Prefs.ProjFilename == "" {
+ if ge.Settings.ProjFilename == "" {
return
}
- ge.SaveProjAs(ge.Prefs.ProjFilename)
+ ge.SaveProjAs(ge.Settings.ProjFilename)
ge.SaveAllCheck(false, nil) // false = no cancel option
}
@@ -353,13 +357,13 @@ func (ge *CodeView) SaveProj() { //gti:add
// saveAllFiles indicates if user should be prompted for saving all files
func (ge *CodeView) SaveProjIfExists(saveAllFiles bool) bool {
spell.SaveIfLearn()
- if ge.Prefs.ProjFilename == "" {
+ if ge.Settings.ProjFilename == "" {
return false
}
- if _, err := os.Stat(string(ge.Prefs.ProjFilename)); os.IsNotExist(err) {
+ if _, err := os.Stat(string(ge.Settings.ProjFilename)); os.IsNotExist(err) {
return false // does not exist
}
- ge.SaveProjAs(ge.Prefs.ProjFilename)
+ ge.SaveProjAs(ge.Settings.ProjFilename)
if saveAllFiles {
ge.SaveAllCheck(false, nil)
}
@@ -374,10 +378,10 @@ func (ge *CodeView) SaveProjAs(filename gi.Filename) bool { //gti:add
spell.SaveIfLearn()
code.SavedPaths.AddPath(string(filename), gi.SystemSettings.SavedPathsMax)
code.SavePaths()
- ge.Prefs.ProjFilename = filename
- ge.ProjFilename = ge.Prefs.ProjFilename
+ ge.Settings.ProjFilename = filename
+ ge.ProjFilename = ge.Settings.ProjFilename
ge.GrabPrefs()
- ge.Prefs.Save(filename)
+ ge.Settings.Save(filename)
ge.Files.UpdatePath(string(filename))
ge.Changed = false
return false
@@ -533,9 +537,9 @@ func NewCodeProjPath(path string) *CodeView {
// OpenCodeProj creates a new CodeView window opened to given CodeView project,
// returning the window and the path
func OpenCodeProj(projfile string) *CodeView {
- pp := &code.ProjPrefs{}
+ pp := &code.ProjSettings{}
if err := pp.Open(gi.Filename(projfile)); err != nil {
- slog.Debug("Project Prefs had a loading error", "error", err)
+ slog.Debug("Project Settings had a loading error", "error", err)
}
path := string(pp.ProjRoot)
root, projnm, _, _ := ProjPathParse(path)
@@ -571,7 +575,7 @@ func NewCodeWindow(path, projnm, root string, doPath bool) *CodeView {
b.App().AppBarConfig = ge.AppBarConfig
b.AddAppBar(ge.ConfigToolbar)
- b.App().About = `Cogent Code
is a graphical-interface (gi) integrated-development-environment (ide) written in the GoGi graphical interface system, within the Goki tree framework. See Code on GitHub and Code wiki for documentation.
Code is based on "projects" which are just directories containing files
* Use File/Open Path...
to open an existing directory.
* Or File/New Project...
to create a new directory for a new project
Version: ` + code.Settings.VersionInfo()
+ b.App().About = `Cogent Code
is a graphical-interface (gi) integrated-development-environment (ide) written in the Cogent Core graphical interface system, within the Goki tree framework. See Code on GitHub and Code wiki for documentation.
Code is based on "projects" which are just directories containing files
* Use File/Open Path...
to open an existing directory.
* Or File/New Project...
to create a new directory for a new project
Version: ` + code.Settings.VersionInfo()
/* todo: window doesn't exist yet -- need a delayed soln
inClosePrompt := false
diff --git a/code/codev/commands.go b/code/codev/commands.go
index d6148dbb..c9c7ad49 100644
--- a/code/codev/commands.go
+++ b/code/codev/commands.go
@@ -84,7 +84,7 @@ func (ge *CodeView) ExecCmdNameFileNode(fn *filetree.Node, cmdNm code.CmdName, s
if !ok || fn == nil || fn.This() == nil {
return
}
- ge.ArgVals.Set(string(fn.FPath), &ge.Prefs, nil)
+ ge.ArgVals.Set(string(fn.FPath), &ge.Settings, nil)
cbuf, _, _ := ge.RecycleCmdTab(cmd.Name, sel, clearBuf)
cmd.Run(ge, cbuf)
}
@@ -95,7 +95,7 @@ func (ge *CodeView) ExecCmdNameFilename(fn string, cmdNm code.CmdName, sel bool,
if !ok {
return
}
- ge.ArgVals.Set(fn, &ge.Prefs, nil)
+ ge.ArgVals.Set(fn, &ge.Settings, nil)
cbuf, _, _ := ge.RecycleCmdTab(cmd.Name, sel, clearBuf)
cmd.Run(ge, cbuf)
}
@@ -110,14 +110,14 @@ func ExecCmds(ge *CodeView) [][]string {
vc := ge.VersCtrl()
if ge.ActiveLang == fi.Unknown {
- cmds = code.AvailCmds.FilterCmdNames(ge.Prefs.MainLang, vc)
+ cmds = code.AvailCmds.FilterCmdNames(ge.Settings.MainLang, vc)
} else {
cmds = code.AvailCmds.FilterCmdNames(ge.ActiveLang, vc)
}
return cmds
}
-// ExecCmdNameActive calls given command on current active textview
+// ExecCmdNameActive calls given command on current active texteditor
func (ge *CodeView) ExecCmdNameActive(cmdNm string) { //gti:add
tv := ge.ActiveTextEditor()
if tv == nil {
@@ -157,9 +157,9 @@ func (ge *CodeView) SetArgVarVals() {
tv := ge.ActiveTextEditor()
tve := texteditor.AsEditor(tv)
if tv == nil || tv.Buf == nil {
- ge.ArgVals.Set("", &ge.Prefs, tve)
+ ge.ArgVals.Set("", &ge.Settings, tve)
} else {
- ge.ArgVals.Set(string(tv.Buf.Filename), &ge.Prefs, tve)
+ ge.ArgVals.Set(string(tv.Buf.Filename), &ge.Settings, tve)
}
}
@@ -179,26 +179,26 @@ func (ge *CodeView) ExecCmdsFileNode(fn *filetree.Node, cmdNms code.CmdNames, se
// Build runs the BuildCmds set for this project
func (ge *CodeView) Build() { //gti:add
- if len(ge.Prefs.BuildCmds) == 0 {
- gi.MessageDialog(ge, "You need to set the BuildCmds in the Project Preferences", "No BuildCmds Set")
+ if len(ge.Settings.BuildCmds) == 0 {
+ gi.MessageDialog(ge, "You need to set the BuildCmds in the Project Settings", "No BuildCmds Set")
return
}
ge.SaveAllCheck(true, func() { // true = cancel option
- ge.ExecCmds(ge.Prefs.BuildCmds, true, true)
+ ge.ExecCmds(ge.Settings.BuildCmds, true, true)
})
}
// Run runs the RunCmds set for this project
func (ge *CodeView) Run() { //gti:add
- if len(ge.Prefs.RunCmds) == 0 {
- gi.MessageDialog(ge, "You need to set the RunCmds in the Project Preferences", "No RunCmds Set")
+ if len(ge.Settings.RunCmds) == 0 {
+ gi.MessageDialog(ge, "You need to set the RunCmds in the Project Settings", "No RunCmds Set")
return
}
- if ge.Prefs.RunCmds[0] == "Run Proj" && !ge.Prefs.RunExecIsExec() {
+ if ge.Settings.RunCmds[0] == "Run Proj" && !ge.Settings.RunExecIsExec() {
giv.CallFunc(ge, ge.ChooseRunExec)
return
}
- ge.ExecCmds(ge.Prefs.RunCmds, true, true)
+ ge.ExecCmds(ge.Settings.RunCmds, true, true)
}
// Commit commits the current changes using relevant VCS tool.
@@ -234,13 +234,13 @@ func (ge *CodeView) CommitNoChecks() {
}
}
if cmdnm == "" {
- gi.MessageDialog(ge, "Could not find Commit command in list of avail commands -- this is usually a programmer error -- check preferences settings etc", "No Commit command found")
+ gi.MessageDialog(ge, "Could not find Commit command in list of avail commands -- this is usually a programmer error -- check settings settings etc", "No Commit command found")
return
}
ge.SetArgVarVals() // need to set before setting prompt string below..
d := gi.NewBody().AddTitle("Commit message").
- AddText("Please enter your commit message here -- remember this is essential front-line documentation. Author information comes from User settings in GoGi Preferences.")
+ AddText("Please enter your commit message here -- remember this is essential front-line documentation. Author information comes from User settings in Core Settings.")
tf := gi.NewTextField(d).SetText("").SetPlaceholder("Enter commit message here..")
tf.Style(func(s *styles.Style) {
s.Min.X.Ch(200)
diff --git a/code/codev/config.go b/code/codev/config.go
index b50ed540..1bcf1464 100644
--- a/code/codev/config.go
+++ b/code/codev/config.go
@@ -69,7 +69,7 @@ func (ge *CodeView) Splits() *gi.Splits {
return ge.ChildByName("splitview", 2).(*gi.Splits)
}
-// TextEditorButtonByIndex returns the top textview menu button by index (0 or 1)
+// TextEditorButtonByIndex returns the top texteditor menu button by index (0 or 1)
func (ge *CodeView) TextEditorButtonByIndex(idx int) *gi.Button {
return ge.Splits().Child(TextEditor1Idx + idx).Child(0).(*gi.Button)
}
@@ -137,7 +137,7 @@ func (ge *CodeView) ConfigSplits() {
s.Direction = styles.Column
s.Grow.Set(1, 1)
})
- txbut := gi.NewButton(txly, "textbut-"+txnm).SetText("textview: " + txnm)
+ txbut := gi.NewButton(txly, "textbut-"+txnm).SetText("texteditor: " + txnm)
txbut.Type = gi.ButtonAction
txbut.Style(func(s *styles.Style) {
s.Grow.Set(1, 0)
@@ -149,7 +149,7 @@ func (ge *CodeView) ConfigSplits() {
ge.SetActiveTextEditorIdx(i)
})
- ted := code.NewTextEditor(txly, "textview-"+txnm)
+ ted := code.NewTextEditor(txly, "texteditor-"+txnm)
ted.Code = ge
code.ConfigEditorTextEditor(&ted.Editor)
ted.OnFocus(func(e events.Event) {
@@ -176,7 +176,7 @@ func (ge *CodeView) ConfigSplits() {
// }
// })
- split.SetSplits(ge.Prefs.Splits...)
+ split.SetSplits(ge.Settings.Splits...)
}
// ConfigStatusBar configures statusbar with label
diff --git a/code/codev/editor.go b/code/codev/editor.go
index 119a95ca..047b0b32 100644
--- a/code/codev/editor.go
+++ b/code/codev/editor.go
@@ -43,7 +43,7 @@ func (ge *CodeView) CursorToHistNext() bool { //gti:add
}
// LookupFun is the completion system Lookup function that makes a custom
-// textview dialog that has option to edit resulting file.
+// texteditor dialog that has option to edit resulting file.
func (ge *CodeView) LookupFun(data any, text string, posLn, posCh int) (ld complete.Lookup) {
sfs := data.(*pi.FileStates)
if sfs == nil {
@@ -99,7 +99,7 @@ func (ge *CodeView) LookupFun(data any, text string, posLn, posCh int) (ld compl
tb := texteditor.NewBuf().SetText(txt).SetFilename(ld.Filename)
tb.Hi.Style = gi.AppearanceSettings.HiStyle
- tb.Opts.LineNos = ge.Prefs.Editor.LineNos
+ tb.Opts.LineNos = ge.Settings.Editor.LineNos
d := gi.NewBody().AddTitle(title).AddText(prmpt)
tv := texteditor.NewEditor(d).SetBuf(tb)
@@ -177,7 +177,7 @@ func (ge *CodeView) RegisterCopy(name string) bool { //gti:add
}
code.AvailRegisters[name] = string(sel.ToBytes())
code.AvailRegisters.SavePrefs()
- ge.Prefs.Register = code.RegisterName(name)
+ ge.Settings.Register = code.RegisterName(name)
tv.SelectReset()
return true
}
@@ -197,7 +197,7 @@ func (ge *CodeView) RegisterPaste(name code.RegisterName) bool { //gti:add
return false
}
tv.InsertAtCursor([]byte(str))
- ge.Prefs.Register = name
+ ge.Settings.Register = name
return true
}
diff --git a/code/codev/events.go b/code/codev/events.go
index 6f8fc300..9f05b86b 100644
--- a/code/codev/events.go
+++ b/code/codev/events.go
@@ -27,7 +27,7 @@ func (ge *CodeView) HandleEvents() {
}
func (ge *CodeView) CodeViewKeys(kt events.Event) {
- code.SetGoMod(ge.Prefs.GoMod)
+ code.SetGoMod(ge.Settings.GoMod)
var kf code.KeyFuns
kc := kt.KeyChord()
if gi.DebugSettings.KeyEventTrace {
@@ -76,7 +76,7 @@ func (ge *CodeView) CodeViewKeys(kt events.Event) {
case keyfun.Find:
kt.SetHandled()
if atv != nil && atv.HasSelection() {
- ge.Prefs.Find.Find = string(atv.Selection().ToBytes())
+ ge.Settings.Find.Find = string(atv.Selection().ToBytes())
}
ge.CallFind(atv)
}
diff --git a/code/codev/files.go b/code/codev/files.go
index 85efc96f..dc4fba94 100644
--- a/code/codev/files.go
+++ b/code/codev/files.go
@@ -22,7 +22,7 @@ import (
"cogentcore.org/core/texteditor"
)
-// SaveActiveView saves the contents of the currently-active textview
+// SaveActiveView saves the contents of the currently-active texteditor
func (ge *CodeView) SaveActiveView() { //gti:add
tv := ge.ActiveTextEditor()
if tv.Buf != nil {
@@ -53,7 +53,7 @@ func (ge *CodeView) CallSaveActiveViewAs(ctx gi.Widget) {
}
// SaveActiveViewAs save with specified filename the contents of the
-// currently-active textview
+// currently-active texteditor
func (ge *CodeView) SaveActiveViewAs(filename gi.Filename) { //gti:add
tv := ge.ActiveTextEditor()
if tv.Buf != nil {
@@ -260,7 +260,7 @@ func (ge *CodeView) TextBufForFile(fpath string, add bool) *texteditor.Buf {
// NextViewFile sets the next text view to view given file name -- include as
// much of name as possible to disambiguate -- will use the first matching --
-// if already being viewed, that is activated -- returns textview and its
+// if already being viewed, that is activated -- returns texteditor and its
// index, false if not found
func (ge *CodeView) NextViewFile(fnm gi.Filename) (*code.TextEditor, int, bool) { //gti:add
fn := ge.FileNodeForFile(string(fnm), true)
@@ -305,7 +305,7 @@ func (ge *CodeView) ViewFileInIdx(fnm gi.Filename, idx int) (*code.TextEditor, i
return tv, idx, true
}
-// LinkViewFileNode opens the file node in the 2nd textview, which is next to
+// LinkViewFileNode opens the file node in the 2nd texteditor, which is next to
// the tabs where links are clicked, if it is not collapsed -- else 1st
func (ge *CodeView) LinkViewFileNode(fn *filetree.Node) (*code.TextEditor, int) {
updt := ge.UpdateStart()
@@ -322,7 +322,7 @@ func (ge *CodeView) LinkViewFileNode(fn *filetree.Node) (*code.TextEditor, int)
return tv, idx
}
-// LinkViewFile opens the file in the 2nd textview, which is next to
+// LinkViewFile opens the file in the 2nd texteditor, which is next to
// the tabs where links are clicked, if it is not collapsed -- else 1st
func (ge *CodeView) LinkViewFile(fnm gi.Filename) (*code.TextEditor, int, bool) {
fn := ge.FileNodeForFile(string(fnm), true)
@@ -373,7 +373,7 @@ func (ge *CodeView) ViewOpenNodeName(name string) {
}
// SelectOpenNode pops up a menu to select an open node (aka buffer) to view
-// in current active textview
+// in current active texteditor
func (ge *CodeView) SelectOpenNode() {
if len(ge.OpenNodes) == 0 {
ge.SetStatus("No open nodes to choose from")
@@ -460,7 +460,7 @@ func (ge *CodeView) FileNodeRunExe(fn *filetree.Node) {
code.CmdNoUserPrompt = true // don't re-prompt!
cmd, _, ok := code.AvailCmds.CmdByName(code.CmdName("Build: Run Prompt"), true)
if ok {
- ge.ArgVals.Set(string(fn.FPath), &ge.Prefs, nil)
+ ge.ArgVals.Set(string(fn.FPath), &ge.Settings, nil)
cbuf, _, _ := ge.RecycleCmdTab(cmd.Name, true, true)
cmd.Run(ge, cbuf)
}
diff --git a/code/codev/gtigen.go b/code/codev/gtigen.go
index 1dac0d12..74652d17 100644
--- a/code/codev/gtigen.go
+++ b/code/codev/gtigen.go
@@ -11,7 +11,7 @@ import (
)
// CodeViewType is the [gti.Type] for [CodeView]
-var CodeViewType = gti.AddType(>i.Type{Name: "cogentcore.org/cogent/code/codev.CodeView", IDName: "code-view", Doc: "CodeView is the core editor and tab viewer framework for the Code system. The\ndefault view has a tree browser of files on the left, editor panels in the\nmiddle, and a tabbed viewer on the right.", Methods: []gti.Method{{Name: "ConfigToolbar", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Args: []string{"tb"}}, {Name: "UpdateFiles", Doc: "UpdateFiles updates the list of files saved in project", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}, {Name: "OpenRecent", Doc: "OpenRecent opens a recently-used file", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Args: []string{"filename"}}, {Name: "OpenFile", Doc: "OpenFile opens file in an open project if it has the same path as the file\nor in a new window.", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Args: []string{"fnm"}}, {Name: "OpenPath", Doc: "OpenPath creates a new project by opening given path, which can either be a\nspecific file or a folder containing multiple files of interest -- opens in\ncurrent CodeView object if it is empty, or otherwise opens a new window.", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Args: []string{"path"}, Returns: []string{"CodeView"}}, {Name: "OpenProj", Doc: "OpenProj opens .code project file and its settings from given filename, in a standard\ntoml-formatted file", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Args: []string{"filename"}, Returns: []string{"CodeView"}}, {Name: "NewProj", Doc: "NewProj creates a new project at given path, making a new folder in that\npath -- all CodeView projects are essentially defined by a path to a folder\ncontaining files. If the folder already exists, then use OpenPath.\nCan also specify main language and version control type", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Args: []string{"path", "folder", "mainLang", "versCtrl"}, Returns: []string{"CodeView"}}, {Name: "NewFile", Doc: "NewFile creates a new file in the project", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Args: []string{"filename", "addToVcs"}}, {Name: "SaveProj", Doc: "SaveProj saves project file containing custom project settings, in a\nstandard toml-formatted file", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}, {Name: "SaveProjAs", Doc: "SaveProjAs saves project custom settings to given filename, in a standard\ntoml-formatted file\nsaveAllFiles indicates if user should be prompted for saving all files\nreturns true if the user was prompted, false otherwise", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Args: []string{"filename"}, Returns: []string{"bool"}}, {Name: "ExecCmdNameActive", Doc: "ExecCmdNameActive calls given command on current active textview", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Args: []string{"cmdNm"}}, {Name: "ExecCmd", Doc: "ExecCmd pops up a menu to select a command appropriate for the current\nactive text view, and shows output in Tab with name of command", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}, {Name: "Build", Doc: "Build runs the BuildCmds set for this project", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}, {Name: "Run", Doc: "Run runs the RunCmds set for this project", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}, {Name: "Commit", Doc: "Commit commits the current changes using relevant VCS tool.\nChecks for VCS setting and for unsaved files.", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}, {Name: "CursorToHistPrev", Doc: "CursorToHistPrev moves cursor to previous position on history list --\nreturns true if moved", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Returns: []string{"bool"}}, {Name: "CursorToHistNext", Doc: "CursorToHistNext moves cursor to next position on history list --\nreturns true if moved", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Returns: []string{"bool"}}, {Name: "ReplaceInActive", Doc: "ReplaceInActive does query-replace in active file only", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}, {Name: "CutRect", Doc: "CutRect cuts rectangle in active text view", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}, {Name: "CopyRect", Doc: "CopyRect copies rectangle in active text view", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}, {Name: "PasteRect", Doc: "PasteRect cuts rectangle in active text view", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}, {Name: "RegisterCopy", Doc: "RegisterCopy saves current selection in active text view to register of given name\nreturns true if saved", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Args: []string{"name"}, Returns: []string{"bool"}}, {Name: "RegisterPaste", Doc: "RegisterPaste pastes register of given name into active text view\nreturns true if pasted", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Args: []string{"name"}, Returns: []string{"bool"}}, {Name: "CommentOut", Doc: "CommentOut comments-out selected lines in active text view\nand uncomments if already commented\nIf multiple lines are selected and any line is uncommented all will be commented", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Returns: []string{"bool"}}, {Name: "Indent", Doc: "Indent indents selected lines in active view", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Returns: []string{"bool"}}, {Name: "ReCase", Doc: "ReCase replaces currently selected text in current active view with given case", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Args: []string{"c"}, Returns: []string{"string"}}, {Name: "JoinParaLines", Doc: "JoinParaLines merges sequences of lines with hard returns forming paragraphs,\nseparated by blank lines, into a single line per paragraph,\nfor given selected region (full text if no selection)", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}, {Name: "TabsToSpaces", Doc: "TabsToSpaces converts tabs to spaces\nfor given selected region (full text if no selection)", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}, {Name: "SpacesToTabs", Doc: "SpacesToTabs converts spaces to tabs\nfor given selected region (full text if no selection)", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}, {Name: "DiffFiles", Doc: "DiffFiles shows the differences between two given files\nin side-by-side DiffView and in the console as a context diff.\nIt opens the files as file nodes and uses existing contents if open already.", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Args: []string{"fnmA", "fnmB"}}, {Name: "DiffFileNode", Doc: "DiffFileNode shows the differences between given file node as the A file,\nand another given file as the B file,\nin side-by-side DiffView and in the console as a context diff.", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Args: []string{"fna", "fnmB"}}, {Name: "CountWords", Doc: "CountWords counts number of words (and lines) in active file\nreturns a string report thereof.", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Returns: []string{"string"}}, {Name: "CountWordsRegion", Doc: "CountWordsRegion counts number of words (and lines) in selected region in file\nif no selection, returns numbers for entire file.", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Returns: []string{"string"}}, {Name: "SaveActiveView", Doc: "SaveActiveView saves the contents of the currently-active textview", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}, {Name: "SaveActiveViewAs", Doc: "SaveActiveViewAs save with specified filename the contents of the\ncurrently-active textview", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Args: []string{"filename"}}, {Name: "RevertActiveView", Doc: "RevertActiveView revert active view to saved version", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}, {Name: "CloseActiveView", Doc: "CloseActiveView closes the buffer associated with active view", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}, {Name: "NextViewFile", Doc: "NextViewFile sets the next text view to view given file name -- include as\nmuch of name as possible to disambiguate -- will use the first matching --\nif already being viewed, that is activated -- returns textview and its\nindex, false if not found", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Args: []string{"fnm"}, Returns: []string{"TextEditor", "int", "bool"}}, {Name: "ViewFile", Doc: "ViewFile views file in an existing TextEditor if it is already viewing that\nfile, otherwise opens ViewFileNode in active buffer", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Args: []string{"fnm"}, Returns: []string{"TextEditor", "int", "bool"}}, {Name: "CloneActiveView", Doc: "CloneActiveView sets the next text view to view the same file currently being vieweds\nin the active view. returns text view and index", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Returns: []string{"TextEditor", "int"}}, {Name: "SaveAll", Doc: "SaveAll saves all of the open filenodes to their current file names\nand saves the project state if it has been saved before (i.e., the .code file exists)", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}, {Name: "EditProjPrefs", Doc: "EditProjPrefs allows editing of project preferences (settings specific to this project)", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}, {Name: "SplitsSetView", Doc: "SplitsSetView sets split view splitters to given named setting", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Args: []string{"split"}}, {Name: "SplitsSave", Doc: "SplitsSave saves current splitter settings to named splitter settings under\nexisting name, and saves to prefs file", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Args: []string{"split"}}, {Name: "SplitsSaveAs", Doc: "SplitsSaveAs saves current splitter settings to new named splitter settings, and\nsaves to prefs file", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Args: []string{"name", "desc"}}, {Name: "SplitsEdit", Doc: "SplitsEdit opens the SplitsView editor to customize saved splitter settings", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}, {Name: "Find", Doc: "Find does Find / Replace in files, using given options and filters -- opens up a\nmain tab with the results and further controls.", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Args: []string{"find", "repl", "ignoreCase", "regExp", "loc", "langs"}}, {Name: "Spell", Doc: "Spell checks spelling in active text view", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}, {Name: "Symbols", Doc: "Symbols displays the Symbols of a file or package", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}, {Name: "Debug", Doc: "Debug starts the debugger on the RunExec executable.", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}, {Name: "DebugTest", Doc: "DebugTest runs the debugger using testing mode in current active textview path", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}, {Name: "DebugAttach", Doc: "DebugAttach runs the debugger by attaching to an already-running process.\npid is the process id to attach to.", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Args: []string{"pid"}}, {Name: "VCSUpdateAll", Doc: "VCSUpdateAll does an Update (e.g., Pull) on all VCS repositories within\nthe open tree nodes in FileTree.", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}, {Name: "VCSLog", Doc: "VCSLog shows the VCS log of commits for this file, optionally with a\nsince date qualifier: If since is non-empty, it should be\na date-like expression that the VCS will understand, such as\n1/1/2020, yesterday, last year, etc. SVN only understands a\nnumber as a maximum number of items to return.\nIf allFiles is true, then the log will show revisions for all files, not just\nthis one.\nReturns the Log and also shows it in a VCSLogView which supports further actions.", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Args: []string{"since"}, Returns: []string{"Log", "error"}}, {Name: "OpenConsoleTab", Doc: "OpenConsoleTab opens a main tab displaying console output (stdout, stderr)", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}, {Name: "ChooseRunExec", Doc: "ChooseRunExec selects the executable to run for the project", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Args: []string{"exePath"}}, {Name: "HelpWiki", Doc: "HelpWiki opens wiki page for code on github", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}}, Embeds: []gti.Field{{Name: "Frame"}}, Fields: []gti.Field{{Name: "ProjRoot", Doc: "root directory for the project -- all projects must be organized within a top-level root directory, with all the files therein constituting the scope of the project -- by default it is the path for ProjFilename"}, {Name: "ProjFilename", Doc: "current project filename for saving / loading specific Code configuration information in a .code file (optional)"}, {Name: "ActiveFilename", Doc: "filename of the currently-active textview"}, {Name: "ActiveLang", Doc: "language for current active filename"}, {Name: "ActiveVCS", Doc: "VCS repo for current active filename"}, {Name: "ActiveVCSInfo", Doc: "VCS info for current active filename (typically branch or revision) -- for status"}, {Name: "Changed", Doc: "has the root changed? we receive update signals from root for changes"}, {Name: "StatusMessage", Doc: "the last status update message"}, {Name: "LastSaveTStamp", Doc: "timestamp for when a file was last saved -- provides dirty state for various updates including rebuilding in debugger"}, {Name: "Files", Doc: "all the files in the project directory and subdirectories"}, {Name: "ActiveTextEditorIdx", Doc: "index of the currently-active textview -- new files will be viewed in other views if available"}, {Name: "OpenNodes", Doc: "list of open nodes, most recent first"}, {Name: "CmdBufs", Doc: "the command buffers for commands run in this project"}, {Name: "CmdHistory", Doc: "history of commands executed in this session"}, {Name: "RunningCmds", Doc: "currently running commands in this project"}, {Name: "ArgVals", Doc: "current arg var vals"}, {Name: "Prefs", Doc: "preferences for this project -- this is what is saved in a .code project file"}, {Name: "CurDbg", Doc: "current debug view"}, {Name: "KeySeq1", Doc: "first key in sequence if needs2 key pressed"}, {Name: "UpdtMu", Doc: "mutex for protecting overall updates to CodeView"}}, Instance: &CodeView{}})
+var CodeViewType = gti.AddType(>i.Type{Name: "cogentcore.org/cogent/code/codev.CodeView", IDName: "code-view", Doc: "CodeView is the core editor and tab viewer framework for the Code system. The\ndefault view has a tree browser of files on the left, editor panels in the\nmiddle, and a tabbed viewer on the right.", Methods: []gti.Method{{Name: "ConfigToolbar", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Args: []string{"tb"}}, {Name: "UpdateFiles", Doc: "UpdateFiles updates the list of files saved in project", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}, {Name: "OpenRecent", Doc: "OpenRecent opens a recently-used file", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Args: []string{"filename"}}, {Name: "OpenFile", Doc: "OpenFile opens file in an open project if it has the same path as the file\nor in a new window.", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Args: []string{"fnm"}}, {Name: "OpenPath", Doc: "OpenPath creates a new project by opening given path, which can either be a\nspecific file or a folder containing multiple files of interest -- opens in\ncurrent CodeView object if it is empty, or otherwise opens a new window.", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Args: []string{"path"}, Returns: []string{"CodeView"}}, {Name: "OpenProj", Doc: "OpenProj opens .code project file and its settings from given filename, in a standard\ntoml-formatted file", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Args: []string{"filename"}, Returns: []string{"CodeView"}}, {Name: "NewProj", Doc: "NewProj creates a new project at given path, making a new folder in that\npath -- all CodeView projects are essentially defined by a path to a folder\ncontaining files. If the folder already exists, then use OpenPath.\nCan also specify main language and version control type", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Args: []string{"path", "folder", "mainLang", "versCtrl"}, Returns: []string{"CodeView"}}, {Name: "NewFile", Doc: "NewFile creates a new file in the project", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Args: []string{"filename", "addToVcs"}}, {Name: "SaveProj", Doc: "SaveProj saves project file containing custom project settings, in a\nstandard toml-formatted file", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}, {Name: "SaveProjAs", Doc: "SaveProjAs saves project custom settings to given filename, in a standard\ntoml-formatted file\nsaveAllFiles indicates if user should be prompted for saving all files\nreturns true if the user was prompted, false otherwise", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Args: []string{"filename"}, Returns: []string{"bool"}}, {Name: "ExecCmdNameActive", Doc: "ExecCmdNameActive calls given command on current active texteditor", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Args: []string{"cmdNm"}}, {Name: "ExecCmd", Doc: "ExecCmd pops up a menu to select a command appropriate for the current\nactive text view, and shows output in Tab with name of command", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}, {Name: "Build", Doc: "Build runs the BuildCmds set for this project", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}, {Name: "Run", Doc: "Run runs the RunCmds set for this project", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}, {Name: "Commit", Doc: "Commit commits the current changes using relevant VCS tool.\nChecks for VCS setting and for unsaved files.", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}, {Name: "CursorToHistPrev", Doc: "CursorToHistPrev moves cursor to previous position on history list --\nreturns true if moved", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Returns: []string{"bool"}}, {Name: "CursorToHistNext", Doc: "CursorToHistNext moves cursor to next position on history list --\nreturns true if moved", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Returns: []string{"bool"}}, {Name: "ReplaceInActive", Doc: "ReplaceInActive does query-replace in active file only", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}, {Name: "CutRect", Doc: "CutRect cuts rectangle in active text view", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}, {Name: "CopyRect", Doc: "CopyRect copies rectangle in active text view", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}, {Name: "PasteRect", Doc: "PasteRect cuts rectangle in active text view", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}, {Name: "RegisterCopy", Doc: "RegisterCopy saves current selection in active text view to register of given name\nreturns true if saved", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Args: []string{"name"}, Returns: []string{"bool"}}, {Name: "RegisterPaste", Doc: "RegisterPaste pastes register of given name into active text view\nreturns true if pasted", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Args: []string{"name"}, Returns: []string{"bool"}}, {Name: "CommentOut", Doc: "CommentOut comments-out selected lines in active text view\nand uncomments if already commented\nIf multiple lines are selected and any line is uncommented all will be commented", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Returns: []string{"bool"}}, {Name: "Indent", Doc: "Indent indents selected lines in active view", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Returns: []string{"bool"}}, {Name: "ReCase", Doc: "ReCase replaces currently selected text in current active view with given case", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Args: []string{"c"}, Returns: []string{"string"}}, {Name: "JoinParaLines", Doc: "JoinParaLines merges sequences of lines with hard returns forming paragraphs,\nseparated by blank lines, into a single line per paragraph,\nfor given selected region (full text if no selection)", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}, {Name: "TabsToSpaces", Doc: "TabsToSpaces converts tabs to spaces\nfor given selected region (full text if no selection)", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}, {Name: "SpacesToTabs", Doc: "SpacesToTabs converts spaces to tabs\nfor given selected region (full text if no selection)", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}, {Name: "DiffFiles", Doc: "DiffFiles shows the differences between two given files\nin side-by-side DiffView and in the console as a context diff.\nIt opens the files as file nodes and uses existing contents if open already.", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Args: []string{"fnmA", "fnmB"}}, {Name: "DiffFileNode", Doc: "DiffFileNode shows the differences between given file node as the A file,\nand another given file as the B file,\nin side-by-side DiffView and in the console as a context diff.", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Args: []string{"fna", "fnmB"}}, {Name: "CountWords", Doc: "CountWords counts number of words (and lines) in active file\nreturns a string report thereof.", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Returns: []string{"string"}}, {Name: "CountWordsRegion", Doc: "CountWordsRegion counts number of words (and lines) in selected region in file\nif no selection, returns numbers for entire file.", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Returns: []string{"string"}}, {Name: "SaveActiveView", Doc: "SaveActiveView saves the contents of the currently-active texteditor", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}, {Name: "SaveActiveViewAs", Doc: "SaveActiveViewAs save with specified filename the contents of the\ncurrently-active texteditor", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Args: []string{"filename"}}, {Name: "RevertActiveView", Doc: "RevertActiveView revert active view to saved version", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}, {Name: "CloseActiveView", Doc: "CloseActiveView closes the buffer associated with active view", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}, {Name: "NextViewFile", Doc: "NextViewFile sets the next text view to view given file name -- include as\nmuch of name as possible to disambiguate -- will use the first matching --\nif already being viewed, that is activated -- returns texteditor and its\nindex, false if not found", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Args: []string{"fnm"}, Returns: []string{"TextEditor", "int", "bool"}}, {Name: "ViewFile", Doc: "ViewFile views file in an existing TextEditor if it is already viewing that\nfile, otherwise opens ViewFileNode in active buffer", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Args: []string{"fnm"}, Returns: []string{"TextEditor", "int", "bool"}}, {Name: "CloneActiveView", Doc: "CloneActiveView sets the next text view to view the same file currently being vieweds\nin the active view. returns text view and index", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Returns: []string{"TextEditor", "int"}}, {Name: "SaveAll", Doc: "SaveAll saves all of the open filenodes to their current file names\nand saves the project state if it has been saved before (i.e., the .code file exists)", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}, {Name: "EditProjSettings", Doc: "EditProjSettings allows editing of project settings (settings specific to this project)", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}, {Name: "SplitsSetView", Doc: "SplitsSetView sets split view splitters to given named setting", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Args: []string{"split"}}, {Name: "SplitsSave", Doc: "SplitsSave saves current splitter settings to named splitter settings under\nexisting name, and saves to prefs file", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Args: []string{"split"}}, {Name: "SplitsSaveAs", Doc: "SplitsSaveAs saves current splitter settings to new named splitter settings, and\nsaves to prefs file", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Args: []string{"name", "desc"}}, {Name: "SplitsEdit", Doc: "SplitsEdit opens the SplitsView editor to customize saved splitter settings", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}, {Name: "Find", Doc: "Find does Find / Replace in files, using given options and filters -- opens up a\nmain tab with the results and further controls.", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Args: []string{"find", "repl", "ignoreCase", "regExp", "loc", "langs"}}, {Name: "Spell", Doc: "Spell checks spelling in active text view", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}, {Name: "Symbols", Doc: "Symbols displays the Symbols of a file or package", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}, {Name: "Debug", Doc: "Debug starts the debugger on the RunExec executable.", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}, {Name: "DebugTest", Doc: "DebugTest runs the debugger using testing mode in current active texteditor path", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}, {Name: "DebugAttach", Doc: "DebugAttach runs the debugger by attaching to an already-running process.\npid is the process id to attach to.", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Args: []string{"pid"}}, {Name: "VCSUpdateAll", Doc: "VCSUpdateAll does an Update (e.g., Pull) on all VCS repositories within\nthe open tree nodes in FileTree.", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}, {Name: "VCSLog", Doc: "VCSLog shows the VCS log of commits for this file, optionally with a\nsince date qualifier: If since is non-empty, it should be\na date-like expression that the VCS will understand, such as\n1/1/2020, yesterday, last year, etc. SVN only understands a\nnumber as a maximum number of items to return.\nIf allFiles is true, then the log will show revisions for all files, not just\nthis one.\nReturns the Log and also shows it in a VCSLogView which supports further actions.", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Args: []string{"since"}, Returns: []string{"Log", "error"}}, {Name: "OpenConsoleTab", Doc: "OpenConsoleTab opens a main tab displaying console output (stdout, stderr)", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}, {Name: "ChooseRunExec", Doc: "ChooseRunExec selects the executable to run for the project", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}, Args: []string{"exePath"}}, {Name: "HelpWiki", Doc: "HelpWiki opens wiki page for code on github", Directives: []gti.Directive{{Tool: "gti", Directive: "add"}}}}, Embeds: []gti.Field{{Name: "Frame"}}, Fields: []gti.Field{{Name: "ProjRoot", Doc: "root directory for the project -- all projects must be organized within a top-level root directory, with all the files therein constituting the scope of the project -- by default it is the path for ProjFilename"}, {Name: "ProjFilename", Doc: "current project filename for saving / loading specific Code configuration information in a .code file (optional)"}, {Name: "ActiveFilename", Doc: "filename of the currently-active texteditor"}, {Name: "ActiveLang", Doc: "language for current active filename"}, {Name: "ActiveVCS", Doc: "VCS repo for current active filename"}, {Name: "ActiveVCSInfo", Doc: "VCS info for current active filename (typically branch or revision) -- for status"}, {Name: "Changed", Doc: "has the root changed? we receive update signals from root for changes"}, {Name: "StatusMessage", Doc: "the last status update message"}, {Name: "LastSaveTStamp", Doc: "timestamp for when a file was last saved -- provides dirty state for various updates including rebuilding in debugger"}, {Name: "Files", Doc: "all the files in the project directory and subdirectories"}, {Name: "ActiveTextEditorIdx", Doc: "index of the currently-active texteditor -- new files will be viewed in other views if available"}, {Name: "OpenNodes", Doc: "list of open nodes, most recent first"}, {Name: "CmdBufs", Doc: "the command buffers for commands run in this project"}, {Name: "CmdHistory", Doc: "history of commands executed in this session"}, {Name: "RunningCmds", Doc: "currently running commands in this project"}, {Name: "ArgVals", Doc: "current arg var vals"}, {Name: "Prefs", Doc: "settings for this project -- this is what is saved in a .code project file"}, {Name: "CurDbg", Doc: "current debug view"}, {Name: "KeySeq1", Doc: "first key in sequence if needs2 key pressed"}, {Name: "UpdtMu", Doc: "mutex for protecting overall updates to CodeView"}}, Instance: &CodeView{}})
// NewCodeView adds a new [CodeView] with the given name to the given parent:
// CodeView is the core editor and tab viewer framework for the Code system. The
diff --git a/code/codev/prefs.go b/code/codev/settings.go
similarity index 67%
rename from code/codev/prefs.go
rename to code/codev/settings.go
index 3053119b..a6119515 100644
--- a/code/codev/prefs.go
+++ b/code/codev/settings.go
@@ -16,30 +16,30 @@ import (
"cogentcore.org/core/giv"
)
-// Defaults sets new project defaults based on overall preferences
+// Defaults sets new project defaults based on overall settings
func (ge *CodeView) Defaults() {
- ge.Prefs.Files = code.Settings.Files
- ge.Prefs.Editor = gi.SystemSettings.Editor
- ge.Prefs.Splits = []float32{.1, .325, .325, .25}
- ge.Prefs.Debug = cdebug.DefaultParams
+ ge.Settings.Files = code.Settings.Files
+ ge.Settings.Editor = gi.SystemSettings.Editor
+ ge.Settings.Splits = []float32{.1, .325, .325, .25}
+ ge.Settings.Debug = cdebug.DefaultParams
}
// GrabPrefs grabs the current project preference settings from various
// places, e.g., prior to saving or editing.
func (ge *CodeView) GrabPrefs() {
sv := ge.Splits()
- ge.Prefs.Splits = sv.Splits
- ge.Prefs.Dirs = ge.Files.Dirs
+ ge.Settings.Splits = sv.Splits
+ ge.Settings.Dirs = ge.Files.Dirs
}
// ApplyPrefs applies current project preference settings into places where
// they are used -- only for those done prior to loading
func (ge *CodeView) ApplyPrefs() {
- ge.ProjFilename = ge.Prefs.ProjFilename
- ge.ProjRoot = ge.Prefs.ProjRoot
+ ge.ProjFilename = ge.Settings.ProjFilename
+ ge.ProjRoot = ge.Settings.ProjRoot
if ge.Files != nil {
- ge.Files.Dirs = ge.Prefs.Dirs
- ge.Files.DirsOnTop = ge.Prefs.Files.DirsOnTop
+ ge.Files.Dirs = ge.Settings.Dirs
+ ge.Files.DirsOnTop = ge.Settings.Files.DirsOnTop
}
if len(ge.Kids) > 0 {
for i := 0; i < NTextEditors; i++ {
@@ -54,21 +54,21 @@ func (ge *CodeView) ApplyPrefs() {
}
}
split := ge.Splits()
- split.SetSplits(ge.Prefs.Splits...)
+ split.SetSplits(ge.Settings.Splits...)
}
gi.UpdateAll() // drives full rebuild
}
-// ApplyPrefsAction applies current preferences to the project, and updates the project
+// ApplyPrefsAction applies current settings to the project, and updates the project
func (ge *CodeView) ApplyPrefsAction() {
ge.ApplyPrefs()
- ge.SplitsSetView(ge.Prefs.SplitName)
+ ge.SplitsSetView(ge.Settings.SplitName)
ge.SetStatus("Applied prefs")
}
-// EditProjPrefs allows editing of project preferences (settings specific to this project)
-func (ge *CodeView) EditProjPrefs() { //gti:add
- sv := code.ProjPrefsView(&ge.Prefs)
+// EditProjSettings allows editing of project settings (settings specific to this project)
+func (ge *CodeView) EditProjSettings() { //gti:add
+ sv := code.ProjSettingsView(&ge.Settings)
if sv != nil {
sv.OnChange(func(e events.Event) {
ge.ApplyPrefsAction()
@@ -78,7 +78,7 @@ func (ge *CodeView) EditProjPrefs() { //gti:add
func (ge *CodeView) CallSplitsSetView(ctx gi.Widget) {
fb := giv.NewSoloFuncButton(ctx, ge.SplitsSetView)
- fb.Args[0].SetValue(ge.Prefs.SplitName)
+ fb.Args[0].SetValue(ge.Settings.SplitName)
fb.CallFunc()
}
@@ -88,7 +88,7 @@ func (ge *CodeView) SplitsSetView(split code.SplitName) { //gti:add
sp, _, ok := code.AvailSplits.SplitByName(split)
if ok {
sv.SetSplitsAction(sp.Splits...)
- ge.Prefs.SplitName = split
+ ge.Settings.SplitName = split
if !ge.PanelIsOpen(ge.ActiveTextEditorIdx + TextEditor1Idx) {
ge.SetActiveTextEditorIdx((ge.ActiveTextEditorIdx + 1) % 2)
}
@@ -121,25 +121,25 @@ func (ge *CodeView) SplitsEdit() { //gti:add
// LangDefaults applies default language settings based on MainLang
func (ge *CodeView) LangDefaults() {
- ge.Prefs.RunCmds = code.CmdNames{"Build: Run Proj"}
- ge.Prefs.BuildDir = ge.Prefs.ProjRoot
- ge.Prefs.BuildTarg = ge.Prefs.ProjRoot
- ge.Prefs.RunExec = gi.Filename(filepath.Join(string(ge.Prefs.ProjRoot), ge.Nm))
- if len(ge.Prefs.BuildCmds) == 0 {
- switch ge.Prefs.MainLang {
+ ge.Settings.RunCmds = code.CmdNames{"Build: Run Proj"}
+ ge.Settings.BuildDir = ge.Settings.ProjRoot
+ ge.Settings.BuildTarg = ge.Settings.ProjRoot
+ ge.Settings.RunExec = gi.Filename(filepath.Join(string(ge.Settings.ProjRoot), ge.Nm))
+ if len(ge.Settings.BuildCmds) == 0 {
+ switch ge.Settings.MainLang {
case fi.Go:
- ge.Prefs.BuildCmds = code.CmdNames{"Go: Build Proj"}
+ ge.Settings.BuildCmds = code.CmdNames{"Go: Build Proj"}
case fi.TeX:
- ge.Prefs.BuildCmds = code.CmdNames{"LaTeX: LaTeX PDF"}
- ge.Prefs.RunCmds = code.CmdNames{"File: Open Target"}
+ ge.Settings.BuildCmds = code.CmdNames{"LaTeX: LaTeX PDF"}
+ ge.Settings.RunCmds = code.CmdNames{"File: Open Target"}
default:
- ge.Prefs.BuildCmds = code.CmdNames{"Build: Make"}
+ ge.Settings.BuildCmds = code.CmdNames{"Build: Make"}
}
}
- if ge.Prefs.VersCtrl == "" {
+ if ge.Settings.VersCtrl == "" {
repo, _ := ge.Files.FirstVCS()
if repo != nil {
- ge.Prefs.VersCtrl = filetree.VersCtrlName(repo.Vcs())
+ ge.Settings.VersCtrl = filetree.VersCtrlName(repo.Vcs())
}
}
}
@@ -153,7 +153,7 @@ func (ge *CodeView) GuessMainLang() bool {
for _, ec := range ecs {
ls := fi.ExtKnown(ec.Name)
if ls != fi.Unknown {
- ge.Prefs.MainLang = ls
+ ge.Settings.MainLang = ls
return true
}
}
diff --git a/code/codev/texteditors.go b/code/codev/texteditors.go
index 388adf33..f2af06df 100644
--- a/code/codev/texteditors.go
+++ b/code/codev/texteditors.go
@@ -24,7 +24,7 @@ import (
// ConfigTextBuf configures the text buf according to prefs
func (ge *CodeView) ConfigTextBuf(tb *texteditor.Buf) {
tb.SetHiStyle(gi.AppearanceSettings.HiStyle)
- tb.Opts.EditorSettings = ge.Prefs.Editor
+ tb.Opts.EditorSettings = ge.Settings.Editor
tb.ConfigKnown()
if tb.Complete != nil {
tb.Complete.LookupFunc = ge.LookupFun
@@ -46,7 +46,7 @@ func (ge *CodeView) ActiveFileNode() *filetree.Node {
return ge.FileNodeForFile(string(ge.ActiveFilename), false)
}
-// TextEditorIndex finds index of given textview (0 or 1)
+// TextEditorIndex finds index of given texteditor (0 or 1)
func (ge *CodeView) TextEditorIndex(av *code.TextEditor) int {
for i := 0; i < NTextEditors; i++ {
tv := ge.TextEditorByIndex(i)
@@ -117,7 +117,7 @@ func (ge *CodeView) SetActiveFileInfo(buf *texteditor.Buf) {
}
}
-// SetActiveTextEditor sets the given textview as the active one, and returns its index
+// SetActiveTextEditor sets the given texteditor as the active one, and returns its index
func (ge *CodeView) SetActiveTextEditor(av *code.TextEditor) int {
updt := ge.UpdateStart()
defer ge.UpdateEndLayout(updt)
@@ -136,7 +136,7 @@ func (ge *CodeView) SetActiveTextEditor(av *code.TextEditor) int {
}
// SetActiveTextEditorIdx sets the given view index as the currently-active
-// TextEditor -- returns that textview. This is the main method for
+// TextEditor -- returns that texteditor. This is the main method for
// activating a text editor.
func (ge *CodeView) SetActiveTextEditorIdx(idx int) *code.TextEditor {
updt := ge.UpdateStart()
@@ -174,7 +174,7 @@ func (ge *CodeView) NextTextEditor() (*code.TextEditor, int) {
return ge.TextEditorByIndex(nxt), nxt
}
-// SwapTextEditors switches the buffers for the two open textviews
+// SwapTextEditors switches the buffers for the two open texteditors
// only operates if both panels are open
func (ge *CodeView) SwapTextEditors() bool {
if !ge.PanelIsOpen(TextEditor1Idx) || !ge.PanelIsOpen(TextEditor1Idx+1) {
@@ -247,7 +247,7 @@ func (ge *CodeView) OpenFindURL(ur string, ftv *texteditor.Editor) bool {
return fv.OpenFindURL(ur, ftv)
}
-// UpdateTextButtons updates textview menu buttons
+// UpdateTextButtons updates texteditor menu buttons
// is called by SetStatus and is generally under cover of TopUpdateStart / End
// doesn't do anything unless a change is required -- safe to call frequently.
func (ge *CodeView) UpdateTextButtons() {
diff --git a/code/codev/views.go b/code/codev/views.go
index 4d793999..eba3091c 100644
--- a/code/codev/views.go
+++ b/code/codev/views.go
@@ -26,14 +26,14 @@ import (
// ConfigFindButton configures the Find FuncButton with current params
func (ge *CodeView) ConfigFindButton(fb *giv.FuncButton) *giv.FuncButton {
- fb.Args[0].SetValue(ge.Prefs.Find.Find)
+ fb.Args[0].SetValue(ge.Settings.Find.Find)
fb.Args[0].SetTag("width", "80")
- fb.Args[1].SetValue(ge.Prefs.Find.Replace)
+ fb.Args[1].SetValue(ge.Settings.Find.Replace)
fb.Args[1].SetTag("width", "80")
- fb.Args[2].SetValue(ge.Prefs.Find.IgnoreCase)
- fb.Args[3].SetValue(ge.Prefs.Find.Regexp)
- fb.Args[4].SetValue(ge.Prefs.Find.Loc)
- fb.Args[5].SetValue(ge.Prefs.Find.Langs)
+ fb.Args[2].SetValue(ge.Settings.Find.IgnoreCase)
+ fb.Args[3].SetValue(ge.Settings.Find.Regexp)
+ fb.Args[4].SetValue(ge.Settings.Find.Loc)
+ fb.Args[5].SetValue(ge.Settings.Find.Langs)
return fb
}
@@ -47,10 +47,10 @@ func (ge *CodeView) Find(find string, repl string, ignoreCase bool, regExp bool,
if find == "" {
return
}
- ge.Prefs.Find.IgnoreCase = ignoreCase
- ge.Prefs.Find.Regexp = regExp
- ge.Prefs.Find.Langs = langs
- ge.Prefs.Find.Loc = loc
+ ge.Settings.Find.IgnoreCase = ignoreCase
+ ge.Settings.Find.Regexp = regExp
+ ge.Settings.Find.Langs = langs
+ ge.Settings.Find.Loc = loc
tv := ge.Tabs()
if tv == nil {
@@ -95,7 +95,7 @@ func (ge *CodeView) Find(find string, repl string, ignoreCase bool, regExp bool,
}
}
} else {
- res = code.FileTreeSearch(root, find, ignoreCase, regExp, loc, adir, langs)
+ res = code.FileTreeSearch(ge, root, find, ignoreCase, regExp, loc, adir, langs)
}
fv.ShowResults(res)
ge.FocusOnPanel(TabsIdx)
@@ -135,7 +135,7 @@ func (ge *CodeView) Symbols() { //gti:add
defer tv.UpdateEndLayout(updt)
sv := tv.RecycleTabWidget("Symbols", true, code.SymbolsViewType).(*code.SymbolsView)
- sv.ConfigSymbolsView(ge, ge.ProjPrefs().Symbols)
+ sv.ConfigSymbolsView(ge, ge.ProjSettings().Symbols)
sv.Update()
ge.FocusOnPanel(TabsIdx)
}
@@ -149,8 +149,8 @@ func (ge *CodeView) Debug() { //gti:add
updt := tv.UpdateStart()
defer tv.UpdateEndLayout(updt)
- ge.Prefs.Debug.Mode = cdebug.Exec
- exePath := string(ge.Prefs.RunExec)
+ ge.Settings.Debug.Mode = cdebug.Exec
+ exePath := string(ge.Settings.RunExec)
exe := filepath.Base(exePath)
dv := tv.RecycleTabWidget("Debug "+exe, true, code.DebugViewType).(*code.DebugView)
dv.ConfigDebugView(ge, fi.Go, exePath)
@@ -159,7 +159,7 @@ func (ge *CodeView) Debug() { //gti:add
ge.CurDbg = dv
}
-// DebugTest runs the debugger using testing mode in current active textview path
+// DebugTest runs the debugger using testing mode in current active texteditor path
func (ge *CodeView) DebugTest() { //gti:add
txv := ge.ActiveTextEditor()
if txv == nil || txv.Buf == nil {
@@ -172,7 +172,7 @@ func (ge *CodeView) DebugTest() { //gti:add
updt := tv.UpdateStart()
defer tv.UpdateEndLayout(updt)
- ge.Prefs.Debug.Mode = cdebug.Test
+ ge.Settings.Debug.Mode = cdebug.Test
tstPath := string(txv.Buf.Filename)
dir := filepath.Base(filepath.Dir(tstPath))
dv := tv.RecycleTabWidget("Debug "+dir, true, code.DebugViewType).(*code.DebugView)
@@ -192,9 +192,9 @@ func (ge *CodeView) DebugAttach(pid uint64) { //gti:add
updt := tv.UpdateStart()
defer tv.UpdateEndLayout(updt)
- ge.Prefs.Debug.Mode = cdebug.Attach
- ge.Prefs.Debug.PID = pid
- exePath := string(ge.Prefs.RunExec)
+ ge.Settings.Debug.Mode = cdebug.Attach
+ ge.Settings.Debug.PID = pid
+ exePath := string(ge.Settings.RunExec)
exe := filepath.Base(exePath)
dv := tv.RecycleTabWidget("Debug "+exe, true, code.DebugViewType).(*code.DebugView)
dv.ConfigDebugView(ge, fi.Go, exePath)
@@ -259,9 +259,9 @@ func (ge *CodeView) OpenConsoleTab() { //gti:add
// ChooseRunExec selects the executable to run for the project
func (ge *CodeView) ChooseRunExec(exePath gi.Filename) { //gti:add
if exePath != "" {
- ge.Prefs.RunExec = exePath
- ge.Prefs.BuildDir = gi.Filename(filepath.Dir(string(exePath)))
- if !ge.Prefs.RunExecIsExec() {
+ ge.Settings.RunExec = exePath
+ ge.Settings.BuildDir = gi.Filename(filepath.Dir(string(exePath)))
+ if !ge.Settings.RunExecIsExec() {
gi.MessageDialog(ge, fmt.Sprintf("RunExec file: %v is not exectable", exePath), "Not Executable")
}
}
diff --git a/code/doc.go b/code/doc.go
index 27fabd80..10630339 100644
--- a/code/doc.go
+++ b/code/doc.go
@@ -4,7 +4,7 @@
/*
Package code is the top-level repository for the Code Go-IDE based on
-the GoGi GUI framework.
+the Cogent Core GUI framework.
The following sub-packages provide all the code:
diff --git a/code/piv/gtigen.go b/code/piv/gtigen.go
index afe74e91..75377f46 100644
--- a/code/piv/gtigen.go
+++ b/code/piv/gtigen.go
@@ -24,7 +24,7 @@ var PiViewType = gti.AddType(>i.Type{
Directives: gti.Directives{},
Fields: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{
{"Parser", >i.Field{Name: "Parser", Type: "cogentcore.org/core/pi.Parser", LocalType: "pi.Parser", Doc: "the parser we are viewing", Directives: gti.Directives{}, Tag: ""}},
- {"Prefs", >i.Field{Name: "Prefs", Type: "cogentcore.org/cogent/code/piv.ProjPrefs", LocalType: "ProjPrefs", Doc: "project preferences -- this IS the project file", Directives: gti.Directives{}, Tag: ""}},
+ {"Prefs", >i.Field{Name: "Prefs", Type: "cogentcore.org/cogent/code/piv.ProjSettings", LocalType: "ProjSettings", Doc: "project settings -- this IS the project file", Directives: gti.Directives{}, Tag: ""}},
{"Changed", >i.Field{Name: "Changed", Type: "bool", LocalType: "bool", Doc: "has the root changed? we receive update signals from root for changes", Directives: gti.Directives{}, Tag: "json:\"-\""}},
{"FileState", >i.Field{Name: "FileState", Type: "cogentcore.org/core/pi.FileState", LocalType: "pi.FileState", Doc: "our own dedicated filestate for controlled parsing", Directives: gti.Directives{}, Tag: "json:\"-\""}},
{"TestBuf", >i.Field{Name: "TestBuf", Type: "cogentcore.org/core/gi/texteditor.Buf", LocalType: "texteditor.Buf", Doc: "test file buffer", Directives: gti.Directives{}, Tag: "json:\"-\""}},
@@ -67,10 +67,10 @@ func (t *PiView) SetParser(v pi.Parser) *PiView {
return t
}
-// SetPrefs sets the [PiView.Prefs]:
-// project preferences -- this IS the project file
-func (t *PiView) SetPrefs(v ProjPrefs) *PiView {
- t.Prefs = v
+// SetPrefs sets the [PiView.Settings]:
+// project settings -- this IS the project file
+func (t *PiView) SetPrefs(v ProjSettings) *PiView {
+ t.Settings = v
return t
}
diff --git a/code/piv/piview.go b/code/piv/piview.go
index ed2fdf3e..0540e2d8 100644
--- a/code/piv/piview.go
+++ b/code/piv/piview.go
@@ -49,8 +49,8 @@ type PiView struct {
// the parser we are viewing
Parser pi.Parser
- // project preferences -- this IS the project file
- Prefs ProjPrefs
+ // project settings -- this IS the project file
+ Prefs ProjSettings
// has the root changed? we receive update signals from root for changes
Changed bool `json:"-"`
@@ -98,10 +98,10 @@ func (pv *PiView) OpenProj(filename gi.Filename) *PiView { //gti:add
nprj.OpenProj(filename)
return nprj
}
- pv.Prefs.OpenJSON(filename)
+ pv.Settings.OpenJSON(filename)
pv.Config()
pv.ApplyPrefs()
- SavedPaths.AddPath(string(filename), gi.Prefs.Params.SavedPathsMax)
+ SavedPaths.AddPath(string(filename), gi.Settings.Params.SavedPathsMax)
SavePaths()
return pv
}
@@ -114,46 +114,46 @@ func (pv *PiView) NewProj() (*gi.Window, *PiView) { //gti:add
// SaveProj saves project prefs to current filename, in a standard JSON-formatted file
// also saves the current parser
func (pv *PiView) SaveProj() { //gti:add
- if pv.Prefs.ProjFile == "" {
+ if pv.Settings.ProjFile == "" {
return
}
pv.SaveParser()
pv.GetPrefs()
- pv.Prefs.SaveJSON(pv.Prefs.ProjFile)
+ pv.Settings.SaveJSON(pv.Settings.ProjFile)
pv.Changed = false
- pv.SetStatus(fmt.Sprintf("Project Saved to: %v", pv.Prefs.ProjFile))
+ pv.SetStatus(fmt.Sprintf("Project Saved to: %v", pv.Settings.ProjFile))
pv.UpdateSig() // notify our editor
}
// SaveProjAs saves lexer and parser rules to current filename, in a standard JSON-formatted file
// also saves the current parser
func (pv *PiView) SaveProjAs(filename gi.Filename) { //gti:add
- SavedPaths.AddPath(string(filename), gi.Prefs.Params.SavedPathsMax)
+ SavedPaths.AddPath(string(filename), gi.Settings.Params.SavedPathsMax)
SavePaths()
pv.SaveParser()
pv.GetPrefs()
- pv.Prefs.SaveJSON(filename)
+ pv.Settings.SaveJSON(filename)
pv.Changed = false
- pv.SetStatus(fmt.Sprintf("Project Saved to: %v", pv.Prefs.ProjFile))
+ pv.SetStatus(fmt.Sprintf("Project Saved to: %v", pv.Settings.ProjFile))
pv.UpdateSig() // notify our editor
}
// ApplyPrefs applies project-level prefs (e.g., after opening)
func (pv *PiView) ApplyPrefs() { //gti:add
fs := &pv.FileState
- fs.ParseState.Trace.CopyOpts(&pv.Prefs.TraceOpts)
- if pv.Prefs.ParserFile != "" {
- pv.OpenParser(pv.Prefs.ParserFile)
+ fs.ParseState.Trace.CopyOpts(&pv.Settings.TraceOpts)
+ if pv.Settings.ParserFile != "" {
+ pv.OpenParser(pv.Settings.ParserFile)
}
- if pv.Prefs.TestFile != "" {
- pv.OpenTest(pv.Prefs.TestFile)
+ if pv.Settings.TestFile != "" {
+ pv.OpenTest(pv.Settings.TestFile)
}
}
// GetPrefs gets the current values of things for prefs
func (pv *PiView) GetPrefs() {
fs := &pv.FileState
- pv.Prefs.TraceOpts.CopyOpts(&fs.ParseState.Trace)
+ pv.Settings.TraceOpts.CopyOpts(&fs.ParseState.Trace)
}
/////////////////////////////////////////////////////////////////////////
@@ -162,23 +162,23 @@ func (pv *PiView) GetPrefs() {
// OpenParser opens lexer and parser rules to current filename, in a standard JSON-formatted file
func (pv *PiView) OpenParser(filename gi.Filename) { //gti:add
pv.Parser.OpenJSON(string(filename))
- pv.Prefs.ParserFile = filename
+ pv.Settings.ParserFile = filename
pv.Config()
}
// SaveParser saves lexer and parser rules to current filename, in a standard JSON-formatted file
func (pv *PiView) SaveParser() { //gti:add
- if pv.Prefs.ParserFile == "" {
+ if pv.Settings.ParserFile == "" {
return
}
- pv.Parser.SaveJSON(string(pv.Prefs.ParserFile))
+ pv.Parser.SaveJSON(string(pv.Settings.ParserFile))
- ext := filepath.Ext(string(pv.Prefs.ParserFile))
- pigfn := strings.TrimSuffix(string(pv.Prefs.ParserFile), ext) + ".pig"
+ ext := filepath.Ext(string(pv.Settings.ParserFile))
+ pigfn := strings.TrimSuffix(string(pv.Settings.ParserFile), ext) + ".pig"
pv.Parser.SaveGrammar(pigfn)
pv.Changed = false
- pv.SetStatus(fmt.Sprintf("Parser Saved to: %v", pv.Prefs.ParserFile))
+ pv.SetStatus(fmt.Sprintf("Parser Saved to: %v", pv.Settings.ParserFile))
pv.UpdateSig() // notify our editor
}
@@ -186,28 +186,28 @@ func (pv *PiView) SaveParser() { //gti:add
func (pv *PiView) SaveParserAs(filename gi.Filename) { //gti:add
pv.Parser.SaveJSON(string(filename))
- ext := filepath.Ext(string(pv.Prefs.ParserFile))
- pigfn := strings.TrimSuffix(string(pv.Prefs.ParserFile), ext) + ".pig"
+ ext := filepath.Ext(string(pv.Settings.ParserFile))
+ pigfn := strings.TrimSuffix(string(pv.Settings.ParserFile), ext) + ".pig"
pv.Parser.SaveGrammar(pigfn)
pv.Changed = false
- pv.Prefs.ParserFile = filename
- pv.SetStatus(fmt.Sprintf("Parser Saved to: %v", pv.Prefs.ParserFile))
+ pv.Settings.ParserFile = filename
+ pv.SetStatus(fmt.Sprintf("Parser Saved to: %v", pv.Settings.ParserFile))
pv.UpdateSig() // notify our editor
}
// OpenTest opens test file
func (pv *PiView) OpenTest(filename gi.Filename) { //gti:add
pv.TestBuf.OpenFile(filename)
- pv.Prefs.TestFile = filename
+ pv.Settings.TestFile = filename
}
// SaveTestAs saves the test file as..
func (pv *PiView) SaveTestAs(filename gi.Filename) {
pv.TestBuf.EditDone()
pv.TestBuf.SaveFile(filename)
- pv.Prefs.TestFile = filename
- pv.SetStatus(fmt.Sprintf("TestFile Saved to: %v", pv.Prefs.TestFile))
+ pv.Settings.TestFile = filename
+ pv.SetStatus(fmt.Sprintf("TestFile Saved to: %v", pv.Settings.TestFile))
}
// SetStatus updates the statusbar label with given message, along with other status info
@@ -224,7 +224,7 @@ func (pv *PiView) SetStatus(msg string) {
fnm := ""
ln := 0
ch := 0
- if tv, ok := pv.TestTextView(); ok {
+ if tv, ok := pv.TestTextEditor(); ok {
ln = tv.CursorPos.Ln + 1
ch = tv.CursorPos.Ch
if tv.ISearch.On {
@@ -622,8 +622,8 @@ func (pv *PiView) RecycleMainTab(label string, typ reflect.Type, sel bool) gi.Wi
return widg
}
-// ConfigTextView configures text view
-func (pv *PiView) ConfigTextView(ly *gi.Layout, out bool) *texteditor.Editor {
+// ConfigTextEditor configures text view
+func (pv *PiView) ConfigTextEditor(ly *gi.Layout, out bool) *texteditor.Editor {
ly.Lay = gi.LayoutVert
ly.SetStretchMaxWidth()
ly.SetStretchMaxHeight()
@@ -632,20 +632,20 @@ func (pv *PiView) ConfigTextView(ly *gi.Layout, out bool) *texteditor.Editor {
var tv *texteditor.Editor
updt := false
if ly.HasChildren() {
- tv = ly.Child(0).Embed(giv.KiT_TextView).(*texteditor.Editor)
+ tv = ly.Child(0).Embed(giv.KiT_TextEditor).(*texteditor.Editor)
} else {
updt = ly.UpdateStart()
ly.SetChildAdded()
- tv = ly.NewChild(giv.KiT_TextView, ly.Nm).(*texteditor.Editor)
+ tv = ly.NewChild(giv.KiT_TextEditor, ly.Nm).(*texteditor.Editor)
}
- if gi.Prefs.Editor.WordWrap {
+ if gi.Settings.Editor.WordWrap {
tv.SetProp("white-space", styles.WhiteSpacePreWrap)
} else {
tv.SetProp("white-space", styles.WhiteSpacePre)
}
tv.SetProp("tab-size", 4)
- tv.SetProp("font-family", gi.Prefs.MonoFont)
+ tv.SetProp("font-family", gi.Settings.MonoFont)
if out {
tv.SetInactive()
}
@@ -653,34 +653,34 @@ func (pv *PiView) ConfigTextView(ly *gi.Layout, out bool) *texteditor.Editor {
return tv
}
-// RecycleMainTabTextView returns a MainTabs (first set of tabs) tab with given
+// RecycleMainTabTextEditor returns a MainTabs (first set of tabs) tab with given
// name, first by looking for an existing one, and if not found, making a new
-// one with a Layout and then a TextView in it. if sel, then select it.
+// one with a Layout and then a TextEditor in it. if sel, then select it.
// returns widget
-func (pv *PiView) RecycleMainTabTextView(label string, sel bool, out bool) *texteditor.Editor {
+func (pv *PiView) RecycleMainTabTextEditor(label string, sel bool, out bool) *texteditor.Editor {
ly := pv.RecycleMainTab(label, gi.LayoutType, sel).Embed(gi.LayoutType).(*gi.Layout)
- tv := pv.ConfigTextView(ly, out)
+ tv := pv.ConfigTextEditor(ly, out)
return tv
}
-// MainTabTextViewByName returns the textview for given main tab, if it exists
-func (pv *PiView) MainTabTextViewByName(tabnm string) (*texteditor.Editor, bool) {
+// MainTabTextEditorByName returns the texteditor for given main tab, if it exists
+func (pv *PiView) MainTabTextEditorByName(tabnm string) (*texteditor.Editor, bool) {
lyk, err := pv.MainTabByNameTry(tabnm)
if err != nil {
return nil, false
}
- ctv := lyk.Child(0).Embed(giv.KiT_TextView).(*texteditor.Editor)
+ ctv := lyk.Child(0).Embed(giv.KiT_TextEditor).(*texteditor.Editor)
return ctv, true
}
-// TextTextView returns the textview for TestBuf TextView
-func (pv *PiView) TestTextView() (*texteditor.Editor, bool) {
- return pv.MainTabTextViewByName("TestText")
+// TextTextEditor returns the texteditor for TestBuf TextEditor
+func (pv *PiView) TestTextEditor() (*texteditor.Editor, bool) {
+ return pv.MainTabTextEditorByName("TestText")
}
// OpenConsoleTab opens a main tab displaying console output (stdout, stderr)
func (pv *PiView) OpenConsoleTab() {
- ctv := pv.RecycleMainTabTextView("Console", true, true)
+ ctv := pv.RecycleMainTabTextEditor("Console", true, true)
ctv.SetInactive()
ctv.SetProp("white-space", styles.WhiteSpacePre) // no word wrap
if ctv.Buf == nil || ctv.Buf != code.TheConsole.Buf {
@@ -694,7 +694,7 @@ func (pv *PiView) OpenConsoleTab() {
// OpenTestTextTab opens a main tab displaying test text
func (pv *PiView) OpenTestTextTab() {
- ctv := pv.RecycleMainTabTextView("TestText", true, false)
+ ctv := pv.RecycleMainTabTextEditor("TestText", true, false)
if ctv.Buf == nil || ctv.Buf != &pv.TestBuf {
ctv.SetBuf(&pv.TestBuf)
}
@@ -702,7 +702,7 @@ func (pv *PiView) OpenTestTextTab() {
// OpenOutTab opens a main tab displaying all output
func (pv *PiView) OpenOutTab() {
- ctv := pv.RecycleMainTabTextView("Output", true, true)
+ ctv := pv.RecycleMainTabTextEditor("Output", true, true)
ctv.SetInactive()
ctv.SetProp("white-space", styles.WhiteSpacePre) // no word wrap
if ctv.Buf == nil || ctv.Buf != &pv.OutBuf {
@@ -712,7 +712,7 @@ func (pv *PiView) OpenOutTab() {
// OpenLexTab opens a main tab displaying lexer output
func (pv *PiView) OpenLexTab() {
- ctv := pv.RecycleMainTabTextView("LexOut", true, true)
+ ctv := pv.RecycleMainTabTextEditor("LexOut", true, true)
if ctv.Buf == nil || ctv.Buf != &pv.LexBuf {
ctv.SetBuf(&pv.LexBuf)
}
@@ -720,7 +720,7 @@ func (pv *PiView) OpenLexTab() {
// OpenParseTab opens a main tab displaying parser output
func (pv *PiView) OpenParseTab() {
- ctv := pv.RecycleMainTabTextView("ParseOut", true, true)
+ ctv := pv.RecycleMainTabTextEditor("ParseOut", true, true)
if ctv.Buf == nil || ctv.Buf != &pv.ParseBuf {
ctv.SetBuf(&pv.ParseBuf)
}
@@ -894,18 +894,18 @@ func (pv *PiView) ConfigSplitView() {
astt := astfr.NewChild(giv.KiT_TreeView, "ast-tree").(*giv.TreeView)
astt.SetRootNode(&fs.Ast)
- pv.TestBuf.SetHiStyle(gi.Prefs.Colors.HiStyle)
+ pv.TestBuf.SetHiStyle(gi.Settings.Colors.HiStyle)
pv.TestBuf.Hi.Off = true // prevent auto-hi
- pv.OutBuf.SetHiStyle(gi.Prefs.Colors.HiStyle)
+ pv.OutBuf.SetHiStyle(gi.Settings.Colors.HiStyle)
pv.OutBuf.Opts.LineNos = false
fs.ParseState.Trace.Init()
fs.ParseState.Trace.PipeOut()
go pv.MonitorOut()
- pv.LexBuf.SetHiStyle(gi.Prefs.Colors.HiStyle)
- pv.ParseBuf.SetHiStyle(gi.Prefs.Colors.HiStyle)
+ pv.LexBuf.SetHiStyle(gi.Settings.Colors.HiStyle)
+ pv.ParseBuf.SetHiStyle(gi.Settings.Colors.HiStyle)
split.SetSplits(.15, .15, .2, .15, .35)
split.UpdateEnd(updt)
@@ -1032,9 +1032,9 @@ func (ge *PiView) PiViewKeys(kt *key.ChordEvent) {
// switch gkf {
// case keyfun.Find:
// kt.SetProcessed()
- // tv := ge.ActiveTextView()
+ // tv := ge.ActiveTextEditor()
// if tv.HasSelection() {
- // ge.Prefs.Find.Find = string(tv.Selection().ToBytes())
+ // ge.Settings.Find.Find = string(tv.Selection().ToBytes())
// }
// giv.CallMethod(ge, "Find", ge.Viewport)
// }
@@ -1117,8 +1117,8 @@ func (pv *PiView) Render2D() {
var PiViewProps = ki.Props{
"EnumType:Flag": gi.KiT_NodeFlags,
- "background-color": &gi.Prefs.Colors.Background,
- "color": &gi.Prefs.Colors.Font,
+ "background-color": &gi.Settings.Colors.Background,
+ "color": &gi.Settings.Colors.Font,
"max-width": -1,
"max-height": -1,
"#title": ki.Props{
@@ -1133,7 +1133,7 @@ var PiViewProps = ki.Props{
"desc": "Save GoPi project file to standard JSON-formatted file",
"updtfunc": giv.ActionUpdateFunc(func(pvi any, act *gi.Button) {
pv := pvi.(*PiView)
- act.SetActiveState( pv.Changed && pv.Prefs.ProjFile != "")
+ act.SetActiveState( pv.Changed && pv.Settings.ProjFile != "")
}),
}},
{"sep-parse", ki.BlankProp{}},
@@ -1153,7 +1153,7 @@ var PiViewProps = ki.Props{
"desc": "Save lexer and parser rules from file standard JSON-formatted file",
"updtfunc": giv.ActionUpdateFunc(func(pvi any, act *gi.Button) {
pv := pvi.(*PiView)
- act.SetActiveStateUpdt( pv.Changed && pv.Prefs.ParserFile != "")
+ act.SetActiveStateUpdt( pv.Changed && pv.Settings.ParserFile != "")
}),
}},
{"SaveParserAs", ki.Props{
@@ -1267,7 +1267,7 @@ var PiViewProps = ki.Props{
"desc": "Save GoPi project file to standard JSON-formatted file",
"updtfunc": giv.ActionUpdateFunc(func(pvi any, act *gi.Button) {
pv := pvi.(*PiView)
- act.SetActiveState( pv.Changed && pv.Prefs.ProjFile != "")
+ act.SetActiveState( pv.Changed && pv.Settings.ProjFile != "")
}),
}},
{"SaveProjAs", ki.Props{
@@ -1298,7 +1298,7 @@ var PiViewProps = ki.Props{
"desc": "Save lexer and parser rules to file standard JSON-formatted file",
"updtfunc": giv.ActionUpdateFunc(func(pvi any, act *gi.Button) {
pv := pvi.(*PiView)
- act.SetActiveState( pv.Changed && pv.Prefs.ParserFile != "")
+ act.SetActiveState( pv.Changed && pv.Settings.ParserFile != "")
}),
}},
{"SaveParserAs", ki.Props{
diff --git a/code/piv/prefs.go b/code/piv/prefs.go
index 67f48e04..0eb4165e 100644
--- a/code/piv/prefs.go
+++ b/code/piv/prefs.go
@@ -16,8 +16,8 @@ import (
"cogentcore.org/core/pi/parse"
)
-// ProjPrefs are the preferences for saving for a project -- this IS the project file
-type ProjPrefs struct {
+// ProjSettings are the settings for saving for a project -- this IS the project file
+type ProjSettings struct {
// filename for project (i.e, these preference)
ProjFile gi.Filename
@@ -33,7 +33,7 @@ type ProjPrefs struct {
}
// Open open from file
-func (pf *ProjPrefs) Open(filename gi.Filename) error {
+func (pf *ProjSettings) Open(filename gi.Filename) error {
b, err := os.ReadFile(string(filename))
if err != nil {
return err
@@ -46,7 +46,7 @@ func (pf *ProjPrefs) Open(filename gi.Filename) error {
}
// Save save to file
-func (pf *ProjPrefs) Save(filename gi.Filename) error {
+func (pf *ProjSettings) Save(filename gi.Filename) error {
pf.ProjFile = filename
b, err := json.MarshalIndent(pf, "", " ")
if err != nil {
diff --git a/glide/README.md b/glide/README.md
index e8bd508f..61ea83fa 100644
--- a/glide/README.md
+++ b/glide/README.md
@@ -1,14 +1,14 @@
# glide
-Glide is GoGi-based Lightweight Internet Display Engine (i.e., a web browser in native Go)
+Glide is Cogent Core-based Lightweight Internet Display Engine (i.e., a web browser in native Go)
-No plans to actually write this for a while, but just bookmarking the name, which fits with the other major apps based on GoGi, featuring the same basic letters (code, grid, glide).
+No plans to actually write this for a while, but just bookmarking the name, which fits with the other major apps based on Cogent Core, featuring the same basic letters (code, grid, glide).
-*Glide* connotes a lightweight floating feeling as you surf the gentle breezes of the interwebs. And the lightweight nature of the codebase, which leverages the extensive HTML / CSS based nature of GoGi, so that the main work is just parsing the HTML and turning it into the DOM tree, which is just the corresponding GoGi scenegraph. Probably have to add a few tweaks and widgets or something but really basic rendering should happen almost immediately, which is what will lead to a seductive feeling of gliding through development, which will result in entirely too much time spent in coding bliss :)
+*Glide* connotes a lightweight floating feeling as you surf the gentle breezes of the interwebs. And the lightweight nature of the codebase, which leverages the extensive HTML / CSS based nature of Cogent Core, so that the main work is just parsing the HTML and turning it into the DOM tree, which is just the corresponding Cogent Core scenegraph. Probably have to add a few tweaks and widgets or something but really basic rendering should happen almost immediately, which is what will lead to a seductive feeling of gliding through development, which will result in entirely too much time spent in coding bliss :)
And to what end? The inevitable existential question: does the world need another web browser? Certainly not!
And getting all the details right is a "long tailed process" with diminishing returns.
-Hence, *Glide* will focus on getting just the basics right-enough, to support things like a help browser for HTML-formatted help information, and various other forms of static content. There are various JS implementations in pure Go (right?) and interfacing those to the GoGi DOM should be relatively easy (right?), so basic functionality there could be pretty entertaining. All those Go backends could finally run on a Go frontend!
+Hence, *Glide* will focus on getting just the basics right-enough, to support things like a help browser for HTML-formatted help information, and various other forms of static content. There are various JS implementations in pure Go (right?) and interfacing those to the Cogent Core DOM should be relatively easy (right?), so basic functionality there could be pretty entertaining. All those Go backends could finally run on a Go frontend!