Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow cycling through multiline commands using up/down in the REPL #2531

Merged
merged 3 commits into from
Jul 16, 2024

Conversation

Snehil-Shah
Copy link
Member

@Snehil-Shah Snehil-Shah commented Jul 7, 2024

Resolves #2070

Description

What is the purpose of this pull request?

This pull request:

  • adds support for cycling through whole commands using up/down arrow keys

Behaviors:

  • Line before the cursor is used as prefix to filter out the history.
  • Once a traversal has started, the user is cycling for that particular prefix (that started the traversal) as long as only up and down arrows are used.
  • If any other key is used in the middle of a traversal, the traversal is reset as the user might be trying to change the prefix used or just wants to start traversing from zero again.

Related Issues

Does this pull request have any related issues?

This pull request:

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

cycle.mp4

Checklist

Please ensure the following tasks are completed before submitting this pull request.


@stdlib-js/reviewers

Signed-off-by: Snehil Shah <snehilshah.989@gmail.com>
@Snehil-Shah Snehil-Shah added Enhancement Issue or pull request for enhancing existing functionality. REPL Issue or pull request specific to the project REPL. labels Jul 7, 2024
Signed-off-by: Snehil Shah <snehilshah.989@gmail.com>
@Snehil-Shah Snehil-Shah requested a review from kgryte July 7, 2024 18:42
@Planeshifter Planeshifter self-requested a review July 9, 2024 12:20
Signed-off-by: Athan <kgryte@gmail.com>
Copy link
Member

@kgryte kgryte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

I'll leave it to @Planeshifter to perform a final review and verification of intended behavior.

Copy link
Member

@Planeshifter Planeshifter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine to me, too; let's land this PR!

@Planeshifter Planeshifter merged commit 07e6c5a into stdlib-js:develop Jul 16, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Issue or pull request for enhancing existing functionality. REPL Issue or pull request specific to the project REPL.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[RFC]: add support for whole command insertion when pressing up/down in the REPL
3 participants