- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 11.3k
 
Open
Description
InputText() word-wrapping flag ImGuiInputTextFlags_WordWrap was added in 1.92.3 but is known and was advertised as having variety of issue.
Related issues:
- Word wrapping in Multiline Text #3237 (comment)
 - Add better support for CJK wrapping. #8838
 TextWrappedlooks bad with decimal numbers due to hardcoded separators #8503- Wrapping last punctuation if there are continuous punctuation symbols #8439
 - Text wrapping: the current wrapping is not ideal for punctuations in some cases #8139
 - Feature request : custom separators for TextWrapped #3002
 
Those will eventually need improvements.
The underlying problem/tension is that text-size calculation is a huge bottleneck in the UI system and needs to be carefully optimized. And wrapping needs to be part of text-size calculation (although you can argue it's more rarely used, but I still need to cater for worst case scenario such as #3237 (comment)).
A larger rewrite of the text rendering system + an expected rework on InputText() should both facilitate making easy changes to this without caring as much about performances, but in the meanwhile changes needs to be made rather carefully.
Minimal, Complete and Verifiable Example code:
static char buf[256] = "a a a a a a a a a a a a a a a a";
ImGui::InputTextMultiline("test", buf, IM_ARRAYSIZE(buf), ImVec2(0, 0), ImGuiInputTextFlags_WordWrap);aardappel, Namek and Green-SkyPathogenDavid
