fix(entry_index): prevent recursive indexing on overrides#3297
Open
jamestrew wants to merge 1 commit intonvim-telescope:masterfrom
Open
fix(entry_index): prevent recursive indexing on overrides#3297jamestrew wants to merge 1 commit intonvim-telescope:masterfrom
jamestrew wants to merge 1 commit intonvim-telescope:masterfrom
Conversation
89abfcb to
12b3787
Compare
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.
12b3787 to
4bb0aed
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When indexing into an entry inside of the override function, the same key you are overriding, this causes an infinitely recursive indexing.
eg.
This change will let the entries keep track of indexes that have been overridden and prevent recursive indexing.