diff options
author | md_5 <git@md-5.net> | 2017-09-18 20:46:38 +1000 |
---|---|---|
committer | md_5 <git@md-5.net> | 2017-09-18 20:46:38 +1000 |
commit | 4f16bdbabbad82b6130b19bcc0a4621dee83e86e (patch) | |
tree | 71fd3a46ae21a6824147fee3baa9888177e2fee2 /src/main/java | |
parent | 06355ab54732ff648a69bdb72aa242ff46e11e34 (diff) | |
download | bukkit-4f16bdbabbad82b6130b19bcc0a4621dee83e86e.tar bukkit-4f16bdbabbad82b6130b19bcc0a4621dee83e86e.tar.gz bukkit-4f16bdbabbad82b6130b19bcc0a4621dee83e86e.tar.lz bukkit-4f16bdbabbad82b6130b19bcc0a4621dee83e86e.tar.xz bukkit-4f16bdbabbad82b6130b19bcc0a4621dee83e86e.zip |
SPIGOT-3568: Fix single letter pagination edge case
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/org/bukkit/util/ChatPaginator.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/org/bukkit/util/ChatPaginator.java b/src/main/java/org/bukkit/util/ChatPaginator.java index 87c8aec6..b0b91ad8 100644 --- a/src/main/java/org/bukkit/util/ChatPaginator.java +++ b/src/main/java/org/bukkit/util/ChatPaginator.java @@ -93,7 +93,10 @@ public class ChatPaginator { for (String partialWord : word.toString().split("(?<=\\G.{" + lineLength + "})")) { lines.add(partialWord); } - } else if (line.length() + word.length() - lineColorChars == lineLength) { // Line exactly the correct length...newline + } else if (line.length() + 1 + word.length() - lineColorChars == lineLength) { // Line exactly the correct length...newline + if (line.length() > 0) { + line.append(' '); + } line.append(word); lines.add(line.toString()); line = new StringBuilder(); |