Skip to content

fix(entry_index): prevent recursive indexing on overrides#3297

Open
jamestrew wants to merge 1 commit intonvim-telescope:masterfrom
jamestrew:entry_index-recursion-check
Open

fix(entry_index): prevent recursive indexing on overrides#3297
jamestrew wants to merge 1 commit intonvim-telescope:masterfrom
jamestrew:entry_index-recursion-check

Conversation

@jamestrew
Copy link
Copy Markdown
Contributor

When indexing into an entry inside of the override function, the same key you are overriding, this causes an infinitely recursive indexing.

eg.

local opts = {
  entry_index = {
    text = function(entry)
      -- accessing the same key you're overriding in the override
      -- function will lead to stack overflow

      return "foobar " .. entry.text -- bad
    end,
  }
}

This change will let the entries keep track of indexes that have been overridden and prevent recursive indexing.

@clason clason force-pushed the entry_index-recursion-check branch from 89abfcb to 12b3787 Compare April 11, 2026 11:28
When indexing into an entry inside of the override function, the same
key you are overriding, this causes an infinitely recursive indexing.

eg.
```lua
local opts = {
  entry_index = {
    text = function(entry)
      -- accessing the same key you're overriding in the override
      -- function will lead to stack overflow

      return "foobar " .. entry.text -- bad
    end,
  }
}
```

This change will let the entries keep track of indexes that have been
overridden and prevent recursive indexing.
@clason clason force-pushed the entry_index-recursion-check branch from 12b3787 to 4bb0aed Compare April 13, 2026 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant