-
Notifications
You must be signed in to change notification settings - Fork 757
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
Copy/paste from SC IDE to Mail loses formatting & tabs (OS X) #657
Comments
|
Thanks, On Nov 19, 2012, at 10:44 AM, jamshark70 notifications@github.com wrote:
|
frankly, this sounds more like a bug in apple mail |
Okay, but "frankly", this worked just fine with 3.5.x, keeping formatting, syntax colouring, etc. So, yes, perhaps it's a "bug" in Mail, but there must be some difference in the way the clipboard data is being captured between 3.5 and 3.6. When using the same Mail version, I get nice formatting with 3.5 pastes, and no formatting whatsoever (not even tabs/spaces) with 3.6 pastes. Just speaking from a user's POV. Glen. On Nov 19, 2012, at 11:21 AM, Tim Blechmann notifications@github.com wrote:
|
neither jakob nor me is using osx, so what worked for you in 3.5, never worked for us. that said, you are more than welcome to have a look at the sources and provide a patch. |
There is a difference: SC.app uses a rich text editor while the IDE uses plain text. The issue basically looks like Apple mail doesn't handle plain text pasting very well. I guess it doesn't have to, since the vast majority of Apple mail users are sending baby pictures to grandma rather than code snippets. Simple test: Write some plain text in TextEdit (make sure to choose the plain text option from whichever menu). Include some tabs. Then copy and paste into an email message. If the tabs disappear, then the issue is not specific to the SC IDE and therefore is unlikely to be fixable within the IDE. If they don't disappear, then the other variable is that the IDE code editor is a qt widget, whereas TextEdit is native cocoa. That might be fixable in the SC codebase, or it could be a qt bug. I'd suggested this would be better as a list thread because it's not clear that this is, in fact, an IDE bug. If there's doubt, better to start on the mailing list. |
btw, apple mail is known to cause some troubles when pasting: iirc pasting something like |
Btw, this:
... really sounds like an Apple mail bug. Any reasonable HTML conversion would turn multiple consecutive spaces into non-breaking spaces, or nbsp spc nbsp spc... If Apple mail isn't doing that, then it isn't sc's fault. |
Looks like a Qt widget thing, then (or the interaction between Qt widgets and Mail). James -- I tried the TextEdit.app thing you suggested, copying from a Plain Text file. Both tabs and spaces pasted correctly into Mail. I then tried with a Qt widget (I created a TextView in a Window using SC), put some text containing tabs and also with indenting spaces into it, then copied from it and pasted into Mail. Same result as from the SC IDE (flush with left margin). If you can suggest some other Qt apps I could try this with, I would do it… Anyhow, how do I go about logging a Qt bug (or an Apple Mail one, for that matter)? Thanks again, On Nov 19, 2012, at 11:46 AM, jamshark70 notifications@github.com wrote:
|
(for those who are interested) Okay, so I've never looked at any Qt code before. I got SC compiling on my Mac for the first time, then tried figuring out where the darn copy/paste code is (turns out there isn't any; it uses the Qt default behaviour from QPlainTextEdit and QTextEdit). The HTML that is copied by SC (for a very simple example) is:
This markup relies on the CSS2 property Interestingly, if I make an overload for Thanks all for your feedback. P.S. Note that there is no text colour or font information in the HTML copied data from SC. If it were needed or wanted at some point, I suppose we could generate our own HTML code here to copy to the clipboard, with full colour, font, etc. |
That's because the syntax highlighting is applied on-the-fly, just before rendering to screen, and does not make part of the document's content. Hence, this is not a bug/feature of HTML generation on copying. |
In any case, I think it would make sense to make the code editor only copy plain text, as that's what code really is. |
Fix for #657; copy/paste to OS X Mail loses tabs
fixes supercollider#657 (cherry picked from commit 04cbd76)
One disadvantage of the new IDE is that when you copy/paste text from the editor to an email (on OS X, at least), all formatting is lost. The colouring of code isn't so important (though it would be nice -- 3.5.x used to keep it), but the indenting is very important. Right now, when you paste from the IDE to a Mail message, all the code is flush with the leftmost column.
Note: if you paste from SC to TextEdit, there is no formatting, but at least the tabs are kept. So it would be nice if this also worked when pasting into Mail (a workaround is to paste into TextEdit, then copy that new text and paste it into Mail, though that's a bit of a pain).
The text was updated successfully, but these errors were encountered: