From bfbd5b7e5d2dcf6fde1c44b475ea12f09bc23fdc Mon Sep 17 00:00:00 2001 From: Rory Dudley Date: Mon, 6 Jan 2025 16:22:48 -0700 Subject: Escape some common special characters In addition to the space character (' '), escape the follow characters when (path) completion is invoked by the user: #, ', and ". Signed-off-by: Rory Dudley --- src/buffer.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/buffer.rs b/src/buffer.rs index 7ed05ba..174218a 100644 --- a/src/buffer.rs +++ b/src/buffer.rs @@ -349,7 +349,7 @@ fn comp( let mut j = 0; let mut chars = path.chars().collect::>(); for (i, c) in chars.clone().iter().enumerate() { - if *c == ' ' { + if *c == ' ' || *c == '#' || *c == '\'' || *c == '"' { chars.insert(i + j, '\\'); j += 1; } -- cgit v1.2.3