rizonesoft / Notepad3

Notepad like text editor based on the Scintilla source code. Notepad3 based on code from Notepad2 and MiniPath on code from metapath. Download Notepad3:
https://www.rizonesoft.com/downloads/notepad3/
Other
5.15k stars 336 forks source link

Optimized Auto Indentation #5285

Open hTp34r opened 3 months ago

hTp34r commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

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.

  1. Just leaving parts of code between the opening bracket and the closing bracket untouched is OK. also an extension:
  2. when editing a Python code, automatically replace the "tab" with "4 spaces", while editing others not.