terrychou / iVim

A vim port to iOS.
599 stars 34 forks source link

Secure Shellfish Support #99

Open videoMonkey opened 4 years ago

videoMonkey commented 4 years ago

I like iVim a lot, and I was excited that I might be able to edit remote files through the secure shellfish provider, but when I link a folder in secure shellfish, I don’t see anything. If I sync the files for offline first, then I can see the files, but the syncing process is wonky and I lost some work that way. I reached out to the developer and he shared the following.

I don’t know exactly how things are implemented in iVim but it sounds like it reads and writes files without doing file coordination. This is something iOS requires in order to make sure two apps are not writing files at the same time and to allow file providers to act on file requests.

You can read about file coordinators here: NSFileCoordinator - Foundation | Apple DeveloperDocumentation

If directories are listed in a file coordinated way Secure ShellFish is told by iOS and has a chance to populate the directory such that you do not need to mark it for offline use. The files in such directory listings start out as placeholder files with the correct name, length and change dates but without content and only when you do a file coordinated read is the actual file fetched from the server. As you make file coordinated writes iOS tells Secure ShellFish about it giving it resources to upload any changes in the background.

I wish I had the programming chops to be able to help with this problem, or to even know how hard this change might be, but I want to request an update to the files implementation.

terrychou commented 4 years ago

@videoMonkey did you open iVim's files in Shellfish, or Shellfish's in iVim? Can you please provide the detailed steps you took (in a reproducible way)?

videoMonkey commented 4 years ago

Sorry for the long delay, yes I could. I will eventually. However, I have since changed my workflow, not because of this issue, but because of the other dev I am collaborating with. I am new to vim, but really enjoying it’s power. Using workingcopy + ssh upload I can edit directories in vim no problem. It’s actually working a lot better than secure shellfish could. Thanks for all the great work you do on this software!