Your comments

In the preview window, you can enable Firebug, but that is really only useful for inspecting elements because it is loaded after the page is loaded and JavaScript is already executed.

Did you try to reference it directly from your HTML as the first script as described on the Firebug Lite site? http://getfirebug.com/firebuglite#Stable

There are certain limits even then. Since Firebug Lite itself is written in JavaScript, it might not be able to catch errors if the site has syntax errors in JavaScript code.
Currently this is not possible, sorry. If you ran Mountain Lion, you could use this feature to download the last compatible version of the app: http://support.apple.com/en-us/HT201377

Unfortunately, this does not work on Lion.
That's actually the default behavior of all text editors that use the standard NSDocument architecture of OS X, like Apple's TextEdit or Pages and other apps like iA Writer.

Here is an Apple support document that explains this feature in detail: https://support.apple.com/en-us/HT203659

This is what Apple suggests to disable this feature:

On Macs, you can use either of these methods to stop the app from saving your document to iCloud:
  • Turn off Documents & Data: Choose Apple () menu > System Preferences, click iCloud, then deselect the Documents & Data checkbox. When you turn off Documents & Data, the iCloud Document Library no longer opens for any Mac apps that use Documents in the Cloud. You can continue to upload and download documents using the iWork for iCloud apps at iCloud.com.
  • Save the document to your Mac. Your edits will no longer be saved to iCloud, and your previously autosaved document will be removed from iCloud.
iCloud sync on iOS 8 still does have occasional hiccups - not just in Textastic, but also in other apps including Apple's. When I had problems like this, it often helped to reboot the device. It looks like the iCloud sync process sometimes gets stuck and a reboot restarts it.

It can also help to edit a file that didn't upload as this triggers another upload.

This *should* all work automatically, but unfortunately, sometimes it doesn't.
Can you please give me example files that I can use to reproduce it on my device?
Can you tell me which method you use to switch between tabs? Do you use a shortcut or do you click on the tab?

I tried the following:

  • Hit Cmd-N to create a new file
  • Type text into the file
  • Hit Cmd-N to create another new file in a second tab
  • Type text
  • Hit Cmd-Z -> this deletes the contents in the second tab, but doesn't delete text in the first tab