Attempt to fix #2125

This commit is contained in:
Markus Ebner 2022-11-11 15:16:08 +01:00 committed by Octavia Togami
parent fc44a3ae8d
commit d05e84268b

View File

@ -227,7 +227,9 @@ private static Substring onlyOnLastQuotedWord(Substring lastArg, Substring sugge
return suggestion;
}
String substr = suggestion.getSubstring();
int sp = substr.lastIndexOf(' ');
// Ignore if suggestion ends with a " ", since that signals the end of
// the completed command.
int sp = substr.trim().lastIndexOf(' ');
if (sp < 0) {
return suggestion;
}