In some cases, running something in TextMate which outputs spaces, then copying that using the "copy output" link in the output window and then pasting it in a new TextMate document, it will paste the spaces as no-break spaces [1].
The easiest way to reproduce this is to run the following Ruby code inside TextMate:
puts ' '
Then follow the steps described above. Note that if I copy the output by selecting the text and copying it manually there's no problem.
[1] http://www.fileformat.info/info/unicode/char/00a0/index.htm
On 26 Sep 2015, at 20:34, Jacob Carlborg wrote:
In some cases, running something in TextMate which outputs spaces, then copying that using the "copy output" link in the output window and then pasting it in a new TextMate document, it will paste the spaces as no-break spaces [1].
The problem is that we convert command output on-the-fly to non-break spaces to get the proper spacing in the web view.
The copy action was added later, and simply grab the content via the DOM, so here the information is lost.
We did consider storing the real output somewhere (like a temporary file), but this was never implemented, even though it does also occasionally bother me.
On 2015-09-30 05:32, Allan Odgaard wrote:
The problem is that we convert command output on-the-fly to non-break spaces to get the proper spacing in the web view.
The copy action was added later, and simply grab the content via the DOM, so here the information is lost.
Ok, I see. But why are not all spaces affected and why does it work when I select the text manually and copy it?
We did consider storing the real output somewhere (like a temporary file), but this was never implemented, even though it does also occasionally bother me.
Can't it just convert back to regular spaces? Or you'll not know if the original output actually contained no-break spaces?
On the other hand, if the output is stored, one could implement some kind of history of the outputs.
On 30 Sep 2015, at 13:41, Jacob Carlborg wrote:
Ok, I see. But why are not all spaces affected
We only convert spaces when there are multiple after each other, and don’t convert the first one.
and why does it work when I select the text manually and copy it?
Apparently the web view will convert non-breaking spaces back to regular spaces, don’t think it always did this.
Can't it just convert back to regular spaces? Or you'll not know if the original output actually contained no-break spaces?
Right, we could convert them back, but there is a slight chance that the output was actually non-breaking spaces (as some people do use them).
Though come to think of it, given that we only convert successive sequences and leave the leading space untouched, a heuristic could match / ( )+/ and convert that into spaces, then the chance of clashing with actual use of non-breaking spaces should be as small as we can make it.
On 30 Sep 2015, at 16:04, Allan Odgaard wrote:
[…] come to think of it, given that we only convert successive sequences and leave the leading space untouched, a heuristic could match / ( )+/ and convert that into spaces, then the chance of clashing with actual use of non-breaking spaces should be as small as we can make it.
Bundle has been updated (and deployed): https://github.com/textmate/bundle-support.tmbundle/commit/600c1c7a08870364c...
On 2015-10-16 19:35, Allan Odgaard wrote:
Bundle has been updated (and deployed): https://github.com/textmate/bundle-support.tmbundle/commit/600c1c7a08870364c...
Great! That will help a lot. Thanks.