emmetio / brackets-emmet

Emmet plugin for Brackets editor
http://emmet.io
MIT License
489 stars 188 forks source link

New line indentation off by one space or tab #59

Open timseverien opened 10 years ago

timseverien commented 10 years ago

Bug

To reproduce

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

nunoarruda commented 9 years ago

+1

equinox commented 9 years ago

Did either of you find anything to stop/fix this?

Miguel-Rodrigues commented 9 years ago

For curiosity tried to debug the problem and found it's source:

At line 49 from brackets-emmet/node_modules/emmet/lib/action/linebreaks.js file the function insertLineBreakAction() has a loop that counts the line padding for the new indented line:

for (var i = lineRange.end + 1, ch; i < len; i++) {
    ch = content.charAt(i);
    if (ch == ' ' || ch == '\t')
        nextPadding += ch;
    else
        break;
}

Adding 1 to the "i" makes it jump a character over. This makes the auto indent be missed by a space or tab.

This is bug comes from the emmet core library itself. To solve it just remove the "+ 1" from the for loop assignment.

I'm not fixing it because i'm new to github and don't know well how to use it yet... :confused:

jeffshaver commented 9 years ago

+1

lixiaoyan commented 9 years ago

+1

alancolyer commented 8 years ago

+1 I'm having this issue still. Place cursor at end of line that is an open div with a class name set. press enter, it will only indent 3 spaces. Press up, end, enter and it will indent 2. Repeat and it will indent 1. Then again and it will indent 0. Needs fixed!

nunoarruda commented 8 years ago

Still having this issue... :/

Stan-Stani commented 8 years ago

+1 Same here.

lucgauer commented 8 years ago

+1...

shamsfk commented 8 years ago

same here, still having this issue.

robertwt7 commented 7 years ago

I'm still having this issue with the newest bracket

ngustavo commented 7 years ago

Not sure if it's still a thing but I also have this issue here

ngustavo commented 7 years ago

screenshot It seems that ^1.3.0 is not enough. Maybe ^1.6.2 or latest would do?

retan commented 6 years ago

Same problem here. And it's years after the problem began. Is there any chance at all to get a fix for this?

sergeche commented 6 years ago

I’m working on new Emmet version that should fix this issue. Stay tuned!