Skip to content

CalcWordWrapPosition does not deal with ... correctly #9094

@aardappel

Description

@aardappel

Version/Branch of Dear ImGui:

docking branch 8f3f428 of 2025-10-03

Back-ends:

SDL2 + OpenGL3

Compiler, OS:

Win11 + MSVC 2022

Full config/build information:

No response

Details:

This is very tiny issue, feel free to delete if not worth addressing :)

CalcWordWrapPosition seems to treat . as end of sentence even when there's multiple dots, like for example... this! would get split up as for example. .. this!. Having it split as for example... this! would be nicer.

A related issue is that if you use this code to split and later re-concatenate you'll end up with a space between . and .. as you have no way of telling there wasn't one.

Looks like this code would need to get more complicated:

            // Allow wrapping after punctuation.
            inside_word = (c != '.' && c != ',' && c != ';' && c != '!' && c != '?' && c != '\"' && c != 0x3001 && c != 0x3002);

Frankly, simply requiring a space after punctuation would be both simpler and more predictable, I hope there is not a lot of people that write text like,this.

Screenshots/Video:

No response

Minimal, Complete and Verifiable Example code:

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions