* initial tags implementation

* add tag to complete.go

* add gTagsPath to os_windows.go

* change behaviour to match other commands

* add tag-toggle to complete.go

* add tag and tag-toggle to docs

* address feedback about tags
This commit is contained in:
Santos authored and GitHub committed 2022-03-28 15:43:05 +03:00
1 parent 2f9d840eda
commit 5a5628d667
11 files changed
+440 -205

No files matched your search

+44
View File
@@ -983,6 +983,50 @@ func (e *callExpr) eval(app *app, args []string) {
}
}
}
case "tag-toggle":
if !app.nav.init {
return
}
if len(e.args) == 0 {
app.ui.echoerr("tag-toggle: missing default tag")
} else if err := app.nav.toggleTag(e.args[0]); err != nil {
app.ui.echoerrf("tag-toggle: %s", err)
} else if err := app.nav.writeTags(); err != nil {
app.ui.echoerrf("tag-toggle: %s", err)
}
if gSingleMode {
if err := app.nav.sync(); err != nil {
app.ui.echoerrf("tag-toggle: %s", err)
}
} else {
if err := remote("send sync"); err != nil {
app.ui.echoerrf("tag-toggle: %s", err)
}
}
case "tag":
if !app.nav.init {
return
}
if len(e.args) == 0 {
app.ui.echoerr("tag: missing tag")
} else if err := app.nav.tag(e.args[0]); err != nil {
app.ui.echoerrf("tag: %s", err)
} else if err := app.nav.writeTags(); err != nil {
app.ui.echoerrf("tag: %s", err)
}
if gSingleMode {
if err := app.nav.sync(); err != nil {
app.ui.echoerrf("tag: %s", err)
}
} else {
if err := remote("send sync"); err != nil {
app.ui.echoerrf("tag: %s", err)
}
}
case "invert":
if !app.nav.init {
return