diff --git a/comp.go b/comp.go index c18eb27..0d079c9 100644 --- a/comp.go +++ b/comp.go @@ -32,6 +32,7 @@ var ( "delete", "put", "clear", + "redraw", "reload", "read", "read-shell", @@ -43,7 +44,6 @@ var ( "search-prev", "sync", "echo", - "redraw", "cd", "push", } diff --git a/doc.go b/doc.go index 4660dc5..38db921 100644 --- a/doc.go +++ b/doc.go @@ -30,6 +30,7 @@ The following commands are provided by lf with default keybindings: delete (default 'd') put (default 'p') clear (default 'c') + redraw (default '') reload (default '') read (default ':') read-shell (default '$') @@ -44,7 +45,6 @@ The following commands are provided by lf without default keybindings: sync synchronizes yanked/deleted files with server echo prints its arguments to the message line - redraw renew ui elements and redraw the screen cd changes working directory to its argument push simulate key pushes given in its argument diff --git a/docstring.go b/docstring.go index 27dd99e..ac2d10b 100644 --- a/docstring.go +++ b/docstring.go @@ -34,6 +34,7 @@ The following commands are provided by lf with default keybindings: delete (default 'd') put (default 'p') clear (default 'c') + redraw (default '') reload (default '') read (default ':') read-shell (default '$') @@ -48,7 +49,6 @@ The following commands are provided by lf without default keybindings: sync synchronizes yanked/deleted files with server echo prints its arguments to the message line - redraw renew ui elements and redraw the screen cd changes working directory to its argument push simulate key pushes given in its argument diff --git a/eval.go b/eval.go index 08f352f..932ffe2 100644 --- a/eval.go +++ b/eval.go @@ -332,6 +332,10 @@ func (e *callExpr) eval(app *app, args []string) { if err := sendRemote("send sync"); err != nil { app.ui.printf("clear: %s", err) } + case "redraw": + app.ui.sync() + app.ui.renew() + app.ui.loadFile(app.nav) case "reload": app.ui.sync() app.ui.renew() @@ -368,10 +372,6 @@ func (e *callExpr) eval(app *app, args []string) { } case "echo": app.ui.msg = strings.Join(e.args, " ") - case "redraw": - app.ui.sync() - app.ui.renew() - app.ui.loadFile(app.nav) case "cd": path := "~" if len(e.args) > 0 { diff --git a/opts.go b/opts.go index 70ec758..ecee2c5 100644 --- a/opts.go +++ b/opts.go @@ -70,6 +70,7 @@ func init() { gOpts.keys["d"] = &callExpr{"delete", nil} gOpts.keys["c"] = &callExpr{"clear", nil} gOpts.keys["p"] = &callExpr{"put", nil} + gOpts.keys[""] = &callExpr{"redraw", nil} gOpts.keys[""] = &callExpr{"reload", nil} gOpts.keys[":"] = &callExpr{"read", nil} gOpts.keys["$"] = &callExpr{"read-shell", nil}