Skip to content

Commit f370a77

Browse files
committed
Add first draft.
1 parent 5a19e18 commit f370a77

File tree

1 file changed

+103
-0
lines changed

1 file changed

+103
-0
lines changed

source/manual-prompt-buffer.org

+103
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
* Prompt buffer
2+
3+
# We must all refer to prompt buffer as is, not as prompt-buffer.
4+
5+
The prompt buffer is special buffer where Nyxt commands read arguments, such as
6+
URLs, file names or Common Lisp expressions. We call it prompt buffer because
7+
it requests textual input from the user.
8+
9+
Refer to nyxt/prompt-buffer-mode:prompt-buffer-mode for an overview.
10+
11+
# move somewhere else!
12+
13+
It provides contextual suggestions that are narrowed down to those matching what
14+
you type in the input area. At any given moment, there is a special suggestion
15+
that has the focus - the current suggestion.
16+
17+
A selection is a collection of suggestions, and these are allowed when the
18+
multi-selection-p slot is non-nil. For instance, the delete-buffer command
19+
deletes all selected buffers at once.
20+
21+
Every collection of suggestions belongs to a source. Sources define consistent
22+
umbrellas for specific collections of suggestions. For instance, the command
23+
describe-any features separate sources for variables, functions and classes.
24+
# and other things I want to omit.
25+
26+
# I just realized how hard it is to describe how users can understand which
27+
# source is the current one. Shouldn't this UI be re-thought? Thomas?
28+
29+
** Basic Usage
30+
When the prompt buffer is invoked it occupies the lower region of the screen,
31+
and the cursor is set at the top bar. It features the input area at the center,
32+
the active modes on the right and the prompter message on the left. The
33+
suggestions are listed vertically below the top bar and are immediately shown
34+
before you start typing.
35+
36+
# Can the user define its own completion algorithm? Yes, by setting
37+
# prompter:filter in each prompt buffer source
38+
39+
As you type or delete each character, the list of suggestions is updated. The
40+
commands defined by input-edit-mode apply to the input area.
41+
42+
Parallel to that, you can set the current suggestion by using these navigation
43+
commands:
44+
45+
select-previous
46+
select-next
47+
select-first
48+
select-last
49+
select-previous-page
50+
select-next-page
51+
select-previous-source
52+
select-next-source
53+
54+
Once you have set the desired current suggestion, you can run the command
55+
return-selection, bound to RET by default, to submit the argument exit the
56+
prompt buffer.
57+
58+
In some cases, the argument you will submit is a list of suggestions, which we
59+
call selection. The following command add suggestions to the selection:
60+
61+
# rename all of these commands since mark is a defunct concept.
62+
mark-all
63+
unmark-all
64+
toggle-mark
65+
toggle-mark-backwards
66+
toggle-mark-all
67+
68+
You can exit the prompt buffer at any given moment with command cancel-input.
69+
70+
** Notable sources
71+
Should we refer to some of them?
72+
73+
buffer-source
74+
new-url-or-search-source
75+
76+
hint-source
77+
file-source
78+
79+
** Attributes
80+
81+
** Actions
82+
83+
** Passwords
84+
Sometimes, you may need to enter a password or other sensitive information in
85+
Nyxt.
86+
87+
# Do we handle this??
88+
89+
** History
90+
91+
** Completion
92+
93+
** Keybindings
94+
95+
** Multi tasking
96+
# missing feature
97+
You can't focus the former buffer without exiting the prompt while it is up.
98+
However, it is still possible to scroll the other buffer with these commands.
99+
100+
scroll-other-buffer-down
101+
scroll-other-buffer-up
102+
scroll-page-down-other-buffer
103+
scroll-page-up-other-buffer

0 commit comments

Comments
 (0)