This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Repository navigation
Fixes #31 and #41 - #43
Merged
Merged
Conversation
added 2 commits
May 10, 2015 13:32
I know at least two corner cases which are still not 100% after adding this fix. But those corner cases require a tweak to Atom itself. This has to do with the need for an option to decrease the indent level based on the previous line, which currently is not supported in Atom. Take this use case: ``` s := fmt.Sprint(“some” + “thing”) fmt.Print(s) ``` The indentation for this is now done correctly for the first line, but the last line should have a decreased indent level. Given the current options Atom give us, it seems to me there is no way to fix this currently. Will look into Atom core to see if I can extend the possibilities so we can also fix the last corner cases. Nevertheless I would like to get this one in before that, as it fixes a few open issues and gives others the option to test and maybe extend (if they find new corner cases) the regexes.
Possibly prevents some corner cases as it are more strict matches.
After more testing this isn’t a good one to add until the Atom internals are a bit better for this type of use case.
kevinsawicki
added a commit
that referenced
this pull request
May 11, 2015
Contributor
|
Thanks for adding these |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I know at least two [1][2] corner cases which are still not 100% after adding this fix. But those corner cases require a tweak to Atom itself. This has to do with the need for an option to decrease the indent level
based on the previous line, which currently is not supported in Atom.
Take this use case:
[1] The indentation for this is now done correctly for the first line, but only if you press enter after the
+sign while the statement is already complete (so"thing")is on the same line already. But if you type this in (which is of course expected behaviour) and while typing you hit enter right after the+sign with only a)behind the cursor, it will not indent.This is correct as a single
)on a line is closing an earlier opened(and should have a decreased indent level assuming there are indented lines in between. But then as soon as you start typing"thing"it should indent, because it no longer is a single). Atom currently has no way to do this. It can do this for decreasing indents (like you can see withcasein aswitchstatement, but not for increasing indents.[2] Next to that the last line should have a decreased indent level. But again given the current options Atom give us there is no way to do this as decreasing the indent should be based on the previous line instead of the current.
Will look into Atom core to see if I can extend the possibilities so we can also fix the last corner cases.
Nevertheless I would like to get this one in before that, as it fixes a few open issues and gives others the option to test and maybe extend (if they find new corner cases) the regexes.