From 5eb1a25d8a0aeb202358b5b5a3b44bb5f43eced6 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Mon, 10 Jul 2023 16:30:42 -0500 Subject: Refactor Registers to take Editor This sets up a new Registers type that will allow us to expand support for special registers. (See the child commits.) We start simple with the regular (`Vec`) registers and the simplest special register, the black hole. In the child commits we will expand these match arms with more special registers. The upcoming special registers will need a few things that aren't possible with the current Registers type in helix-core: * Access to the `Editor`. This is only necessary when reading from registers, so the `&Editor` parameter is only added to `Registers::read`. * Returning owned values. Registers in helix-core returns references to the values backed by the `Vec` but future special registers will need to return owned values. We refactor the return value of the read operations to give `Cow`s and iterators over those. * Returning a `Result` for write/push functions. This will be used by the clipboard special registers. --- helix-view/src/lib.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'helix-view/src/lib.rs') diff --git a/helix-view/src/lib.rs b/helix-view/src/lib.rs index c3f67345..6a68e7d6 100644 --- a/helix-view/src/lib.rs +++ b/helix-view/src/lib.rs @@ -15,6 +15,7 @@ pub mod base64; pub mod info; pub mod input; pub mod keyboard; +pub mod register; pub mod theme; pub mod tree; pub mod view; -- cgit v1.2.3-70-g09d2