tamzinblake / js3-mode

A chimeric fork of js2-mode and js-mode
GNU General Public License v3.0
181 stars 13 forks source link

Introduce `js3-label-indent-offset`. #90

Closed knu closed 10 years ago

knu commented 10 years ago

This is a partial solution to #70 and #71, allowing the styles like this:

if (cond) {
    switch (state) {
      case 1:
        doA();
        break;
      case 2:
        doB();
        break;
      default:
        return;
    }
}

and this:

if (cond) {
    switch (state) {
    case 1:
        doA();
        break;
    case 2:
        doB();
        break;
    default:
        return;
    }
}

Some additional work will be needed to support the following style.

if (cond) {
    switch (state) {
        case 1:
            doA();
            break;
        case 2:
            doB();
            break;
        default:
            return;
    }
}
knu commented 10 years ago

I personally don't like the idea of extra indentation "inside" a label, so I'll leave it to others to implement it.

lleo commented 10 years ago

Knu, I cloned your js3-mode fork and it works great. Thanks.

I would like to :+1: vote for this inclusion into main-line js3-mode. I keep trying to find a better editor than emacs for node.js development, but I can't :) and js3-mode is the key.