From fa9ec0c377305126f4c810be198bdca68d71a275 Mon Sep 17 00:00:00 2001 From: Rory Dudley Date: Thu, 12 Dec 2024 17:59:32 -0700 Subject: Rewrite of the buffer code + proper UTF-8 support This patch rewrites much of the code in src/buffer.rs to (utlimately), be less buggy. It also changed getchar() to have proper support for UTF-8 characters. The autocomplete function was also enhanced to support completions with filenames that have spaces in their paths. It handles these by placing a backslash ('\') before each space in the filename. There is not yet any completion support with quote ('), nor double-quote characters ("). The buffer is still navigable with arrow keys, so arbitrary deletions and insertions are still possible. Deletions and insertions with multi-width UTF-8 characters work as expected. Signed-off-by: Rory Dudley --- Cargo.lock | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Cargo.lock') diff --git a/Cargo.lock b/Cargo.lock index 5f2722c..c4ff2f6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -28,6 +28,7 @@ dependencies = [ "nix", "signal-hook", "termios", + "unicode-width", ] [[package]] @@ -75,3 +76,9 @@ checksum = "411c5bf740737c7918b8b1fe232dca4dc9f8e754b8ad5e20966814001ed0ac6b" dependencies = [ "libc", ] + +[[package]] +name = "unicode-width" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" -- cgit v1.2.3