SPIGOT-3568: Fix single letter pagination edge case

By: md_5 <git@md-5.net>
This commit is contained in:
Bukkit/Spigot
2017-09-18 20:46:38 +10:00
parent 663dce96c5
commit 28dfa926fd
2 changed files with 17 additions and 6 deletions

View File

@@ -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();