[SPIGOT-3568] ChatPaginator Inconsistent Word Wrap Created: 16/Sep/17  Updated: 18/Sep/17  Resolved: 18/Sep/17

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Caleb L. Power Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: ChatPaginator, Spigot, wordWrap
Environment:

Bukkit.getVersion() : git-Spigot-65e8124-bde2a93 (MC: 1.12.1)
Bukkit.getBukkitVersion() : 1.12.1-R0.1-SNAPSHOT


Attachments: Text File image-2017-09-16-05-31-55-445.png    

 Description   

The ChatPaginator.wordWrap() method does not seem to properly wrap Strings in instances where single-letter words (such as the word "a") are near the end of a line.

Example Code:

 

String[] wrappedLines = ChatPaginator.wordWrap("You just bought 1 ticket for the 1st lottery for a total of 1.0 dollar. You now have 1 ticket.", ChatPaginator.GUARANTEED_NO_WRAP_CHAT_PAGE_WIDTH);
for(String line : wrappedLines) sender.sendMessage(line);

Example Output:

 



 Comments   
Comment by Caleb L. Power [ 16/Sep/17 ]

Note that in the example code, the variable "sender" is of type CommandSender and is properly initialized via the standard onCommand method.

Generated at Sat Dec 13 13:39:17 UTC 2025 using Jira 10.3.13#10030013-sha1:56dd970ae30ebfeda3a697d25be1f6388b68a422.