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

Optimized Auto Indentation #5285

Open
hTp34r opened this issue Aug 25, 2024 · 2 comments
Open

Optimized Auto Indentation #5285

hTp34r opened this issue Aug 25, 2024 · 2 comments

Comments

@hTp34r
Copy link

hTp34r commented Aug 25, 2024

Will it possible for us to automatically indent when we manually input "]", "}", or ")" in an independent row? It would be more convenient for typing codes. For example, when we type:
long long step(int n) {
if (n <= 0) {
return 1;
} else {
return n * step(n-1);
}
}
we expect that one tab will be automatically indented when we type to the first "}" at the third row, and so on.

@RaiKoHoff
Copy link
Collaborator

So you expect, on typing a closing bracket on an empty/blank line, this bracket should be placed on the same indentation level as corresponding opening bracket line - that sounds okay.
Should a line-break after typing an opening bracket automatically indent one level ?
What should happen to all lines in between these brackets, when closing a bracket?. Leave them untouched?

@hTp34r
Copy link
Author

hTp34r commented Aug 29, 2024

So you expect, on typing a closing bracket on an empty/blank line, this bracket should be placed on the same indentation level as corresponding opening bracket line - that sounds okay. Should a line-break after typing an opening bracket automatically indent one level ? What should happen to all lines in between these brackets, when closing a bracket?. Leave them untouched?

1.Yes, I would like this to come true.
2.Yes. When we type "long long step(int n) {" then press "ENTER", we are expected to type the following part of code with one level indented.
3. Just leaving parts of code between the opening bracket and the closing bracket untouched is OK.
also an extension:
4. when editing a Python code, automatically replace the "tab" with "4 spaces", while editing others not.

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

No branches or pull requests

2 participants