Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

calm_down - add additional option hide only hlsens labels #31

Open
JoseConseco opened this issue Apr 7, 2022 · 4 comments
Open

calm_down - add additional option hide only hlsens labels #31

JoseConseco opened this issue Apr 7, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@JoseConseco
Copy link

JoseConseco commented Apr 7, 2022

Is your feature request related to a problem? Please describe.
I sometimes use search highlights, so that I can easily visualize occurrences of selected/searched word. I do not use n/N then, so calm_down is great since it hides hlslens labels. But it also hides the highlights of matched words.

Describe the solution you'd like
add additional option - calm_down_labels_only to config. This with it enabled, only hlslens labels would be hidden.

Describe alternatives you've considered
I think there is none.

Additional context
image

@kevinhwang91
Copy link
Owner

    require('hlslens').setup({
        override_lens = function() end
    })

@kevinhwang91 kevinhwang91 added the question Further information is requested label Apr 8, 2022
@JoseConseco
Copy link
Author

@kevinhwang91 I can see that main.lua has;

if calmDown then
        if not position.inRange(startPos, endPos, curPos) then
            vim.schedule(function()
                cmd('noh')
                reset()
            end)
            return
        elseif hit then
            return
        end
    end

    render.addWinHighlight(0, startPos, endPos)
    render.doLens(splist, #offsetPos == 0, idx, rIdx) 

And there are - addWinHighlight and doLens. I assume disabling doLens and leaving addWinHighlights enabled will get me the result I want.
However I do not see option to disable only doLens on calm_down from override_lens function (I'm not that good at nvim lua)

@kevinhwang91
Copy link
Owner

No option for that. Have you tried the setup I post above?

@JoseConseco
Copy link
Author

@kevinhwang91 using :
override_lens = function() end
Removed labels permanently. But it is not what I want. I want to see labels when pressing N, n, *, etc. But after my cursor is moved outside matched word, I want to hide labels only (and leave highlights). See image: top - cursor on word when jumping through matches with N/n, bottom - cursor moved outside match - calm_down kicks in:
image

Right now hlslens would remove highlights on bottom. But I would like to see them (and maybe disable manually using :set hlsearch!)

@kevinhwang91 kevinhwang91 reopened this Apr 8, 2022
@kevinhwang91 kevinhwang91 added enhancement New feature or request and removed question Further information is requested labels May 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants