diff options
| author | Elijah Koulaxis <90087463+kx0101@users.noreply.github.com> | 2026-02-12 18:55:16 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-02-12 11:55:16 -0500 |
| commit | 8a0cbf04d6a60f91c69c707789b18986a6921f8f (patch) | |
| tree | 41d5ec925fbafa65ec9ddc40defa665d4261f1d9 /test/functional/vimscript/executable_spec.lua | |
| parent | 179e7fccd74b02da06664de7103ba4ccee40778d (diff) | |
| download | rneovim-8a0cbf04d6a60f91c69c707789b18986a6921f8f.tar.gz rneovim-8a0cbf04d6a60f91c69c707789b18986a6921f8f.tar.bz2 rneovim-8a0cbf04d6a60f91c69c707789b18986a6921f8f.zip | |
feat(iter): peek(), skip(predicate) for non-list iterators #37604
Problem:
Iter:peek() only works if the iterator is a |list-iterator| (internally, an `ArrayIter`).
However, it is possible to implement :peek() support for any iterator.
Solution:
- add `_peeked` buffer for lookahead without actually consuming values
- `peek()` now works for function, pairs(), and array iterators
- `skip(predicate)` stops at the first non matching element without consuming it
- keep existing optimized behavior for `ArrayIter` to maintain backward compatibility
- use `pack`/`unpack` to support iterators that return multiple values
Diffstat (limited to 'test/functional/vimscript/executable_spec.lua')
0 files changed, 0 insertions, 0 deletions