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

Replaces MATLAB's smart indent functionality with self written code #75. #76

Merged
merged 5 commits into from
Oct 23, 2019

Conversation

mriesch-tum
Copy link
Contributor

Please note that this is an experimental patch set with several known flaws:

  • MATLAB version >= R2016b is required (mostly for string manipulation operations)
  • It is assumed that keywords such as if, for, etc. are separated from the rest of the code with white space. For example, if (a < b) works, if(a <b) does not.

This first experimental version should serve as basis for issue #75.

@mriesch-tum
Copy link
Contributor Author

Added two fixes:

  • Comments at the end of the line were mistaken for code. Assuming that EOL comments begin with a percent sign FOLLOWED BY WHITESPACE, the indenter works correct. Without the whitespace it will still behave incorrectly.

  • Class methods were mistaken for nested function. This could be fixed.

@davidvarga davidvarga merged commit 4087074 into davidvarga:master Oct 23, 2019
@davidvarga
Copy link
Owner

Thanks for the effort!
Accepted the PR as the new experimental indenter is completely detached.
Could be integrated nicer if the Indenter would be abstracted into an interface with two implementation MatlabEditorIndenter and StandaloneIndenter, with some interface methods. Then the indenter to use could be set through the settings of MBeauty -> the new static method could be removed.

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

Successfully merging this pull request may close these issues.

2 participants