Source Editor should automatically append closing characters

RESOLVED FIXED

Status

P4
enhancement
RESOLVED FIXED
7 years ago
6 months ago

People

(Reporter: cedricv, Unassigned)

Tracking

Trunk

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [sourceeditor][orion])

(Reporter)

Description

7 years ago
Auto-closing pairs should probably be defined by the mode (JS, CSS, ...)

For both JS and CSS though following should work :
"{" + "}"
"[" + "]"
"(" + ")"
"/*" + "*/"


There should probably be a pref to disable it.
This is *probably* going to be upstreamed to Orion.

Comment 2

7 years ago
This should definitely be handled by Orion. I'll also note that this is low priority.
(Reporter)

Comment 3

7 years ago
(In reply to Kevin Dangoor from comment #2)
> This should definitely be handled by Orion. I'll also note that this is low
> priority.

Low priority but also low hanging fruit?
This is reasonably simple to implement (at least initially on textarea implementation and/or SourceEditor level), and it really improves *a lot* Style Editor's UX (flicker becomes more an exception than a rule)
(Reporter)

Comment 4

7 years ago
I mean my rationale for opening this bug is not about the 'debatable' comfort given by the future wrt to typing (faster), but a huge change in regard to updating stylesheets real-time with much less flicker in most simple situations (before incremental parser stuff that allow the same experience in all situations AND with this feature preffed off if the user prefers so)
Whiteboard: [sourceeditor][orion]
Severity: normal → enhancement
Version: unspecified → Trunk
(Reporter)

Updated

7 years ago
Blocks: 713612
(Reporter)

Updated

7 years ago
No longer blocks: 713612
This is most-likely going to be implemented upstream in Orion. We should wait for that.
Priority: -- → P4
Moving to Source Editor component.

Filter on CHELICERAE.
Component: Developer Tools → Developer Tools: Source Editor
This is implemented now.
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
It looks like it is implemented in the style editor, but I don't see it in the scratchpad nor in the shader editor. Do we have separate bugs for these or should this be reopened?
Flags: needinfo?(anton)
There's an option for that, autoCloseBrackets. Other components can enable it the same way StyleSheetEditor.jsm did:

  let editor = new Editor({
    value: "...",
    ...
    autoCloseBrackets: "{}()[]"
  });
Flags: needinfo?(anton)
Also, there's a talk about enabling this addon by default in bug 940713.

Updated

6 months ago
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.