Coder Social home page Coder Social logo

Comments (6)

ghillb avatar ghillb commented on September 4, 2024

I think this would not be trivial to implement, as vim does not seem to be able to distinguish between press and release events:

https://stackoverflow.com/questions/16564293/distinguishing-between-the-hold-and-release-of-a-modifier-key-between-two-keystr

(There is also a workaround for this kind of problem mentioned in the answer section of the Stackoverflow question)

Incidentally, I'm working on a feature, which maybe is and an adequate solution to this. It will make it possible to switch the buffer immediately in the last_used mode also. This way you would be always directly in the buffer you have selected in Cybu (like in the default mode).
But for this to work and not to pollute the last used history, there is a little more work involved. So it will probably take a while.

In the meantime I can only recommend reducing the display_time parameter, so you don't have to wait so long :)

from cybu.nvim.

jghauser avatar jghauser commented on September 4, 2024

Oh, a shame neovim doesn't distinguish between key press and release. Thanks for explaining that. I also found this neovim core issue, though it doesn't seem to be very active. Hopefully at some point the feature will see the light of day! :)

I'm really looking forward to the new feature you're planning. Does that have anything to do with the changes you just implemented (I'm not quite sure I understand the immediate/on_close and rolling/paging functionalities)?

What might also be useful in combination with switching buffers immediately would be to dim the buffers when the cybu floating window is present. This would make that window stand out much more. I'm imagining something like what hop does or what shade.nvim wants to do for floating windows generally. Incidentally shade.nvim doesn't work with cybu (nothing gets dimmed when the cybu window is open), do have any idea why that might be the case?

Given that this feature requires a change in upstream -- and a change that might very well never be implemented -- feel free to close this issue if you want.

from cybu.nvim.

ghillb avatar ghillb commented on September 4, 2024

You are right, a few more details in the docs regarding this new options wouldn't hurt. They are in fact the precursor to the mentioned feature.

The immediate option enables instant buffer switching (as soon as the focus in the cybu window moves to the new list entry), in contrast to the on_close option, which lets cybu switch the buffer only when the cybu window closes.

Right now, using the immediate option for the last_used mode will pollute your buffer history, which makes it a bit less useful. To make this right, there needs to be an additional history of last used buffers curated by the plugin, and there is the complexity (at least I think so).

The rolling view type displays the focus and buffers list like a slot machine (see previews in the readme for the default mode) and the paging view type partitions the list (wandering focus over a static segment of the last used list). Before this options, one was stuck with immediate & rolling behavior for the default mode and with on_close & paging for the last_used mode. Now you can have all combinations for both modes.

I really like your idea with dimming the background when cybu is open, and will look into how it might be resolved that cybu and shade.nvim don't work well together.

from cybu.nvim.

jghauser avatar jghauser commented on September 4, 2024

Thanks a lot for all the explanations! It was mostly my mistake for tripping over British vs. American bahavior/behaviour when editing my config 🤦.

I hope the dimming thing will work! :)

Btw (and sorry for the change of topic): Would u consider also making the highlight of cybu's float's border configurable? Currently, it uses whatever FloatBorder is set to, but it would be nice to be able to adjust that.

Thanks again for the great work!

EDIT: Note that shade.nvim seems unmaintained. However, I've managed to get it to work mostly fine with just a few changes, and a PR with those is pending in the shade.nvim repo. I might consider forking eventually if the creator doesn't pick it up again.

from cybu.nvim.

ghillb avatar ghillb commented on September 4, 2024

Cool that you managed to fix this! I will see how it develops and maybe mention that it is possible to do this with shade.nvim in the readme.

On the window border issue:
I have pushed a commit to main that allows you to customize the highlight group of the window border via:

config = {
  style = {
    highlights = {
      border = "YourHLGroup",
    },
  },

from cybu.nvim.

jghauser avatar jghauser commented on September 4, 2024

Great, thanks a lot!

from cybu.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.