aBothe / Mono-D

D Add-In for MonoDevelop
http://wiki.dlang.org/Mono-D
Other
113 stars 26 forks source link

Option for dumb auto-indentation #637

Open epi opened 8 years ago

epi commented 8 years ago

MonoDevelop offers three options for indentation: None, Automatic and Smart. Their behavior without D add-in is that, AFAICS, None after Enter is pressed always puts the caret at the physical beginning of the next line, while Automatic and Smart copy the initial whitespaces from the previous line to the next line and place the caret right after them. With D add-in, None behaves the same as without it, while both Automatic and Smart try to be smart by indenting the next line according to what seems to be the number of opened braces/parentheses. What becomes annoying is that even when the indentation is adjusted manually, the line is reindented again when the final semicolon is typed.

Is there any difference between Automatic and Smart when D add-in is enabled? Is it possible to make the Automatic mode a bit dumber, i.e. just make it copy the indentation from the previous line?

Rationale: While the enforced indentation style is consistent and may be the preferred style for many projects, there are often existing projects in which the indentation style is different, or the user may just have a different preference. Editing such projects is frustrating, as the IDE forces different indentation for edited lines. An option to follow the least astonishment rule would be of great value.