From a89641b40b5944014df0ba2e6318b06bb23f22e6 Mon Sep 17 00:00:00 2001 From: MarvinJWendt Date: Tue, 9 Apr 2024 00:28:20 +0200 Subject: [PATCH] append newline to autocomplete input if it's missing --- internal/complete/complete.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/complete/complete.go b/internal/complete/complete.go index abab15d..3ed50ff 100644 --- a/internal/complete/complete.go +++ b/internal/complete/complete.go @@ -139,6 +139,11 @@ func doComplete(compLine string, compWord string) { return } + // Append newline if it's missing. (https://github.com/antonmedv/fx/issues/303) + if input[len(input)-1] != '\n' { + input = append(input, '\n') + } + // If input is bigger than 100MB, skip completion. if len(input) > 100*1024*1024 { return