[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Escape some common special characters


In addition to the space character (' '), escape the follow characters
when (path) completion is invoked by the user: #, ', and ".
---
 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::<Vec<char>>();
     for (i, c) in chars.clone().iter().enumerate() {
-        if *c == ' ' {
+        if *c == ' ' || *c == '#' || *c == '\'' || *c == '"' {
             chars.insert(i + j, '\\');
             j += 1;
         }
-- 
cheers!~
Rory




Archive administrator: postmaster AT dwarvish DOT org