You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
helix/helix-term/src
Michael Davis 3906f6605f
Avoid allocations in Picker file preview callback
The `FileLocation` and `PathOrId` types can borrow paths rather than
requiring them to be owned. This takes a refactor of the preview
functions and preview internals within `Picker`. With this change we
avoid an unnecessary `PathBuf` clone per render for any picker with a
file preview function (i.e. most pickers).

This refactor is not fully complete. The `PathOrId` is _sometimes_ an
owned `PathBuf`. This is for pragmatic reasons rather than technical
ones. We need a further refactor to introduce more core types like
`Location` in order to eliminate the Cow and only use `&Path`s within
`PathOrId`. This is left for future work as it will be a larger refactor
almost entirely fitting into the LSP commands module and helix-core -
i.e. mostly unrelated to refactoring the `Picker` code itself.

Co-authored-by: Pascal Kuthe <pascalkuthe@pm.me>
4 months ago
..
commands Avoid allocations in Picker file preview callback 4 months ago
handlers Delay auto-save until exiting insert mode (#11047) 5 months ago
keymap feat(command): select_all_children 7 months ago
ui Avoid allocations in Picker file preview callback 4 months ago
application.rs Convert LSP URIs into custom URIs 4 months ago
args.rs Fallback to filename for +arg (#9333) 10 months ago
commands.rs Avoid allocations in Picker file preview callback 4 months ago
compositor.rs add redraw command (#6949) 1 year ago
config.rs feat: smart_tab 1 year ago
events.rs Add hook/event system 10 months ago
handlers.rs Auto Save All Buffers After A Delay (#10899) 5 months ago
health.rs Add glob file type support (#8006) 9 months ago
job.rs Add hook/event system 10 months ago
keymap.rs Allow numbers as second input event (#8471) 9 months ago
lib.rs Ignore .svn version control files (#10536) 7 months ago
main.rs Add glob file type support (#8006) 9 months ago