Closed
Bug 951975
Opened 12 years ago
Closed 12 years ago
devtools/sourceeditor/editor should let me reconfigure CodeMirror to change line wrapping
Categories
(DevTools :: Source Editor, defect, P3)
Tracking
(Not tracked)
VERIFIED
FIXED
Firefox 29
People
(Reporter: jason.barnabe, Assigned: anton)
Details
Attachments
(1 file)
|
1.94 KB,
patch
|
msucan
:
review+
|
Details | Diff | Splinter Review |
I'm attempting to implement CodeMirror in my extension Stylish. I would like to allow users to choose whether to wrap lines and have that choice reflected immediately.
CodeMirror has a setOption method[1] that lets you change its configuration on the fly, including lineWrapping[2]. The JS implemented in devtools/sourceeditor/editor[3] hides the "cm" object from me so I can't access it to call this method. Oddly, it only lets me change the "mode" of CodeMirror[4].
I would like to have a setLineWrapping method, or more generally, a setOption method to be able to reconfigure CodeMirror on the fly.
1: http://codemirror.net/doc/manual.html#setOption
2: http://codemirror.net/doc/manual.html#option_lineWrapping
3: http://mxr.mozilla.org/mozilla-central/source/browser/devtools/sourceeditor/editor.js
4: http://mxr.mozilla.org/mozilla-central/source/browser/devtools/sourceeditor/editor.js#291
| Assignee | ||
Comment 1•12 years ago
|
||
Since we already allow people to pass CodeMirror configuration I don't mind exposing setOption method *but* it has to reflect all the custom stuff we do in the constructor. In fact, constructor should probably use setOption.
| Assignee | ||
Updated•12 years ago
|
Priority: -- → P3
| Assignee | ||
Updated•12 years ago
|
Assignee: nobody → anton
| Assignee | ||
Comment 2•12 years ago
|
||
Actually, when I started doing this I realized that we don't do anything custom to CodeMirror options so this patch came to be super simple.
Attachment #8356298 -
Flags: review?(mihai.sucan)
Comment 3•12 years ago
|
||
Comment on attachment 8356298 [details] [diff] [review]
WIP 1
Nice.
Attachment #8356298 -
Flags: review?(mihai.sucan) → review+
| Assignee | ||
Comment 4•12 years ago
|
||
Whiteboard: [fixed-in-fx-team]
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 29
| Reporter | ||
Comment 6•12 years ago
|
||
Thanks, this works. I've released Stylish 1.4.1b1 with support for this.
http://forum.userstyles.org/discussion/39738/stylish-for-firefox-1-4-1b1
https://github.com/JasonBarnabe/stylish/issues/167
Status: RESOLVED → VERIFIED
Updated•7 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•