tingbot / tide-electron

📝   Simple IDE for developing Tingbot apps
Other
22 stars 7 forks source link

Allow using external text editor #58

Open njh opened 8 years ago

njh commented 8 years ago

Hello,

I am quite fond of my text editor - I would like to be able to edit my text file externally, then switch to Tide to upload to the Tingbot. However at the moment Tide doesn't seem to detect that the file has been modified.

A do the same thing in Arduino - but it automatically re-refreshes the file from disk when switching applications.

nick.

joerick commented 8 years ago

Hey @njh - I'd love this to work too. We already have some file-watching abilities in Tide, it reacts to added/removed files automatically. It would be a case of extending this to include files, perhaps by looking at modified date, or looking at the eventType and filename on the watcher.

In the case where the file in memory has a change and a filesystem event comes in, the user should be alerted to this when the event happens, and offered to either reload the file (and discard local changes) or ignore the changes on disk.

This is how Sublime Text handles it:

image

I'm not so fond of this language, our dialog should be

The file “main.py” has been changed by another application. Do you want to discard unsaved changes in Tide and reload the file from disk?

                                                     [Cancel]  [Reload]

Contributions welcome, or I might get around to this at some point 😄