Closed Bug 1196431 Opened 10 years ago Closed 10 years ago

generalize and move editor.js:detectIndentation

Categories

(DevTools :: Inspector, defect)

defect
Not set
normal

Tracking

(firefox43 fixed)

RESOLVED FIXED
Firefox 43
Tracking Status
firefox43 --- fixed

People

(Reporter: tromey, Assigned: tromey)

References

Details

Attachments

(1 file, 1 obsolete file)

For as-authored I'd like to be able to invoke detectIndentation on a string, without requiring a full editor. So, split this function out and generalize so it can be used this way as well. This will be useful to callers of the code added in bug 1195356, though not needed directly by that patch.
Due to dependencies on other parts of the series, I'm going to have to stick this one into bug 984880.
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → DUPLICATE
I was confused yesterday, the move bits can go in before the changes to stylesheets; and this will make the series a bit less confusing overall.
Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---
Attachment #8654218 - Flags: review?(pbrosset)
Comment on attachment 8654218 [details] [diff] [review] generalize detectIndentation and move to new file Review of attachment 8654218 [details] [diff] [review]: ----------------------------------------------------------------- ::: toolkit/devtools/shared/indentation.js @@ +42,5 @@ > + * use. This consults various prefs to arrive at a decision. > + * > + * @param {Function} iterFunc A function of three arguments: > + * (start, end, callback); where |start| and |end| describe > + * which lines of text to examine, and |callback| is a function s/which lines of text to examine/the range of text lines to examine ::: toolkit/devtools/shared/tests/unit/test_indentation.js @@ +105,5 @@ > + > +function test_indent_detection() { > + Services.prefs.setIntPref(TAB_SIZE, 2); > + Services.prefs.setBoolPref(EXPAND_TAB, true); > + Services.prefs.setBoolPref(DETECT_INDENT, true); You should clear these user prefs when the test ends.
Attachment #8654218 - Flags: review?(pbrosset) → review+
Updated per review comments.
Attachment #8655652 - Flags: review+
Attachment #8654218 - Attachment is obsolete: true
Keywords: checkin-needed
Status: REOPENED → RESOLVED
Closed: 10 years ago10 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 43
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: