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

bug: nohlsearch = false still clear the search highlights #142

Closed
3 tasks done
woosaaahh opened this issue Jul 11, 2023 · 2 comments · Fixed by #144
Closed
3 tasks done

bug: nohlsearch = false still clear the search highlights #142

woosaaahh opened this issue Jul 11, 2023 · 2 comments · Fixed by #144
Labels
bug Something isn't working

Comments

@woosaaahh
Copy link

Did you check docs and existing issues?

  • I have read all the flash.nvim docs
  • I have searched the existing issues of flash.nvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

NVIM v0.10.0-dev-657+g19fb573ad

Operating system/version

Linux/Arch

Describe the bug

Hi !

First of all, thanks a lot folke and all the contributors for this amazing plugin !!!

I understand the <CR>/"regular search" part from this issue #139.
But is this normal/expected that setting nohlsearch = false everywhere still clear the search highlights ?

Steps To Reproduce

  1. I run nvim -u minimal_code.lua
  2. I edit the file :e minimal_code.lua
  3. I search for 'hlsearch' /hlsearch
  4. I type a label

Then the cursor jump at the right location but the highlights are cleared, even with nohlsearch = false.
If I use the keymap (s) defined at the end of the file, the highlights are still cleared.

Sorry but I don't use any plugins managers. If the minimal code must use 'lazy', then I'll try with it.

Expected Behavior

Search highlights are still displayed after a jump when using nohlsearch = false.

Repro

local flash = require("flash")

flash.setup({
	jump = {
		nohlsearch = false,
	},
	modes = {
		search = {
			enabled = true,
			jump = { nohlsearch = false },
		},
	},
})

vim.keymap.set({ "n", "o", "x" }, "s", function()
	flash.jump({
		jump = {
			nohlsearch = false,
		},
	})
end, { desc = "Flash" })
@woosaaahh woosaaahh added the bug Something isn't working label Jul 11, 2023
@woosaaahh woosaaahh changed the title bug: nohlsearch = false still clear the highlights bug: nohlsearch = false still clear the search highlights Jul 11, 2023
@folke folke closed this as completed in 6e7d6c2 Jul 12, 2023
@folke
Copy link
Owner

folke commented Jul 12, 2023

If you jump, the search is cancelled, so there was nothing to clear.

However, I just added support for showing search highlights when nohlsearch=false and jump.register = true

@woosaaahh
Copy link
Author

Oh... then I'm really sorry for not understanding the use case for this option !

Thanks a lot for your work and this plugin !

I'm trying flash until the end of the week and it's pretty cool so far !
Who know, maybe I'll ditch sj !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants