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>
2024-07-15 09:31:33 -04:00
..
commands Avoid allocations in Picker file preview callback 2024-07-15 09:31:33 -04:00
handlers Delay auto-save until exiting insert mode (#11047) 2024-06-29 11:08:21 +09:00
keymap feat(command): select_all_children 2024-04-09 10:33:15 -04:00
ui Avoid allocations in Picker file preview callback 2024-07-15 09:31:33 -04:00
application.rs Convert LSP URIs into custom URIs 2024-07-15 09:31:33 -04:00
args.rs Fallback to filename for +arg (#9333) 2024-01-14 15:11:18 +01:00
commands.rs Avoid allocations in Picker file preview callback 2024-07-15 09:31:33 -04:00
compositor.rs add redraw command (#6949) 2023-09-08 10:46:36 +09:00
config.rs feat: smart_tab 2023-08-01 09:41:42 -05:00
events.rs Add hook/event system 2024-01-23 11:20:19 +09:00
handlers.rs Auto Save All Buffers After A Delay (#10899) 2024-06-11 00:39:06 +02:00
health.rs Add glob file type support (#8006) 2024-02-11 18:24:20 +01:00
job.rs Add hook/event system 2024-01-23 11:20:19 +09:00
keymap.rs Allow numbers as second input event (#8471) 2024-02-14 11:53:15 +01:00
lib.rs Ignore .svn version control files (#10536) 2024-04-21 12:00:30 +09:00
main.rs Add glob file type support (#8006) 2024-02-11 18:24:20 +01:00