dstein64 / nvim-scrollview

A Neovim plugin that displays interactive vertical scrollbars and signs.
MIT License
562 stars 10 forks source link

Feature Request: set some sign inside the scrollbars #113

Open XXiaoA opened 1 year ago

XXiaoA commented 1 year ago

When I try to migrate from satellite.nvim, I found that all signs of scrollview is in the left of scrollbars. However, some signs are inside the bar such as mark cursor in satellite, which provide a better outward and save some space.

here is a comparison screenshot. The first one is scrollview and the other is satellite scrollview satellite

At last, thanks for the awesome plugin.

XXiaoA commented 1 year ago

Is it possible to add a option of each sign to switch their mode between inside and outside. And add a option like priority to decide a sign whether cover another sign on inside mode or whether a sign should on the right side of others on outside mode?

rosingrind commented 1 year ago

You can set it with scrollview_signs_column = 0 (sets scrollbar's column as a first column for drawing signs) and scrollview_signs_max_per_row = 1 if you'd like to draw only one sign in this column. AFAIK, it's not possible to draw multiple signs in-place like in https://github.com/petertriho/nvim-scrollbar, but it's possible to click them tho!

XXiaoA commented 1 year ago

Okay, thnks. And what's your opinion about

Is it possible to add a option of each sign to switch their mode between inside and outside. And add a option like priority to decide a sign whether cover another sign on inside mode or whether a sign should on the right side of others on outside mode?

rosingrind commented 1 year ago

what's your opinion

I think a priority feature may be handy, but I don't use mouse input that much to crave for the feature. For me the signs on the bar is more like a visual assistant rather than a regular nav tool. Obviously, sometimes I click on some signs if my hands are already on mouse, but I didn't trip on these breadcrumbs once, so that's it

XXiaoA commented 1 year ago

but I don't use mouse input that much to crave for the feature

So do I.

I think mode and priority just provide the capability to make the outward better. For instance, we can set the cursor inside the bar, the gitsigns on the rightest outside the bar (exactly, on the left side of bar and close the bar most nearly), and if here has a mark, it can be in the left of gitsigns so that gitsign can keep in a line.

rosingrind commented 1 year ago

Ah, I didn't get your original idea correctly. I think this actually may be a handy addition and it will natively sit within plugin's configuration - this is also probably the most you can squeeze out of scrollbar customization, so implementing the addition is an obvious step. Vim and it's ecosystem was always about customizing and personalization 👍

I also think the feature spec (and original issue post) may need more refinement and conclusions, for example: the end-user may be required to configure same plugin thrice, and not everyone will be happy with that. Don't get me wrong, I'm not against any new additions and improvements :)

XXiaoA commented 1 year ago

Ah, I didn't get your original idea correctly.

Oh, my poor English skill's fault.

Sorry, I don't get your point about the end-user may be required to configure same plugin thrice. Why is that? User maybe need to do a lot of configuration, which waste their time? If that's the case, we can provide a default configuration which same as like the original.

I agree with your opinion about need more refinement and conclusions, as this feature may be a BREAK CHANGE of the plugin which will everyone loathes.

Thanks for your positive reply. Much appreciated 😀

rosingrind commented 1 year ago

Oh, my poor English skill's fault.

I'm not a native neither, just a miscommunication :)

the end-user may be required to configure same plugin thrice

From my point of view, splitting sign container into 3 instances (left, right, middle) with prioritization will require in essence to at least set priority settings for each of 3 sign containers, something like this:

{
    "dstein64/nvim-scrollview",
    opts = {
        signs_on_startup = { "all" },
        left = {
            signs = {
                { "diff", priority = 3 },
                { "mark", priority = 4 },
            },
            column = 1,
        },
        right = {
            signs = {
                { "bingus", priority = 2 },
                { "mark", priority = 5 },
            },
            column = 2,
        },
        middle = {
            signs = {
                { "cursor", priority = 0 },
            },
            column = 1,
            winblend = 34,
        },
    },
},

I think you can't just set a priority for each of sign independently and hope that it will work. Also, keep in mind that you may probably want to add your own signs == more configuration.

From a "first-class customization support" perspective it's a great addition, from a "not-so-good at configuring" end-user it's a weirdness. I think this will definitely need a discussion or a brainstorm, if the maintainer/contributors didn't think about it properly already

XXiaoA commented 1 year ago

Your point of three instances is nice. I had never thought of it. If all things go following my original idea, it does need lots of configuration for user. Maybe we need wait for maintainer/contributors' idea/attitude