Giter VIP home page Giter VIP logo

Comments (16)

terrychou avatar terrychou commented on May 29, 2024 3

This has been released in version 1.36

from ivim.

terrychou avatar terrychou commented on May 29, 2024 2

I have added related code into the branch: https://github.com/terrychou/iVim/tree/openurl
You can have a look at it by installing it via Xcode.

It now supports opening a folder, and within it, you can add files or subfolders, editing or deleting files, renaming files or folders. (I add the filesystem support as much as I can)

Please test it and any suggestions are welcome.

from ivim.

holzschu avatar holzschu commented on May 29, 2024 1

Yes, I had it on for a while: you need to set allowsMultipleSelection to true.

from ivim.

terrychou avatar terrychou commented on May 29, 2024 1

Thanks @palmin

So in iOS before 11, what I could do is to add "public.directory" into the document types of the document picker. The rest depends on the other apps to implement file provider to support it.

from ivim.

terrychou avatar terrychou commented on May 29, 2024 1

No, we have been talking about how to enable :idoc to open folders, which is the first step to make the "setting working directory" possible. Some more code needs to be added for it to work properly.

from ivim.

terrychou avatar terrychou commented on May 29, 2024

This "folder opening" feature is somehow like the new "packaged document editing". The difference is that the system doesn't treat the former as an editable item therefore you cannot open it. Maybe you can try and rename your target folder to a recognizable package extension (packaged documents are actually folders, except that they have specific extensions), to see whether that would work or not. But be warned, in this case, updating one file will update the whole folder between the two apps. So there might be efficiency problem with huge folders.

from ivim.

terrychou avatar terrychou commented on May 29, 2024

The main problem here, is there seems no way to choose a folder in the document picker invoked by :idoc. (You tap a folder, it enters it instead of picking it.) I have tried "public.directory" or "public.folder" but neither works.

Does anyone know the solution to this?

from ivim.

terrychou avatar terrychou commented on May 29, 2024

Thanks, @holzschu , this is exactly what I needed.

But it seems a new addition to iOS 11, is there any way to have this function in iOS 9 or 10?

from ivim.

holzschu avatar holzschu commented on May 29, 2024

I have no ways to test it, but from what I understand from a quick internet search, it's possible that the functionality was present by default on iOS 9 and 10, and had to be explicitly enabled on iOS 11.

@palmin had folder selection working in WorkingCopyApp before iOS 11: https://www.youtube.com/watch?v=TA8atK2sdxc He may be able to give help here.

from ivim.

palmin avatar palmin commented on May 29, 2024

For iOS 8 through iOS 10 the document picker handles UI for selecting documents and it is up to each specific implementation to support directories. I know of Working Copy and Git2Go that support picking directories.

The document picker is passed the UTI's that the app wants to pick files conforming to and Working Copy would allow picking directories if any of the types conformed to public.directory. I presume Git2Go does something similar.

Note that the document picker is no longer used on iOS 11 but a file provider is needed for both iOS 10 and earlier and for iOS 11, but there is a API error (confirmed by Apple engineers) such that it isn't possible to make a file provider that works for both iOS 11 and iOS 10 and earlier. Apps can thus either support the Files app in a legacy mode and retain file provider compatibility with iOS 10 or they can fully support the Files app and drop file provider support for iOS 10.

from ivim.

jhofmeyr avatar jhofmeyr commented on May 29, 2024

I'm struggling to follow the conversation a bit ... does this mean that setting the folder as the working directory for iVim is dependent on Working Copy changing something in their setup to allow idoc to open the folder? I'm on iOS 11.2.6

from ivim.

jhofmeyr avatar jhofmeyr commented on May 29, 2024

Thanks, I'll take a look this weekend

from ivim.

holzschu avatar holzschu commented on May 29, 2024

Hi @terrychou,
It works for me. Great job.

Files and directories created by shell commands do not appear in the other app until they are edited by and saved by iVim. Is there anything I can change for this?

from ivim.

terrychou avatar terrychou commented on May 29, 2024

Thanks for feedback, @holzschu .

Since all the filesystem events in this part are triggered through vim, only operations in the vim way (e.g. vim functions, vim commands, etc.) would work.

If you want to make this work for the shell part, you need to make the all sync code response to the events triggered by the shell commands. Check out file gui_ios.m for functions such as mch_ios_post_file_remove(...). (I wanted to add deeper filesystem events handling, but unfortunately iOS doesn't have the FSEvents available.)

from ivim.

terrychou avatar terrychou commented on May 29, 2024

made the filesystem operations much safer and updated the code.

Please test it. (testing it in the iPad split view mode would be great). This code still doesn't guarantee bug-free, therefore please make backups before testing.

from ivim.

terrychou avatar terrychou commented on May 29, 2024

updated the related code more and made it even more safer.

Are you having any problems so far?

This version will be put onto App Store if no obvious problems are found.

from ivim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.