From 0fb4a808ef67ad87423430c66dcd2531592403f1 Mon Sep 17 00:00:00 2001 From: AnotherTest Date: Thu, 30 Apr 2020 13:09:23 +0430 Subject: [PATCH] Shell: Provide the correct invariant length to the line editor --- Shell/main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Shell/main.cpp b/Shell/main.cpp index 19f96a5ab7..f59dcf1850 100644 --- a/Shell/main.cpp +++ b/Shell/main.cpp @@ -1135,7 +1135,7 @@ int main(int argc, char** argv) // e.g. in `cd /foo/bar', 'bar' is the invariant // since we are not suggesting anything starting with // `/foo/', but rather just `bar...' - editor.suggest(token_to_complete.length(), 0); + editor.suggest(escape_token(token).length(), 0); // only suggest dot-files if path starts with a dot Core::DirIterator files(path, @@ -1185,7 +1185,7 @@ int main(int argc, char** argv) } suggestions.append({ cached_path[index], " " }); - editor.suggest(token_to_complete.length(), 0); + editor.suggest(escape_token(token).length(), 0); return suggestions; }; @@ -1216,7 +1216,7 @@ int main(int argc, char** argv) // e.g. in `cd /foo/bar', 'bar' is the invariant // since we are not suggesting anything starting with // `/foo/', but rather just `bar...' - editor.suggest(token_to_complete.length(), 0); + editor.suggest(escape_token(token).length(), 0); // only suggest dot-files if path starts with a dot Core::DirIterator files(path,