kevinhwang91 / nvim-hlslens

Hlsearch Lens for Neovim

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Disable Nearest Highlight During Substitute

CallumHoward opened this issue · comments

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

When doing substitution on a search map, the Nearest Highlight remains during the substitution.
For example,

    hl.TelescopePromptTitle = {
      bg = c.bg_dark,
      fg = c.fg_dark,
    }
    hl.TelescopePreviewTitle = {
      bg = c.bg_dark,
      fg = c.fg_dark,
    }

Screen Shot 2022-09-23 at 10 03 20 am

and in nvim:

/fg_dark
:%s//foo_bar_baz/g

(Where empty substitute pattern uses previous search)

I get:

Screen Shot 2022-09-23 at 9 43 42 am

I would like:

Screen Shot 2022-09-23 at 9 57 39 am

I think this can be achieved by possibly disabling hls-lens before substituting and re-enabling after, but I don't see any autocommands like SubstitueEnter and SubstituteLeave that could be used to hook into...

I will support incsearch for substitution, vimgrep, vimgrepadd, lvimgrep, lvimgrepadd and global first.

Try Neovim 0.8 and the latest code. Neovim 0.8 shall be released at the end of this month.

That works great, thank you!