Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
When pasting text (as part of copy-paste or cut-and-paste) the indent of the pasted text uses smart indentation behavior even when indentation mode in preferences is not set to "smart".
Consider the following code, where the class is not indented relative to the namespace scope:
public class TestClass
public void MyMethod (int number)
if (number == 0)
In MonoDevelop 2.8, trying to copy-paste the method will paste the copied method with the same indentation as the source as expected. Similarly, trying to copy-paste the if-statement will paste it with the same indentation as the source as expected. This seems to be regardless of which indentation mode is selected. This may not be ideal behavior for Smart mode, but for Automatic mode, which is the one I care about, it's works as expected.
In MonoDevelop 3.0.x, trying to copy-paste the method will paste the copied method with one indentation level too much. Similarly, trying to copy-paste the if-statement will paste it one level indented too much. This seems to be regardless of indentation mode set. The behavior may be good for Smart indentation now, but it's completely unusable for code that doesn't have exactly one indentation level per nested scope.
Just in case the response to this is to claim that it's the user's fault for using incorrect indentation, then why have the Automatic indentation mode at all?
I consider it a bug that pasting does not respect the same logic that is used by the indentation mode used for typing.
Our codebase have lots and lots of files with classes inside namespaces where the classes are not indented. Currently using MonoDevelop 3.x for this codebase is not an option because of this pasting behavior.
You're using a specific code format - theoretically monodevelop allows this kind of formatting - the namespace indenting can be turned off in the options.
Unfortunately the indent engine is not compatible with the formatting engine - the formatting/indenting layer needs much work, but I don't know when we'll do it.
But y, when the indenting is set to none or auto the cut & paste behaviour should be different - and that's fixed. (will be in the 4.2 release I guess - I don't know if we put it into 4.0)