-
Notifications
You must be signed in to change notification settings - Fork 67
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
notepad.prompt() window and multiline input #261
Comments
Something like a 4th parameter unselect, set to false by default, would be helpful. |
Yes, I've often thought this. Another use case is a poor-man's UI made out of the
Here, if the text is selected when the box appears, it is easy for the user to hit an unintended key -- maybe arrowing was intended to move to where a "checkbox" could be ticked, but... If that happens the "UI" is destroyed :-( |
The relevant code for the text selection is at
Removing that line will leave the caret at the beginning of the unselected text.
@alankilborn @Ekopalypse Do you see any advantage to keep the current behaviour with the selection of the text? |
If it could be made an optional behavior, that would be nice. |
- avoid that input text in prompt edit control is automatically selected
The only advantage I see right now is if someone uses it with a default value that needs to be overwritten from time to time. |
Workaround:
Produces: |
I noticed that when I put some text in a notepad.prompt() window, e.g.:
notepad.prompt('', '', 'this is the default first line')
it correctly shows:
But then if I want to accept the first line and move input to a second line, using Ctrl+Enter, it erases my first line:
I have to remember to FIRST clear the selection (perhaps by pressing the End key) to obtain:
and then my Ctrl+Enter movement to the second line goes well:
But I always forget to do this unselect manually, so I was wondering if the plugin could handle this for me?
Or maybe this is just how Windows' multiline edit boxes work, and the plugin can't handle it.
In that case, I'd ask for an option to not show the text in the box as selected when the prompt window first appears.
Using PS 2.0.
The text was updated successfully, but these errors were encountered: