-
Notifications
You must be signed in to change notification settings - Fork 5
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
Automatically indent code when appropriate #43
Comments
Lately in MD 4.1 I am seeing a mix of tabs and spaces when hitting Enter which is super annoying. This needs to be addressed. |
Okay, in Preferences > Text Editor > Behavior you can change Indentation mode from "Smart" to "Automatic" which seems to be giving me better behavior. Tabs stay tabs and I don't need to backspace out any space characters and re-indent every line. I'm not sure how "Smart" is supposed to behave but it's not very nice when writing Cobra code. |
As of this commit: mono/monodevelop@cedabbb both "Smart" and "Auto" will now indent using spaces even if the rest of the file is using tabs. Dang... |
Nooooooooooooo!!! |
This is super annoying. I'm going to fix it. |
Progress towards addressing issue #43 Does not automatically indent code, but does respect tabs-to-spaces setting. Recommended setting indent mode to "Auto" or "Smart" and then not checking "Trim trailing whitespace". Not very robust but at least not annoying when trying to indent anymore :)
We want smarter indentation when hitting Enter after
def foo
,cue init
, etc.We probably want to implement a TextEditorExtension dedicated to this task. Reference material:
https://github.com/mono/monodevelop/blob/master/main/src/addins/CSharpBinding/CSharpBinding.addin.xml#L113
https://github.com/mono/monodevelop/blob/master/main/src/addins/CSharpBinding/CSharpBinding.addin.xml#L135
https://github.com/mono/monodevelop/blob/master/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpTextEditorIndentation.cs
https://github.com/mono/monodevelop/tree/master/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting
The text was updated successfully, but these errors were encountered: