- Notifications
You must be signed in to change notification settings - Fork1
Live-narrowing, fuzzy-matching, extensible prompt framework.
License
atlas-engineer/prompter
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This library is heavily inspired by Emacs’ minibuffer andHelm. It only deals with the backend side of things, it does not handle any display.
The key objects areprompters
,sources
andsuggestions
.
Aprompt
is an interface for user interactions that holds one or moresources
, and each of those are populated bysuggestions
.
Other central concepts include:
prompt
current-suggestion
- A single
suggestion
, if any.
source
marks
- A list of
suggestions
, whenenable-marks-p
is non-nil. actions
- A list of functions that run on
suggestions
.actions-on-return
- Meant to be called over
marks
(orcurrent-suggestion
, whenenable-marks-p
is nil) when successfully returningprompt
. By default, it’s theidentity
function. actions-on-marks
- On
marks
change (event-driven). actions-on-current-suggestion
- On
current-suggestion
change (event-driven).
Example: Find below a graphical visualization of a single prompt with sources 1 and 2, and suggestions A, B, C and D.Marks
is the list composed by Suggestions A and C. Thecurrent-suggestion
is Suggestion B.
Remarks:
Whenprompt
has multiplesources
, whilecurrent-suggestion
is always defined forprompt
, it is empty for all but one of itssources
.
Marks
is a concept related tosource
notprompt
, unlike that ofcurrent-suggestion
. Thus, from the point of view of aprompt
’s object, themarks
are the union of themarks
of each of theprompt
’s =source=s.
Non-exhaustive list of features:
- Asynchronous suggestion computation.
- Multiple sources.
- Multiple return actions.
- Customizable matching and sorting.
- Multiple attributes per suggestion.
- Customizable initialization and cleanup functions.
- Notifications sent when suggestion list is updated.
- Per-source history.
- Resumable prompters.
- Marks actions (event-driven on marks change).
- Current suggestion actions (event-driven on current suggestion change).
- Automatically return the prompt when narrowed down to a single suggestion.
About
Live-narrowing, fuzzy-matching, extensible prompt framework.