summaryrefslogtreecommitdiffstatshomepage
path: root/runtime/lua/vim/glob.lua
AgeCommit message (Collapse)AuthorFiles
2026-01-12fix(glob): handle numeric literals in pattern matching (#37257)Tristan Knight1
Problem: vim.glob.to_lpeg() errors when patterns contain numeric literals (like the '1' in '.ps*1') because LPeg interprets numeric strings as indexed grammar rule references. For example: vim.glob.to_lpeg('.ps*1') E5108: Lua: rule '1' undefined in given grammar Solution: Prefix all rule names with '_' in the end_seg() function to prevent literal numbers from being interpreted as LPeg indexed rules. This ensures pattern components like '1', '2', etc. are treated as regular rule names rather than special references.
2025-06-03fix(glob): handling commas in letter pattern #34170Brynne Taylor1
2025-05-22feat(glob): new Glob implementation based on Peglob #33605Brynne Taylor1
|vim.glob.to_lpeg()| uses a new LPeg-based implementation (Peglob) that provides ~50% speedup for complex patterns. The implementation restores support for nested braces and follows LSP 3.17 specification with additional constraints for improved correctness and resistance to backtracking edge cases.
2025-01-27fix: resolve all remaining LuaLS diagnosticsLewis Russell1
2024-10-31fix: another round of type annotation fixesLewis Russell1
2024-07-06fix(glob): avoid `subcapture nesting too deep` error (#29520)Zoltán Nyikos1
Use Cmt to evaluate Cond and Elem during match to avoid building the nested capture structure later.
2024-06-10fix(glob): handle overlapping `{}` condition elements #29236Jon Huhn1
This change fixes an issue where glob patterns like `{a,ab}` would not match `ab` because the first option `a` matches, then the end of the string is expected but `b` is found, and LPeg does not backtrack to try the next option `ab` which would match. The fix here is to also append the rest of the pattern to the generated LPeg pattern for each option. This changes a glob `{a,ab}` from being parsed as ("a" or "ab") "end of string" to ("a" "end of string" or "ab" "end of string") Here, matching against `ab` would try the first option, fail to match, then proceed to the next option, and match. The sacrifice this change makes is dropping support for nested `{}` conditions, which VSCode doesn't seem to support or test AFAICT. Fixes #28931 Co-authored-by: Sergey Slipchenko <faergeek@gmail.com>
2024-01-19refactor(lua): refactored globaltermo1
2024-01-17fix(lua): return after assert returns assert message (#27064)altermo1
2024-01-02docs(glob): add glob module (#26853)Mathias Fußenegger1
2023-12-22refactor(lsp): move glob parsing to util (#26519)Steven Arcangeli1
refactor(lsp): move glob parsing to vim.glob Moving the logic for using vim.lpeg to create a match pattern from a glob into `vim.glob`. There are several places in the LSP spec that use globs, and it's very useful to have glob matching as a generally-available utility.