StyleEditor should use 1-based line numbers not (0-based)

RESOLVED WORKSFORME

Status

DevTools
Style Editor
RESOLVED WORKSFORME
7 years ago
a month ago

People

(Reporter: jwalker, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Comment hidden (empty)

Comment 1

7 years ago
Not sure if I understand that correctly, but here, the first line is line "1".
The SourceEditor API is 1-indexed, hence the StyleEditor uses the same convention.
Do we want multiple conventions here or move this bug to SourceEditor?
(In reply to Cedric Vivier [:cedricv] from comment #2)
> The SourceEditor API is 1-indexed
Err, I meant 0-indexed.

Anyways I hadn't read yet the context/activity on bug 683499 - indeed it kinda makes sense for that particular API ("open stylesheet at line").
(In reply to Cedric Vivier [:cedricv] from comment #2)
> The SourceEditor API is 1-indexed, hence the StyleEditor uses the same
> convention.
> Do we want multiple conventions here or move this bug to SourceEditor?

SourceEditor please. Otherwise the debugger and scratchpad will need a similar fix as well.
(In reply to Cedric Vivier [:cedricv] from comment #3)
> (In reply to Cedric Vivier [:cedricv] from comment #2)
> > The SourceEditor API is 1-indexed
> Err, I meant 0-indexed.
> 
> Anyways I hadn't read yet the context/activity on bug 683499 - indeed it
> kinda makes sense for that particular API ("open stylesheet at line").

Indeed, I was assuming from the conversation on that bug that it was a general thing rather than just StyleEditor.openChrome(). Is there a reason why it's different there?
style editor panel API tis 1-indexed now.
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → WORKSFORME

Updated

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