Giter Site home page Giter Site logo

PaqSync command about paq-nvim HOT 2 CLOSED

savq avatar savq commented on July 17, 2024
PaqSync command

from paq-nvim.

Comments (2)

cloudlena avatar cloudlena commented on July 17, 2024 1

Thanks, @savq for implementing the PacSync command so quickly and thoroughly explaining the reasoning about non-interactive commands!

from paq-nvim.

savq avatar savq commented on July 17, 2024

Adding PaqSync is really easy, but using it non-interactively isn't, for some very annoying reasons.

The libuv wrapper that neovim uses has a very unstructured async mechanism. You can pass callbacks to an async operation, but you can't await/return values. It's just callback hell.

Paq deals with this by… not dealing with it. There are callbacks to print back info to the prompt, but the logic to check whether all operations are finished is very limited. So if you were run

nvim --headless -c 'PaqSync'

There would be no way to assert that all updates have completed (so that it quits and continues with the rest of a script or whatever).

Packer does have it's own async library to deal with this, so these limitations aren't a problem there, but I don't know if there are ways to expose it to the user.

Plenary also has utilities for async operations, and I'd be great if these were added to core Neovim.

Since Paq is about using built-in features and keeping a small feature set (for better or worse), I think this is out scope.

from paq-nvim.

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.