Remove the view command and the editor setting with it
`view` was the last user of `editor`, so leaving the setting behind would have made it exactly what `gitkey` was until recently: documented, parsed, and doing nothing. It is gone from the struct, the template, the environment, `config -k` and the settings table. Both names are free for aliases now, as `open` already was. The tests that used `editor` as their example of a project-overridable setting use `gitkey` instead, which is the same kind of thing and still exists. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
-37
@@ -573,42 +573,6 @@ func runCommandDepth(line string, depth int) bool {
|
||||
}
|
||||
}
|
||||
|
||||
case "view": // open a project in Xcode / the configured editor
|
||||
prj := PRJ
|
||||
if w := word(words, 1); w != "" {
|
||||
prj = w
|
||||
}
|
||||
d := BASE + "/" + prj
|
||||
if !validProject(prj) || !isDir(d) {
|
||||
errorln("not found")
|
||||
break
|
||||
}
|
||||
xws, xprj := "", ""
|
||||
if entries, err := os.ReadDir(d); err == nil {
|
||||
for _, e := range entries {
|
||||
if strings.HasSuffix(e.Name(), ".xcworkspace") {
|
||||
xws = e.Name()
|
||||
}
|
||||
if strings.HasSuffix(e.Name(), ".xcodeproj") {
|
||||
xprj = e.Name()
|
||||
}
|
||||
}
|
||||
}
|
||||
// prefer the workspace over the project; fall back to the editor unless
|
||||
// one of them is really openable (a name match on a plain file is not).
|
||||
switch {
|
||||
case xws != "" && isDir(d+"/"+xws):
|
||||
runInDir(d, "open", xws)
|
||||
case xprj != "" && isDir(d+"/"+xprj):
|
||||
runInDir(d, "open", xprj)
|
||||
default:
|
||||
editor := cfg.Editor
|
||||
if editor == "" {
|
||||
editor = "coda"
|
||||
}
|
||||
runInDir(d, editor, d)
|
||||
}
|
||||
|
||||
case "count": // count source lines in the project
|
||||
if !requireProject() {
|
||||
break
|
||||
@@ -806,7 +770,6 @@ const gitignore = `.DS_Store
|
||||
|
||||
var helpItems = []struct{ cmd, desc string }{
|
||||
{"cd [project]", "change project (no argument: back to the base)"},
|
||||
{"view [project]", "open project in Xcode / the editor"},
|
||||
{"init", "make new repository from current directory"},
|
||||
{"push [comment]", "push changes to git server"},
|
||||
{"pushremote [@name] [desc]", "mirror repo to the public server(s) (gitea/github/gitlab)"},
|
||||
|
||||
Reference in New Issue
Block a user