Hitting tab more than once indents by tabsize-1 columns

NEW
Unassigned

Status

()

Firefox
Developer Tools: Source Editor
4 years ago
4 years ago

People

(Reporter: past, Unassigned)

Tracking

Trunk
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

With the default devtools.editor.tabsize setting of 4, open scratchpad and then:
1) Type: 01234567890123456789
2) Hit ENTER and then type: i
3) Move the cursor to the beginning of the second line (before "i") and hit TAB
4) Observe the cursor move from 0 to 4
5) Hit TAB again
6) Observe the cursor move from 4 to 7

If you hit TAB one more time you will see the cursor move to 0. It looks like there is an off-by-one error somewhere.
With tab size as 2, I get 2 spaces on the first tab and then single space on subsequent tab presses
I believe the cause is this line in editor.js

if (cm.getCursor().ch !== 0) num -= 1;

which reduces the indent amount by one if the cursor is not at the first column
You need to log in before you can comment on or make changes to this bug.