Commit Graph

11 Commits

Author SHA1 Message Date
4d04feb662 feat(lua): vim.tbl_contains supports general tables and predicates (#23040)
* feat(lua): vim.tbl_contains supports general tables and predicates

Problem: `vim.tbl_contains` only works for list-like tables (integer
keys without gaps) and primitive values (in particular, not for nested
tables).

Solution: Rename `vim.tbl_contains` to `vim.list_contains` and add new
`vim.tbl_contains` that works for general tables and optionally allows
`value` to be a predicate function that is checked for every key.
2023-04-14 10:39:57 +02:00
66c66d8db8 fix(loader): reset hashes when running the loader 2023-04-13 17:34:47 +01:00
a5c572bd44 docs: fix typos
Co-authored-by: Gregory Anders <greg@gpanders.com>
Co-authored-by: Raphael <glephunter@gmail.com>
Co-authored-by: C.D. MacEachern <craig.daniel.maceachern@gmail.com>
Co-authored-by: himanoa <matsunoappy@gmail.com>
2023-04-04 19:07:33 +02:00
83bfd94d1d refactor(loader): cache hash information
Whenever we run fs_stat() on a path, save this information in the loader
so it can be re-used.

- Loader.loadfile: Remove arguments `hash` as it is no longer needed.

- Loader.loader: Use _G.loadstring instead of Loader.load
  This allows plugins to wrap loadstring to inspection and profiling

- factor out read file logic
2023-03-31 13:05:22 +01:00
4cff3aceea fix(loader): disable profiling by default 2023-03-31 09:43:13 +01:00
fd70a9dca1 refactor(loader): simplify tracking logic 2023-03-26 14:11:43 +01:00
25fa051fa1 feat(vim.fs): improve normalize
- Add options argument with an option to expand env vars
- Resolve '//' -> '/'
- Use in vim.loader
2023-03-26 13:30:11 +01:00
ffd8cd1a96 refactor(loader): add typing for package.loaders 2023-03-26 12:51:56 +01:00
fab8dab6b6 refactor(loader): remove BufWritePost autocmd 2023-03-26 12:47:06 +01:00
3c82ce0d62 refactor(loader): use vim.fs 2023-03-26 12:46:24 +01:00
2257ade3dc feat(lua): add vim.loader
feat: new faster lua loader using byte-compilation
2023-03-26 11:42:15 +01:00