From c1fe588de4a0b09263a38f25376e3b3e57d0aa7d Mon Sep 17 00:00:00 2001 From: Brady Date: Fri, 11 Oct 2019 18:08:39 -0500 Subject: [PATCH] Leijurv is crying and shaking right now --- src/launch/java/baritone/launch/mixins/MixinGuiChat.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/launch/java/baritone/launch/mixins/MixinGuiChat.java b/src/launch/java/baritone/launch/mixins/MixinGuiChat.java index 1c4b6d90..8d4c867e 100644 --- a/src/launch/java/baritone/launch/mixins/MixinGuiChat.java +++ b/src/launch/java/baritone/launch/mixins/MixinGuiChat.java @@ -79,7 +79,9 @@ public class MixinGuiChat { if (event.completions.length == 0) { this.pendingSuggestions = Suggestions.empty(); } else { - int offset = this.inputField.getText().endsWith(" ") ? this.inputField.getCursorPosition() : 0; + int offset = this.inputField.getText().endsWith(" ") + ? this.inputField.getCursorPosition() + : this.inputField.getText().lastIndexOf(" ") + 1; // If there is no space this is still 0 haha yes List suggestionList = Stream.of(event.completions) .map(s -> new Suggestion(StringRange.between(offset, offset + s.length()), s))