multiline indentation for javascript. #1397

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants
@pydichandra
Contributor

pydichandra commented Mar 26, 2013

No description provided.

@marijnh

This comment has been minimized.

Show comment Hide comment
@marijnh

marijnh Mar 27, 2013

Member

What does this accomplish?

Member

marijnh commented Mar 27, 2013

What does this accomplish?

@pydichandra

This comment has been minimized.

Show comment Hide comment
@pydichandra

pydichandra Mar 27, 2013

Contributor

multi line statements will be indented by statementIndentUnit.

eg.
product.ui.ContentPane.prototype.enterDocument =
function() { // 4-spaces == statementIndentUnit
var i = 0; // 2-spaces indentation
...
}

On Wed, Mar 27, 2013 at 2:13 AM, Marijn Haverbeke
notifications@github.comwrote:

What does this accomplish?


Reply to this email directly or view it on GitHubhttps://github.com/marijnh/CodeMirror/pull/1397#issuecomment-15511980
.

Contributor

pydichandra commented Mar 27, 2013

multi line statements will be indented by statementIndentUnit.

eg.
product.ui.ContentPane.prototype.enterDocument =
function() { // 4-spaces == statementIndentUnit
var i = 0; // 2-spaces indentation
...
}

On Wed, Mar 27, 2013 at 2:13 AM, Marijn Haverbeke
notifications@github.comwrote:

What does this accomplish?


Reply to this email directly or view it on GitHubhttps://github.com/marijnh/CodeMirror/pull/1397#issuecomment-15511980
.

@marijnh

This comment has been minimized.

Show comment Hide comment
@marijnh

marijnh Mar 28, 2013

Member

Your patch has several problems

  • It looks for the option in the config rather than parserConfig object. That will only hold editor-wide options, whereas this is clearly a mode-specific one.
  • It completely breaks the mode when the option is not specified.
  • It removes support for the current model, which I personally find a lot saner.
Member

marijnh commented Mar 28, 2013

Your patch has several problems

  • It looks for the option in the config rather than parserConfig object. That will only hold editor-wide options, whereas this is clearly a mode-specific one.
  • It completely breaks the mode when the option is not specified.
  • It removes support for the current model, which I personally find a lot saner.
@pydichandra

This comment has been minimized.

Show comment Hide comment
@pydichandra

pydichandra Mar 28, 2013

Contributor

pydichandra/CodeMirror@02f5cfb
was
the change in my local repository;
that uses statementIndentUnit from parserConfig. If that is not defined
then indentUnit is used for statementIndent.

On Thu, Mar 28, 2013 at 5:50 AM, Marijn Haverbeke
notifications@github.comwrote:

Your patch has several problems

  • It looks for the option in the config rather than parserConfigobject. That will only hold editor-wide options, whereas this is clearly a
    mode-specific one.
  • It completely breaks the mode when the option is not specified.
  • It removes support for the current model, which I personally find a
    lot saner.


Reply to this email directly or view it on GitHubhttps://github.com/marijnh/CodeMirror/pull/1397#issuecomment-15586646
.

Contributor

pydichandra commented Mar 28, 2013

pydichandra/CodeMirror@02f5cfb
was
the change in my local repository;
that uses statementIndentUnit from parserConfig. If that is not defined
then indentUnit is used for statementIndent.

On Thu, Mar 28, 2013 at 5:50 AM, Marijn Haverbeke
notifications@github.comwrote:

Your patch has several problems

  • It looks for the option in the config rather than parserConfigobject. That will only hold editor-wide options, whereas this is clearly a
    mode-specific one.
  • It completely breaks the mode when the option is not specified.
  • It removes support for the current model, which I personally find a
    lot saner.


Reply to this email directly or view it on GitHubhttps://github.com/marijnh/CodeMirror/pull/1397#issuecomment-15586646
.

@marijnh marijnh closed this Apr 2, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment