generalize and move editor.js:detectIndentation

RESOLVED FIXED in Firefox 43

Status

RESOLVED FIXED
3 years ago
6 months ago

People

(Reporter: tromey, Assigned: tromey)

Tracking

unspecified
Firefox 43

Firefox Tracking Flags

(firefox43 fixed)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

3 years ago
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.
(Assignee)

Comment 1

3 years ago
Due to dependencies on other parts of the series, I'm going to have to
stick this one into bug 984880.
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 984880
(Assignee)

Comment 2

3 years ago
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 → ---
(Assignee)

Comment 3

3 years ago
Created attachment 8654218 [details] [diff] [review]
generalize detectIndentation and move to new file
(Assignee)

Updated

3 years ago
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+
(Assignee)

Comment 5

3 years ago
Created attachment 8655652 [details] [diff] [review]
generalize detectIndentation and move to new file

Updated per review comments.
(Assignee)

Updated

3 years ago
Attachment #8655652 - Flags: review+
(Assignee)

Updated

3 years ago
Attachment #8654218 - Attachment is obsolete: true
(Assignee)

Updated

3 years ago
Keywords: checkin-needed
Status: REOPENED → RESOLVED
Last Resolved: 3 years ago3 years ago
status-firefox43: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 43

Updated

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