From cae576bb1d6396c2c8a6c6419f14099da2fc5d62 Mon Sep 17 00:00:00 2001 From: David Pedersen Date: Sat, 25 Feb 2023 18:41:32 +0100 Subject: [PATCH] Navigate cmd history with up/down (#1112) --- doc.go | 8 ++++---- docstring.go | 8 ++++---- lf.1 | 8 ++++---- opts.go | 2 ++ 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/doc.go b/doc.go index 0d33f261..164bcf48 100644 --- a/doc.go +++ b/doc.go @@ -88,8 +88,8 @@ The following command line commands are provided by lf: cmd-menu-accept cmd-enter (default '' and '') cmd-interrupt (default '') - cmd-history-next (default '') - cmd-history-prev (default '') + cmd-history-next (default '' and '') + cmd-history-prev (default '' and '') cmd-left (default '' and '') cmd-right (default '' and '') cmd-home (default '' and '') @@ -531,8 +531,8 @@ Execute the current line. Interrupt the current shell-pipe command and return to the normal mode. - cmd-history-next (default '') - cmd-history-prev (default '') + cmd-history-next (default '' and '') + cmd-history-prev (default '' and '') Go to next/previous item in the history. diff --git a/docstring.go b/docstring.go index 1db9371a..31d419a0 100644 --- a/docstring.go +++ b/docstring.go @@ -91,8 +91,8 @@ The following command line commands are provided by lf: cmd-menu-accept cmd-enter (default '' and '') cmd-interrupt (default '') - cmd-history-next (default '') - cmd-history-prev (default '') + cmd-history-next (default '' and '') + cmd-history-prev (default '' and '') cmd-left (default '' and '') cmd-right (default '' and '') cmd-home (default '' and '') @@ -555,8 +555,8 @@ Execute the current line. Interrupt the current shell-pipe command and return to the normal mode. - cmd-history-next (default '') - cmd-history-prev (default '') + cmd-history-next (default '' and '') + cmd-history-prev (default '' and '') Go to next/previous item in the history. diff --git a/lf.1 b/lf.1 index 23f5f88f..da529e95 100644 --- a/lf.1 +++ b/lf.1 @@ -105,8 +105,8 @@ The following command line commands are provided by lf: cmd-menu-accept cmd-enter (default '' and '') cmd-interrupt (default '') - cmd-history-next (default '') - cmd-history-prev (default '') + cmd-history-next (default '' and '') + cmd-history-prev (default '' and '') cmd-left (default '' and '') cmd-right (default '' and '') cmd-home (default '' and '') @@ -651,8 +651,8 @@ Execute the current line. Interrupt the current shell-pipe command and return to the normal mode. .PP .EX - cmd-history-next (default '') - cmd-history-prev (default '') + cmd-history-next (default '' and '') + cmd-history-prev (default '' and '') .EE .PP Go to next/previous item in the history. diff --git a/opts.go b/opts.go index e56d4dfe..f8f3b940 100644 --- a/opts.go +++ b/opts.go @@ -219,7 +219,9 @@ func init() { gOpts.cmdkeys[""] = &callExpr{"cmd-complete", nil, 1} gOpts.cmdkeys[""] = &callExpr{"cmd-enter", nil, 1} gOpts.cmdkeys[""] = &callExpr{"cmd-enter", nil, 1} + gOpts.cmdkeys[""] = &callExpr{"cmd-history-next", nil, 1} gOpts.cmdkeys[""] = &callExpr{"cmd-history-next", nil, 1} + gOpts.cmdkeys[""] = &callExpr{"cmd-history-prev", nil, 1} gOpts.cmdkeys[""] = &callExpr{"cmd-history-prev", nil, 1} gOpts.cmdkeys[""] = &callExpr{"cmd-delete", nil, 1} gOpts.cmdkeys[""] = &callExpr{"cmd-delete", nil, 1}