From 35930924a78c418808d872fb5e54d4b062a0552c Mon Sep 17 00:00:00 2001 From: Gokcehan Date: Sun, 10 Feb 2019 19:28:14 +0300 Subject: [PATCH] disable normal commands in cmap Related #68 --- doc.go | 8 +------- docstring.go | 8 +------- eval.go | 9 --------- lf.1 | 7 +------ 4 files changed, 3 insertions(+), 29 deletions(-) diff --git a/doc.go b/doc.go index da6b5e0..8ebbb8c 100644 --- a/doc.go +++ b/doc.go @@ -565,13 +565,7 @@ 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. For example, you can use arrow keys to finish the search with the -following mappings: - - cmap up - cmap down +'cmd-escape' to cancel the search. 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 31c3ca8..1834871 100644 --- a/docstring.go +++ b/docstring.go @@ -589,13 +589,7 @@ 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. For example, you can use arrow keys to -finish the search with the following mappings: - - cmap up - cmap down +search or use 'cmd-escape' to cancel the search. Finding mechanism is implemented with commands 'find' (default 'f'), 'find-back' (default 'F'), 'find-next' (default ';'), 'find-prev' (default diff --git a/eval.go b/eval.go index 6d3921e..34e2da5 100644 --- a/eval.go +++ b/eval.go @@ -491,15 +491,6 @@ func insert(app *app, arg string) { } func (e *callExpr) eval(app *app, args []string) { - if app.ui.cmdPrefix != "" && - app.ui.cmdPrefix != ">" && - e.name != "redraw" && - !strings.HasPrefix(e.name, "cmd-") { - app.ui.menuBuf = nil - app.ui.cmdAccLeft = nil - app.ui.cmdAccRight = nil - app.ui.cmdPrefix = "" - } switch e.name { case "up": app.nav.up(e.count) diff --git a/lf.1 b/lf.1 index f24e093..a1d06c6 100644 --- a/lf.1 +++ b/lf.1 @@ -553,12 +553,7 @@ 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. For example, you can use arrow keys to finish the search with the following mappings: -.PP -.EX - cmap up - cmap down -.EE +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. .PP Finding mechanism is implemented with commands 'find' (default 'f'), 'find-back' (default 'F'), 'find-next' (default ';'), 'find-prev' (default ','). You can disable 'anchorfind' option to match a pattern at an arbitrary position in the filename instead of the beginning. You can set the number of keys to match using 'findlen' option. If you set this value to zero, then the the keys are read until there is only a single match. Default values of these two options are set to jump to the first file with the given initial. .PP