Repository navigation
sprite.nvim v0.7.0
sprite.nvim v0.7.0 sends a list to Sprite in a fraction of the time, and sends only the rows that changed.
- Only changed rows are sent:
dock:rows()still takes the whole list, but a host that listsvirtual-list-patch-v1is now sent just the rows that differ from the last list. Changing one row of a 2,029-row list sends about 300 bytes where it sent 1 MB. A plugin callsrowsthe same way either way. (#17) reuse_rows: a dock opened withreuse_rows = trueremembers each row table's text, so a plugin that passes the same table again for an unchanged row pays only for the rows that changed. It is a promise not to change a row table in place after passing it; see the README. (#17)- Faster requests: a quicker JSON encoder, a larger socket send buffer, and two fewer turns of the event loop per request. (#17)
- Malformed text is refused, not fatal: a request holding malformed UTF-8, such as a file name in an old encoding, is refused with a
protocolerror and the Surface stays open. Before, some of it reached the host, which ends the connection. (#17)
Changing one row of a list, from dock:rows() to its callback, in a real Neovim in a Sprite pane:
| List | v0.6.0 | v0.7.0 | v0.7.0 with reuse_rows |
|---|---|---|---|
| 2,029 rows | 28 ms | 5.3 ms | 0.7 ms |
| 20,290 rows | not measured | 32.6 ms | 2.7 ms |
Breaking: Neovim 0.12 or later is now required. On an older Neovim, require("sprite") raises "sprite.nvim needs Neovim 0.12 or later". A string holding a NUL byte is now sent as a string, not a list of numbers.
Compatibility
Sending only changed rows needs Sprite 0.8.0 or later. With an older Sprite every list is sent whole, as before, and nothing else changes. This is a source release with no compiled component.
Validation
CI passed on the tagged commit on Linux and macOS with Neovim stable and nightly, with formatting and the protocol check against Sprite's committed fixture.
Compare: v0.6.0...v0.7.0