Skip to content

Option to preserve trailing whitespace #503

@heiskane

Description

@heiskane

Currently working on something that requires me to keep track of a cursor in a message and wrap the message in a textbox with the cursor in the right place. This currently is not possible as wrapping trims the trailing whitespace making wrapped text different length from the original message misaligning any position i might track in the message.

Trimming trailing whitespace could be disabled in the options?

wanted behavior.

let text = "as     a hello";
let wrapped = textwrap::wrap(text, 5);
// ["as   ", "  a ", "hello"]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions