kevinhwang91 / nvim-hlslens

Hlsearch Lens for Neovim
BSD 3-Clause "New" or "Revised" License
769 stars 11 forks source link

Center text without disabling hlslens. #57

Closed A-Lamia closed 1 year ago

A-Lamia commented 1 year ago

Feature

So i have have some hotkeys eg, nzzzv to keep each jump centered, issue is zz and zv will disable hlslense. I've made a function that does the same thing when pressing enter when finalizing my search with the same issue.

Resolve

a setting that enables this feature natively.

kevinhwang91 commented 1 year ago

Can't reproduce it, pls follow github template.

A-Lamia commented 1 year ago

I'm a little confused, what can't you reproduce ? zz hiding hlslens ?

kevinhwang91 commented 1 year ago

issue is zz and zv will disable hlslense.

Maybe the culprit is other plugins.

A-Lamia commented 1 year ago

I thought this was just how hlslens worked? press any key and it hides the search ? I think i worded my self wrong by saying "Disable" i meant "hide" if there is confusion there.

kevinhwang91 commented 1 year ago

If calm_down = false, it will clear lens if hlslens find v:hlsearch becomes 0. If calm_down = true, it will also clear lens if cursor is out of matched ranges.

A-Lamia commented 1 year ago

Ok, so if after any keypress hlslens get's cleared while still being in range, that is not default behavior and is more then likely an issue with my config?

kevinhwang91 commented 1 year ago

Yes

A-Lamia commented 1 year ago

Sorry if im bothering you i thought i would just ask here how require("hlslens").start() works ? I'm using it in a custom function but for a key map but it doesn't seem to do anything.

the issue ended up being because of my config setup and all i need to do is start up hlslens again but i can't figure out why the function does nothing for me.

even when i type it in the command nothing happens.

kevinhwang91 commented 1 year ago

how require("hlslens").start() works ?

It's hard to explain, should RTFSC. https://github.com/kevinhwang91/nvim-hlslens/blob/7fb804f504fd0935d65246a1d5ddea73d9ceefc9/lua/hlslens/render/init.lua#L368

let v:hlsearch = 0 , set nohlsearch and noh will clear all lens.