From 552c7bc40bc1792a9283bfe2b01a7f8c28fae97f Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Sun, 14 Feb 2021 13:50:43 +0100 Subject: [PATCH] Don't add a space if completion only added a single "/" This added a space if only one character was added, e.g. ```fish cd dev ``` would complete to ```fish cd dev/ ``` which makes picking deeper directories awkward. So just go back to the old behavior of doing it for any length. This is a regression from e27d97b02e6c0f9fad079e1bf7ec937661077f86. cc @krobelus --- src/complete.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/complete.cpp b/src/complete.cpp index a6f182aa9..4aff61277 100644 --- a/src/complete.cpp +++ b/src/complete.cpp @@ -196,7 +196,7 @@ static complete_flags_t resolve_auto_space(const wcstring &comp, complete_flags_ if (flags & COMPLETE_AUTO_SPACE) { new_flags &= ~COMPLETE_AUTO_SPACE; size_t len = comp.size(); - if (len > 1 && (std::wcschr(L"/=@:.,-", comp.at(len - 1)) != nullptr)) + if (len > 0 && (std::wcschr(L"/=@:.,-", comp.at(len - 1)) != nullptr)) new_flags |= COMPLETE_NO_SPACE; } return new_flags;