markclear
This commit is contained in:
1 parent
bf39c7c63b
commit
5e3a188618
3 files changed
+21
No files matched your search
@@ -470,6 +470,7 @@ func insert(app *app, arg string) {
|
||||
return
|
||||
}
|
||||
app.nav.marks[arg] = wd
|
||||
|
||||
case app.ui.cmdPrefix == "mark-load: ":
|
||||
normal(app)
|
||||
|
||||
@@ -766,6 +767,24 @@ func (e *callExpr) eval(app *app, args []string) {
|
||||
case "mark-load":
|
||||
app.ui.menuBuf = listMarks(app.nav.marks)
|
||||
app.ui.cmdPrefix = "mark-load: "
|
||||
case "mark-clear":
|
||||
if len(app.nav.marks) != 0 {
|
||||
if (len(args) != 0) {
|
||||
for _, v:= range args {
|
||||
if _, ok := app.nav.marks[v]; ok {
|
||||
delete(app.nav.marks, v)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
app.ui.echoerrf("removing everything")
|
||||
os.Create(gMarksPath)
|
||||
app.nav.marks = make(map[string]string)
|
||||
if err := remote("send mark-clear " + strings.Join(args[:], " ")); err != nil {
|
||||
app.ui.echoerrf("remote mark-clear: %s", err)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
case "sync":
|
||||
if err := app.nav.sync(); err != nil {
|
||||
app.ui.echoerrf("sync: %s", err)
|
||||
|
||||
Reference in new issue
Block a user