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

repl: preserve preview on ESCAPE key press #46878

Merged
merged 3 commits into from Mar 16, 2023

Conversation

meixg
Copy link
Member

@meixg meixg commented Feb 28, 2023

Fixes: #46876

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. repl Issues and PRs related to the REPL subsystem. labels Feb 28, 2023
@meixg meixg added the request-ci Add this label to start a Jenkins CI on a PR. label Feb 28, 2023
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Feb 28, 2023
@nodejs-github-bot
Copy link
Collaborator

Copy link
Member

@BridgeAR BridgeAR left a comment

Choose a reason for hiding this comment

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

This seems like a nice improvement!
I would just not negate the argument and use an if statement.

lib/internal/repl/utils.js Outdated Show resolved Hide resolved
lib/internal/repl/utils.js Outdated Show resolved Hide resolved
lib/repl.js Outdated Show resolved Hide resolved
lib/internal/repl/utils.js Outdated Show resolved Hide resolved
@BridgeAR BridgeAR added the request-ci Add this label to start a Jenkins CI on a PR. label Feb 28, 2023
Copy link
Member

@BridgeAR BridgeAR left a comment

Choose a reason for hiding this comment

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

I just noticed that this might require a bit more work: in case the line completion and the preview is active, it should remove both.

@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Feb 28, 2023
@nodejs-github-bot
Copy link
Collaborator

@meixg
Copy link
Member Author

meixg commented Feb 28, 2023

I just noticed that this might require a bit more work: in case the line completion and the preview is active, it should remove both.

Do you mean:

> let someStr = '123'
undefined
> '0' + someStr // <- '0' + som
'0123'

then press escape ? I tried and it will remove both.

> let someStr = '123'
undefined
> '0' + som

@BridgeAR
Copy link
Member

@meixg yes, that's what I meant. I just saw that it will work as expected due to resetting the preview suffix to null and therefore not having a match anymore. Good work!

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

meixg and others added 2 commits March 3, 2023 11:25
Co-authored-by: Ruben Bridgewater <ruben@bridgewater.de>
@meixg meixg added the request-ci Add this label to start a Jenkins CI on a PR. label Mar 3, 2023
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Mar 3, 2023
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@meixg meixg added the request-ci Add this label to start a Jenkins CI on a PR. label Mar 10, 2023
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Mar 10, 2023
@meixg meixg added the request-ci Add this label to start a Jenkins CI on a PR. label Mar 11, 2023
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Mar 11, 2023
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

Copy link
Member

@BridgeAR BridgeAR left a comment

Choose a reason for hiding this comment

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

Still LGTM

@meixg meixg added commit-queue Add this label to land a pull request using GitHub Actions. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. labels Mar 16, 2023
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Mar 16, 2023
@nodejs-github-bot nodejs-github-bot merged commit 2566400 into nodejs:main Mar 16, 2023
29 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in 2566400

targos pushed a commit that referenced this pull request Mar 18, 2023
Fix: #46876
PR-URL: #46878
Fixes: #46876
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
danielleadams pushed a commit that referenced this pull request Jul 6, 2023
Fix: #46876
PR-URL: #46878
Fixes: #46876
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. needs-ci PRs that need a full CI run. repl Issues and PRs related to the REPL subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

repl: preview removed when press ESC key
3 participants