Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert tabs to spaces on indent #1

Open
mbarkhau opened this issue Aug 24, 2011 · 2 comments
Open

Convert tabs to spaces on indent #1

mbarkhau opened this issue Aug 24, 2011 · 2 comments

Comments

@mbarkhau
Copy link

Hi Jeff,

it seems that your mode doesn't always indent as I would expect.
Shouldn't it indent after "for", "if", etc. unless there is a "then" in the same line?

Thank you for this nice mode.
Manuel

@pickhardt
Copy link
Owner

This is a valid feature request.

To set expectations, you should know I'm not actively developing anything
for the module anymore. I'd be great if you could add it! If you look at
lines 243-249, you'll see how I indent after a function declaration arrow
(->). You'd want to do something similar.

    if ((current === '->' &&
              !state.lambda &&
              state.scopes[0].type == 'coffee' &&
              stream.peek() === '')
           || style === 'coffee-indent') {
        indent(stream, state);
    }

Also, for anyone reading this, CodeMirror itself has options to convert tabs
to spaces, called indentWithTabs (http://codemirror.net/manual.html). That
should be used with the CoffeeScript module as well.

@pickhardt
Copy link
Owner

Actually, I was wrong; indentWithTabs converts spaces to tabs. Looks like
CodeMirror converts tabs to spaces by default already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants