bracket completion gone on highlight text
Categories
(DevTools :: Console, defect, P2)
Tracking
(firefox80 fixed)
Tracking | Status | |
---|---|---|
firefox80 | --- | fixed |
People
(Reporter: lolipopplus, Assigned: nchevobbe)
Details
Attachments
(1 file)
What were you doing?
- open console
- input in the following sequences:
var a = 'ssEnter
...a - use
shift+home
or mouse to highlight...a
and input a bracket[
, at this second,...a
is highlight and you have a pair of[]
- now press
enter
What happened?
Console throws error: SyntaxError: expected expression, got '...'
What should have happened?
Was was the expected result? ("Not crashing" may be a valid answer.)
Anything else we should know?
Console should writes Array [ "s", "s" ]
Assignee | ||
Comment 1•4 years ago
|
||
Hello lolipopplus!
So this is actually a feature, and seeing your description, I'd say a confusing one.
When you highlight code in the console and evaluate, only the selected part will be evaluated.
This is something we added when we introduced the editor mode, where it fits well.
But I agree that in "regular" mode, it can be confusing (+ make you lose the input you wrote, minus the text selection)
I think it would be safer to remove this feature from the regular mode (and it wouldn't be hard to do so)
Assignee | ||
Comment 2•4 years ago
|
||
This feature is great in editor mode, but can be confusing in in-line mode.
In inline mode, the input is cleared when you evaluate, so if you wrongfully
evaluated only a text selection, you may lose the whole input, and have to
type it again.
This patch disable the feature in inline mode, and modifies the existing test
so we make sure that this work as expected in both editor and inline mode.
Updated•4 years ago
|
Pushed by nchevobbe@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/0c46bbf31f57 Disable console text-selection only evaluation in in-line mode. r=Honza.
Comment 4•4 years ago
|
||
bugherder |
Description
•