diff --git a/doc.go b/doc.go index 126266f..9f64999 100644 --- a/doc.go +++ b/doc.go @@ -1075,12 +1075,12 @@ Globbing supports '*' to match any sequence, '?' to match any character, and '[. You can enable 'incsearch' option to jump to the current match at each keystroke while typing. In this mode, you can either use 'cmd-enter' to accept the search or use 'cmd-escape' to cancel the search. Alternatively, you can also map some other commands with 'cmap' to accept the search and execute the command immediately afterwards. -Possible candidates are 'up', 'down' and their variants, 'updir', and 'open' commands. +Possible candidates are 'up', 'down' and their variants, 'top', 'bottom', 'updir', and 'open' commands. For example, you can use arrow keys to finish the search with the following mappings: - cmap up - cmap down - cmap updir + cmap up + cmap down + cmap updir cmap open Finding mechanism is implemented with commands 'find' (default 'f'), 'find-back' (default 'F'), 'find-next' (default ';'), 'find-prev' (default ','). diff --git a/docstring.go b/docstring.go index 54f5c5e..66aee68 100644 --- a/docstring.go +++ b/docstring.go @@ -1194,12 +1194,12 @@ while typing. In this mode, you can either use 'cmd-enter' to accept the search or use 'cmd-escape' to cancel the search. Alternatively, you can also map some other commands with 'cmap' to accept the search and execute the command immediately afterwards. Possible candidates are 'up', 'down' and -their variants, 'updir', and 'open' commands. For example, you can use arrow -keys to finish the search with the following mappings: +their variants, 'top', 'bottom', 'updir', and 'open' commands. For example, +you can use arrow keys to finish the search with the following mappings: - cmap up - cmap down - cmap updir + cmap up + cmap down + cmap updir cmap open Finding mechanism is implemented with commands 'find' (default 'f'), diff --git a/eval.go b/eval.go index 1408e10..020be46 100644 --- a/eval.go +++ b/eval.go @@ -716,10 +716,16 @@ func (e *callExpr) eval(app *app, args []string) { case "quit": app.quitChan <- struct{}{} case "top": + if app.ui.cmdPrefix != "" && app.ui.cmdPrefix != ">" { + normal(app) + } app.nav.top() app.ui.loadFile(app.nav, true) app.ui.loadFileInfo(app.nav) case "bottom": + if app.ui.cmdPrefix != "" && app.ui.cmdPrefix != ">" { + normal(app) + } app.nav.bottom() app.ui.loadFile(app.nav, true) app.ui.loadFileInfo(app.nav) diff --git a/lf.1 b/lf.1 index effa776..8503e09 100644 --- a/lf.1 +++ b/lf.1 @@ -1210,12 +1210,12 @@ By default, lf does not assign 'delete' command to a key to protect new users. Y .SH SEARCHING FILES There are two mechanisms implemented in lf to search a file in the current directory. Searching is the traditional method to move the selection to a file matching a given pattern. Finding is an alternative way to search for a pattern possibly using fewer keystrokes. .PP -Searching mechanism is implemented with commands 'search' (default '/'), 'search-back' (default '?'), 'search-next' (default 'n'), and 'search-prev' (default 'N'). You can enable 'globsearch' option to match with a glob pattern. Globbing supports '*' to match any sequence, '?' to match any character, and '[...]' or '[^...] to match character sets or ranges. You can enable 'incsearch' option to jump to the current match at each keystroke while typing. In this mode, you can either use 'cmd-enter' to accept the search or use 'cmd-escape' to cancel the search. Alternatively, you can also map some other commands with 'cmap' to accept the search and execute the command immediately afterwards. Possible candidates are 'up', 'down' and their variants, 'updir', and 'open' commands. For example, you can use arrow keys to finish the search with the following mappings: +Searching mechanism is implemented with commands 'search' (default '/'), 'search-back' (default '?'), 'search-next' (default 'n'), and 'search-prev' (default 'N'). You can enable 'globsearch' option to match with a glob pattern. Globbing supports '*' to match any sequence, '?' to match any character, and '[...]' or '[^...] to match character sets or ranges. You can enable 'incsearch' option to jump to the current match at each keystroke while typing. In this mode, you can either use 'cmd-enter' to accept the search or use 'cmd-escape' to cancel the search. Alternatively, you can also map some other commands with 'cmap' to accept the search and execute the command immediately afterwards. Possible candidates are 'up', 'down' and their variants, 'top', 'bottom', 'updir', and 'open' commands. For example, you can use arrow keys to finish the search with the following mappings: .PP .EX - cmap up - cmap down - cmap updir + cmap up + cmap down + cmap updir cmap open .EE .PP