Skip to content

feat: add bracketed-paste mode in the REPL #2502

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

Merged
merged 13 commits into from
Jul 5, 2024

Conversation

Snehil-Shah
Copy link
Member

Resolves #2068

Description

What is the purpose of this pull request?

This pull request:

  • adds bracketed paste mode in the REPL
  • The default is enabled in TTY environments and is disabled back upon closing the REPL.
  • Pasted content is not executed and can be edited.

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.

No.

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 3, 2024
Signed-off-by: Snehil Shah <snehilshah.989@gmail.com>
Signed-off-by: Snehil Shah <snehilshah.989@gmail.com>
Signed-off-by: Snehil Shah <snehilshah.989@gmail.com>
Signed-off-by: Snehil Shah <snehilshah.989@gmail.com>
@Snehil-Shah Snehil-Shah requested a review from kgryte July 4, 2024 19:41
Signed-off-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
@kgryte
Copy link
Member

kgryte commented Jul 5, 2024

Aside: this PR is quite nice, as it is a big win to be able to copy and paste multi-line content into the REPL. So thank you for working on this.

@Snehil-Shah
Copy link
Member Author

@kgryte I was thinking if it would make sense to disable auto close pairs during the pasting process? I noticed that pasting feels slow and it might also interfere if the user is not pasting syntactically correct code?

@kgryte
Copy link
Member

kgryte commented Jul 5, 2024

@Snehil-Shah That makes sense.

@kgryte
Copy link
Member

kgryte commented Jul 5, 2024

Whenever a user pastes content, what gets pasted should match verbatim the original content.

Signed-off-by: Snehil Shah <snehilshah.989@gmail.com>
Signed-off-by: Snehil Shah <snehilshah.989@gmail.com>
@Snehil-Shah
Copy link
Member Author

@kgryte Done. Whatever the user pastes is preserved including TAB indentations.

@Snehil-Shah Snehil-Shah requested a review from kgryte July 5, 2024 09:30
Signed-off-by: Snehil Shah <snehilshah.989@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
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. Thanks, @Snehil-Shah!

@kgryte kgryte merged commit 7ba179c into stdlib-js:develop Jul 5, 2024
7 checks passed
kgryte pushed a commit that referenced this pull request Jul 5, 2024
Addresses a test regression introduced in #2502.

PR-URL: #2516
Ref: #2502
Ref: 7ba179c
Reviewed-by: Athan Reines <kgryte@gmail.com>
Signed-off-by: Snehil Shah <snehilshah.989@gmail.com>
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 bracketed paste in the REPL
2 participants