append newline to autocomplete input if it's missing

This commit is contained in:
MarvinJWendt 2024-04-09 00:28:20 +02:00
parent 21f58332a9
commit a89641b40b

View File

@ -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