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: indexing a nil when highlight.pattern = "" #348

Open
4 tasks done
h3xOo opened this issue Jan 15, 2025 · 1 comment
Open
4 tasks done

bug: indexing a nil when highlight.pattern = "" #348

h3xOo opened this issue Jan 15, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@h3xOo
Copy link

h3xOo commented Jan 15, 2025

Did you check docs and existing issues?

  • I have read all the todo-comments.nvim docs
  • I have updated the plugin to the latest version before submitting this issue
  • I have searched the existing issues of todo-comments.nvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

NVIM v0.10.3 Build type: RelWithDebInfo LuaJIT 2.1.1731601260

Operating system/version

Artix Linux 6.12.8

Describe the bug

When I set a highlight.pattern to "" or " ", then running TodoTelescope or TodoTroubles tries to index a nil, in lua/telescope/_extensions/todo-comments.lua:44 or lua/trouble/sources/todo.lua:14.

Steps To Reproduce

  1. Set highlight.pattern to empty string
  2. Run TodoTelescope

Expected Behavior

It wouldn't fail.

Repro

vim.env.LAZY_STDPATH = ".repro"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()

require("lazy.minit").repro({
        spec = {
                {
                        "folke/todo-comments.nvim",
                        lazy = false,
                        opts = {
                                highlight = {
                                        pattern = "",
                                },
                        }
                },
                {
                        "nvim-telescope/telescope.nvim",
                        lazy = false,
                        version = false,
                },
        },
})
@h3xOo h3xOo added the bug Something isn't working label Jan 15, 2025
@tgallacher
Copy link

Also hitting this issue after changing the default search/highlight patterns based on #255

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

No branches or pull requests

2 participants