Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Live-narrowing, fuzzy-matching, extensible prompt framework.

License

NotificationsYou must be signed in to change notification settings

atlas-engineer/prompter

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.

Class overview

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 singlesuggestion, if any.
  • source
    marks
    A list ofsuggestions, whenenable-marks-p is non-nil.
    actions
    A list of functions that run onsuggestions.
    actions-on-return
    Meant to be called overmarks (orcurrent-suggestion, whenenable-marks-p is nil) when successfully returningprompt. By default, it’s theidentity function.
    actions-on-marks
    Onmarks change (event-driven).
    actions-on-current-suggestion
    Oncurrent-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.

example.png

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.

Features

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.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp