folke / flash.nvim

Navigate your code with search labels, enhanced character motions and Treesitter integration
Apache License 2.0
2.47k stars 33 forks source link

bug: labels may exist as a continuation of the search pattern when using smartcase #304

Closed lukasz-matysiak closed 2 months ago

lukasz-matysiak commented 8 months ago

Did you check docs and existing issues?

Neovim version (nvim -v)

0.9.4

Operating system/version

Fedora 39

Describe the bug

When I open the definition of tst_QFuture::whenAnyDifferentTypes in tst_qfuture from the qtbase repo (https://github.com/qt/qtbase/blob/c4bd6ac4e5a0782d8771af1485a3b78733180785/tests/auto/corelib/thread/qfuture/tst_qfuture.cpp#L4834) and search for Q, one of the labels is F which is the next character in QFuture. QFuture

Steps To Reproduce

  1. Configure nvim to use smartcase
  2. Open the tst_qfuture file from the qtbase repo and go to the definition of tst_QFuture::whenAnyDifferentTypes : https://github.com/qt/qtbase/blob/c4bd6ac4e5a0782d8771af1485a3b78733180785/tests/auto/corelib/thread/qfuture/tst_qfuture.cpp#L4834
  3. Search for Q

Expected Behavior

Labels do not contain a character that is a continuation of the search pattern (F in this case)

Repro

-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  "folke/tokyonight.nvim",
  { "folke/flash.nvim", opts = {} },
  -- add any other plugins here
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here
vim.opt.ignorecase = true
vim.opt.smartcase = true
vricop commented 7 months ago

Same here.

ATM-Jahid commented 5 months ago

I'm experiencing this problem as well. I have uploaded an example file below. I wanted to search for "DIFdel" in the file but the search ends either on "I" or "F".

del.txt

github-actions[bot] commented 2 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] commented 2 months ago

This issue was closed because it has been stalled for 7 days with no activity.