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

Worng indentation with formatFileNoEditor #121

Open
Wave89 opened this issue May 7, 2023 · 2 comments
Open

Worng indentation with formatFileNoEditor #121

Wave89 opened this issue May 7, 2023 · 2 comments

Comments

@Wave89
Copy link

Wave89 commented May 7, 2023

if there keywords like "if", "while", "for", "function" in comments (e.g. "% this should be done while ...") , strings (e.g. variable1 ="while the sun is shining") or commands (e.g. "dbstop if error") the function formatFileNoEditor is not working properly with indentation.

@RodneyRichardson
Copy link

Similarly, it doesn't get the end correct (indents it too far).

WORKAROUND: Use the formatFile function instead,

@ehennestad
Copy link

Need to exclude words here that are part of a string:

words = regexp(lines{linect}, pattern, 'split');

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

3 participants