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

Auto-indent does not indent a line followed by a comment #67

Open
neelabhg opened this issue Dec 19, 2014 · 3 comments
Open

Auto-indent does not indent a line followed by a comment #67

neelabhg opened this issue Dec 19, 2014 · 3 comments
Assignees

Comments

@neelabhg
Copy link
Member

Reported by @angrave:

if(0) { /* next line should be indented */
char* m= "this line is not indented"; // due to dumb indent parsing
}

My guess is that { and } are ignored if a comment token /* is in the
line somewhere.

@siddharth-seth
Copy link
Member

I was going through this issue for some time and figured that auto-indent does not indent a line if there is any snippet of code following the opening brace of a code block. It is not just true for a comment but anything that follows an opening brace.

@wchill
Copy link
Contributor

wchill commented Mar 6, 2015

Confirmed.

What might be going on (haven't thoroughly checked) is that the autoindent code looks for a { at the end of the line - by putting something after it on the same line it breaks the parsing.

@siddharth-seth
Copy link
Member

@neelabhg I might have a solution. Can you assign me to this issue?

siddharth-seth added a commit to siddharth-seth/sysbuild that referenced this issue Mar 28, 2015
Changes:

* Created a new mode that inherits from ace's c_cpp mode.
* Fixed a regular expression inside the getNextLineIdent to account for strings after an opening bracket.

TODO:

* Figure out how to configure the editor to use a custom mode.

Closes cs-education#67
siddharth-seth added a commit to siddharth-seth/sysbuild that referenced this issue Mar 28, 2015
Changes:

* Fixed code styling issues.

Closes cs-education#67
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants