Git Product home page Git Product logo

Comments (9)

minad avatar minad commented on June 3, 2024 1

@tpeacock19 @clemera I implemented support for ephemeral buffers via the predicate, see bba8ac5

from consult.

minad avatar minad commented on June 3, 2024

Yes, this functionality has been taken away. Unfortunately it is not possible to implement it without dynamic candidate lists. This means if we want invisible buffers to be shown too, we would have to show them right away :(

Overall, I see these possibilities:

  1. Just use switch-to-buffer if you want to switch to an hidden buffer, I do that almost never, so this is what I am using. Do you often switch to invisible buffers?
  2. Use dynamic candidates as soon as that becomes a possibility (not yet possible, since selectrum misses support for dynamic candidates in its completing-read implementation). But this would also introduce a bit of additional complexity, so I am not sure if we want that.
  3. Always show invisible buffers (Not a good idea, I guess)
  4. Add some additional keybindings to consult-buffer which starts a new switch-buffer session etc. Basically hack around not having dynamic candidate lists available. I have an idea on how to implement this quickly. Maybe I try that.

What do you think?

from consult.

tpeacock19 avatar tpeacock19 commented on June 3, 2024

I don't use it too commonly, but it helps when trying to troubleshoot issues some packages face when executing external programs such as curl. I also have switch-to-buffer on a keybinding and it will probably suffice.

I doubt there will be many that need the functionality; I was just curious as to why it had gone away.

great package by the way, really appreciate your work!

from consult.

minad avatar minad commented on June 3, 2024

Thank you! I tried to implement this quickly, but it is not easy to integrate it nicely with the current mechanism I use for narrowing to files, buffers etc. So given that the buffer switching to invisible buffers is pretty rare I am more inclined to keep things as is.

from consult.

minad avatar minad commented on June 3, 2024

For reference - here is the experiment https://github.com/minad/consult/tree/narrow-ephemeral. But it is very half-baked and does not integrate nicely with the functionality of consult--read, the consult wrapper around completing-read.

from consult.

minad avatar minad commented on June 3, 2024

Ping @clemera - this could be a possible hack to emulate dynamic candidates for consult-grep/consult-rg, basically installing an after-change-functions hook, start with an empty candidate list, after a few keypresses run grep, throw keyboard-quit and restart the completing-read session with run-at-time. Not sure if we want to go that route, it is also a bit like reimplementing parts of @oantolin's action mechanism from Embark.

from consult.

clemera avatar clemera commented on June 3, 2024

Bypassing completions styles seems better to me to get something like this, but maybe we don't need to call the process automatically in background. Having it under control which string to pass to the process and trigger it manually on the user side would also have its benefits, I think.

from consult.

minad avatar minad commented on June 3, 2024

@clemera You mean using a different completion style to hide/unhide invisible buffers. Interesting idea. I have no idea though on how this could be implemented. But then the question is why not use a custom completion style for narrowing too? Is it possible to locally change the completion style? But I think I recall either you or @oantolin saying that they prefer not to mess with the completion style.

The question if using such a keyboard-quit mechanism is a good idea is orthogonal to the other question - but I am also not convinced that it is a good idea and if we need the dynamism for consult-grep after all.

from consult.

clemera avatar clemera commented on June 3, 2024

I experimented with changing the completion-style locally in this Selectrum issue and it seems that could work but there is still the problem that passing a string to the completion function will often prefilter you candidates based on prefix using all-completions, I plan to experiment to override all-completions so it passes the empty string when it gets passed the string for the completion, maybe that could work well enough.

from consult.

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.