Why can't I copy/paste code snippets into MonoDevelop?
This is really frustrating. I can copy and paste code from one file to another (both JS and C#) but when I select and copy code from a Unity Answers or Unity Forum page I cannot paste it into MonoDevelop, whether using Control+V or the right click menu or the Edit menu! When I try pasting into a simple text editor it works, but in MonoDevelop it simply does not let me. Is there some particular setting that I need to change or what's the cause of this? I've recently updated Unity to 4.3.3 from 4.3.0 and it seems to be happening since then. I've tried changing around the key bindings for the shortcuts but that hasn't worked either.
Answer by Hamesh81 · Jan 27, 2014 at 12:26 PM
Alright, so here's a really weird solution to this really weird problem. I was playing around with the Syntax Highlighting (Tools>Options>Syntax Highlighting) in MonoDevelop and eventually ended up creating my own custom color scheme. Now for some reason I can copy and paste everything fine. Weird! I'm not sure if this is what actually solved this problem, but since I changed those options it's been back to normal. Maybe this might work for someone else as well. I swear I've solved/answered more of my own questions than anyone elses! Hope this helps.
Still an issue, still works. You actually don't need to change the Color Scheme - once changed and reverted works too.
Answer by LockMan5 · Sep 25, 2015 at 08:03 AM
I closed MonoDevelop and re-opened it and copy/paste works again.
That was my Plan B and it worked. :D
But before doing that, I was curious to see if the issue was perhaps related to the recent Unity update.
Answer by oatsbarley · Jan 25, 2014 at 09:49 AM
Try this out:
I did some digging if you have ever used Xamarin monodevelop it installs GTKSharp and doesn't clean up after itself when uninstalled. Unity's version was incorrectly using the Program Files(x86)\GTKSharp libraries instead of the local ones in Unity\Monodevelop\lib\gtksharp-2.0 . After removing the other copy in program files I can now paste.
Yes I saw both of those, but I don't actually have Xamarin monodevelop or GT$$anonymous$$Sharp installed. Unless they get installed automatically with some version of Unity, I've never installed them myself.
They're definitely not installed? It might be worth just checking there's nothing in Program Files/GT$$anonymous$$Sharp or Program Files(x86)/GT$$anonymous$$Sharp.
Yep just checked both of those directories and there isn't a GT$$anonymous$$Sharp folder in either. It's not in the control panel programs and features either. Really not sure what could be causing this.
Same prob, on Unity 4.3 built-in $$anonymous$$onoDevelop 4.0.1
Cut/Paste from SO$$anonymous$$E sources to $$anonymous$$onoDevelop works, e.g. pasted from notepad or jEdit to $$anonymous$$onoDevelop, and right now cut/pasting from this rich text html field to $$anonymous$$ono is working. but often pasting from Firefox/html source will not work, even though other targets will accept that paste just fine.
I also do not have a GT$$anonymous$$Sharp folder in \Program Files or \Program Files(x86). Strangely, I have tried cut n paste from $$anonymous$$onoDevelop to a Wordpress rich text input field and it appears as a mix of $$anonymous$$anji and UTF8 bytecodes?! However when I cut from $$anonymous$$onoDevelop and paste to something like jEdit or Notepad, it displays fine, then cut and paste again from there and WordPress accepts that happily. So.... Is $$anonymous$$onoDevelop clipboard trying to translate chars in a non-compatible unicode format?
e.g. Cut this from $$anonymous$$onoDevelop:
$$anonymous$$eyCode key;
Paste to WordPress directly:
ℼ佄呃偙⁅呈䱍倠䉕䥌⁃ⴢ⼯㍗⽃䐯䑔䠠䵔⁌⸴‰牔湡楳楴湯污⼯久㸢䠼䵔㹌䈼䑏㹙䘼乏⁔慦散㴠✠界楣慤䌠湯潳敬㸧匼䅐⁎瑳汹‽挧汯牯⌺㕦㉦㝥✻㸠渦獢㭰渦獢㭰渦獢㭰渦獢㭰⼼偓乁㰾偓乁猠祴敬㴠✠潦瑮眭楥桧㩴潢摬挻汯牯⌺晦晦㙢✻㸠敋䍹摯㱥匯䅐㹎匼䅐⁎瑳汹‽挧汯牯⌺㕦㉦㝥✻㸠渦獢㭰⼼偓乁㰾偓乁猠祴敬㴠✠潣潬㩲昣昵攲㬷‧款祥⼼偓乁㰾偓乁猠祴敬㴠✠潣潬㩲昣昵攲㬷‧㬾⼼偓乁㰾䘯乏㹔⼼佂奄㰾䠯䵔㹌
WTF?
$$anonymous$$y Win7x64 Region/Language/Location is English(Australia) and same for non-Unicode. $$anonymous$$eyboard I$$anonymous$$E is English(Australia) - US.
Answer by homer_3 · Jul 05, 2016 at 04:09 AM
Because monodevelop has been awful since they went from 3.x->4.x. Copy/Paste tends to break after you've added some new scripts and monodevelop needs to refresh to pull the new files in. Closing it and reopening it will fix it.
Answer by David_29 · Jul 05, 2016 at 02:34 AM
I see that you've accepted your answer. Well, just in case if this solution won't work, here's my recommendation next time.
Here, you can't just copy-paste directly to script code from Monodevelop. No other option. You must open the script file via Notepad or Wordpad in order to copy-paste your code. Then, return to Monodevelop and it should refreshed it automatically. I assume that the cause of unable to copy-paste code for some reasons:
third party fonts
third party untrusted code source
This is not correct. Yes, you can paste directly into $$anonymous$$onodevelop and sometimes that breaks, hence this user's question.
It has nothing to do with fonts or untrusted code (as the clipboard is working and pastes plain text into any other notepad or text editor). This is a monodevelop issue and is fixed as described above - with a re-building all and a restart of $$anonymous$$D.