What the heck is happening to my whitespace? [ANSWERED]

So - I write some code in Codify, cut and paste it into github, and every other leading space is turned into an odd “hard space” or something - take a look:

https://github.com/bortels/Party/blob/05b2c6ee54e8f80c024b4579eb82bab0e1346075/Party.lua

That’s not seen as whitespace by loveCodify, so I have to strip it out.

Is it because I tend to use space instead of tabs? Is there a purpose for it? Can we turn that off, or is there something I can do differently while we’re still limited to cutting/pasting? Or maybe it’s a github thing? It’s driving me batty.

Codea only uses spaces - no tabs. It uses 4 spaces for a tab.

I think iOS converts paste data into “non breaking spaces,” which are a special Unicode character. In fact I had to implement a special check in Codea to convert non breaking spaces into regular spaces - or Lua couldn’t run it. I think this is just something iOS does on copy/paste.

Well bleagh. Ok then - I’ll keep my fingers crossed this goes away once we get some sort of code sharing and don’t need cut and paste. Until then… I’ll whip up a quick script (in lua? why not!) on the OS X side to replace this unicode fluffery with good old ascii 32. :slight_smile:

On the code-sharing note, if Codea supported the Gist API for saving and loading projects that’d be just heavenly. :wink:

Sometimes when i am deleting a random number of spaces i realized that when i’m hitting one time for each space, the delete key, the editor behaviour is to deleting all the spaces until the word and it continues deleting letters of the word…i think this is a bug… : I-)

On the iPad 1 I’ve always noticed some lag in all editors, even twitter. That lag causes extra deletes to accrue. I’ve not narrowed down was causes this lag. It happens on typing new characters not just delete. It is not happening atm.

I’m getting something weird when going the other way. I write some code in Emacs on Linux, then save it to the iPad, then launch Codea, and all the indentation is off. Worse, the display gets very confused and it’s as if there are two versions of the line - one with indentation and one without - and Codea shows one through the other (maybe where there are spaces).

When I look at the files in Linux, all the characters are whitespace, but Codea seems to treat whitespaces and whitespaces-inserted-by-the-tab-key slightly differently so maybe they are different. Or maybe it’s line endings, I don’t know!

Is there anything special about spaces at the start of lines, or line endings, that I should be aware of?

No, all tabs are just four spaces. Is emacs inserting non-breaking spaces? Codea does try to correct them when it finds them, but if the file is edited externally I’m unsure.

Turned out it was tabs. I needed to examine files that emacs and codea had both just saved to see the difference. Somehow, when I looked at them in codea and then looked at them again on the filesystem then I wasn’t seeing the tabs. M-x untabify is my new best friend.