From c0be74c55a6a0a4d7161e1a82ff804ccdf4443d2 Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Sun, 27 Feb 2022 12:09:27 -0800 Subject: [PATCH] Better documentation of forward-char and friends This makes it match the code in reader.cpp, and explains why the default binding of `right` accepts the complete line. Closes #8748 --- doc_src/cmds/bind.rst | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/doc_src/cmds/bind.rst b/doc_src/cmds/bind.rst index 9de9ed5ca..c20fe30af 100644 --- a/doc_src/cmds/bind.rst +++ b/doc_src/cmds/bind.rst @@ -89,10 +89,11 @@ The following special input functions are available: only execute the next function if the previous succeeded (note: only some functions report success) ``accept-autosuggestion`` - accept the current autosuggestion completely + accept the current autosuggestion ``backward-char`` - moves one character to the left + move one character to the left. + If the completion pager is active, select the previous completion instead. ``backward-bigword`` move one whitespace-delimited word to the left @@ -179,13 +180,15 @@ The following special input functions are available: move one whitespace-delimited word to the right ``forward-char`` - move one character to the right + move one character to the right; or if at the end of the commandline, accept the current autosuggestion. + If the completion pager is active, select the next completion instead. ``forward-single-char`` - move one character to the right; if an autosuggestion is available, only take a single char from it + move one character to the right; or if at the end of the commandline, accept a single char from the current autosuggestion. ``forward-word`` - move one word to the right + move one word to the right; or if at the end of the commandline, accept one word + from the current autosuggestion. ``history-search-backward`` search the history for the previous match @@ -230,7 +233,8 @@ The following special input functions are available: move the next word to the killring ``nextd-or-forward-word`` - if the commandline is empty, then move forward in the directory history, otherwise move one word to the right + if the commandline is empty, then move forward in the directory history, otherwise move one word to the right; + or if at the end of the commandline, accept one word from the current autosuggestion. ``or`` only execute the next function if the previous succeeded (note: only some functions report success)