Hello, guest. We have noticed that you are not registered at this bug tracker. Your experience will be greatly enhanced if you log in. To do so, you first must register by clicking on the Register tab at the top. If you are already registered, you can login at the Login tab.
Syndicate Syndicate Listing Display Search Login/Register
Bug Id ?
Reporter ?
David Gasperoni
MacGDBp / 1.5
Status ?
Severity ?
Duplicate Of ?
- none -
Fixed in Revision ?
Mstone ?
Summary ?
Using non breaking whitespace in code view cause annoying side effects
Report Time ?
June 1, 2015 11:21 AM
Assignment ?
Resolution ?
Priority ?
Dependencies ?
- none -
Mstone (old) ?

ws-246.patch Replace non-breaking spaces with spaces when copying from source view
For: 0 (0%)
Against: 0 (0%)
Total: 0

June 1, 2015 11:21 AM David Gasperoni
Version 1.5 (104.0)
OS X 10.10.3, stock Apache/2.4.10, PHP 5.6.9 (brew) with Xdebug v2.3.2 (brew).

See this, video 2: https://www.dropbox.com/sh/unima1ankadniet/AABGwZ57liltjE-QPPfTE1nAa?lst

The whitespace in the code view is C2A0, which means that code copied from that view is not usable for anything.

December 14, 2018 10:58 PM outis
The video link in the original description is dead, so I can't tell with certainty what the original issue was, but the summary suggests it's that text copied from the code view contains non breaking whitespace, so when pasted into something else, it won't run as PHP code.

The cause for that issue is `php -s` (which is used to generate the rich text in the code view) replaces all spaces and tabs with non-breaking spaces in its HTML-ized output.

One quick solution would be to perform a reverse replacement when the text is copied from the source view. I'll attach a patch to illustrate.

December 14, 2018 11:04 PM outis
To undo `php -s`'s space & tab to nbsp conversion, replaces nbsps with spaces for the plain text on the pasteboard after copying from BSSourceViewTextView (leaves the rich-text on the pasteboard as-is).

On September 4, 2019 02:40 PM, Robert changed:
September 4, 2019 02:40 PM Robert
Fixed for 2.0.

September 4, 2019 02:41 PM Robert
Note though I took a different approach than the proposed patch: I replace the non-breaking spaces in the source view, rather than only on copy.