- Home /
MonoDevelop seems to randomly insert code
I recently downloaded Unity 5 after running on Unity 4 since it's release and am running into an infuriating bug/feature with MonoDevelop 4.0.1. What seems to be happening is that whenever I Alt+Tab back to MonoDevelop from Unity and do some operation, perhaps copy pasting a variable, or editing some code or double clicking something to highlight it MonoDevelop appears to copy a couple lines of code and paste them on the screen, usually just above where I'm editing. I'm unable to fully track down what is making it happen, but copy/paste has seemed to repro it somewhat reliably. I assume it's a feature of some sort that can be turned off. Maybe it's a visualization and it's not actually inserting code?
Has anyone ran into this and may know what's going on? I found a couple threads that seemed to mention it, but their solutions didn't solve it. They mentioned setting the Code Formatting option for C# to Microsoft Visual Studio, but the problem still exists.
Thanks in advance!
EDIT: I have discovered more about the code insertion. Sometimes I have noticed that when saving the code offsets itself visually onscreen by a few lines. I'm uncertain why this is happening, but it's purely a visual thing. What appears to be happening when I see this random code insertion issue is that it's also a purely visual issue. No code is actually being added, but it's only offsetting the text for a few lines (2-3) instead of the entire screen.
Still quite annoying and it makes the new MonoDevelop a pain to work with. Any insight is appreciated!
Do you use "#region"s or have you folded code sections (comment blocks, method body, class body, #region) somewhere in your code?
I also encountered some issues with $$anonymous$$onoDevelop on $$anonymous$$ac. I couldn't find the cause of it but sometime copy/paste insert random text ins$$anonymous$$d of the text copied and select-all (cmd a) stop working as well.
Well, i'm on windows (like most Unity users ^^). Recently i stopped using $$anonymous$$onoDevelop for several reasons. It's loading time is currently at it's peak. If you switch between projects it shows an error that it can't open the old solution (the error is actually displayed under the splash screen). Sometimes if you open $$anonymous$$D for the first time it doesn't open the file you double clicked. It's in general quite unstable (either it crashes completely or some modules crash silently). Code folding is quite useless since it automatically unfolds it (if you just think about the hidden code...). And many other things... For the time being i'm using Visual Studio Express. I only use $$anonymous$$D when i have to debug something (which usually isn't the case ^^).
I'm not using any regions. Co$$anonymous$$g from a C++ background I'm not overly fond of them. :P
I've considered using Visual Studio, but I'm trying to stick with $$anonymous$$D as it's necessary for debugging, and I tend to be a debug heavy developer.
I've been having this too. I have bound Ctrl C/Ctrl V to copy/paste respectively on the mac. Although I haven't figured out when this happens I too sometimes get the contents in the copy memory being randomly inserted into my c# code. It's really frustrating because on one occasion it added a very difficult to find bug. (It copied my line counter++; at the end of an if statement!) $$anonymous$$y current thinking is sometimes the displayed cursor is not where the pasting occurs, or put another way... it feels like there is an edit cursor and a paste location cursor. Usually they are the same location but sometimes it gets confused and pastes in a different location to the edit cursor. I've normally only seen this when using the mouse + scroll bars on the right or when pressing Ctrl+F to find some text to later paste after.