JFreegman / toxic

A Tox-based instant messaging and video chat client
GNU General Public License v3.0
1.19k stars 152 forks source link

feat: message line padding configuration #665

Closed hazelwarez closed 1 month ago

hazelwarez commented 1 month ago

Introduces new line_padding config option, which has a default value of true to correspond with the existing line padding behavior added in 8e84ac5.

When set to false a message exceeding the width of the window will be wrapped into new lines without an x_start number of blanks being printed first. Setting x_limit to max_x to prevent column padding is precedented by the existing newline_idx >= 0 block.

Example of the behavior with line_padding=true:

00:00 - Toxic User: Lorem ipsum dolor sit amet, consectetur adipiscing elit.
                    Integer neque metus, lacinia quis magna ut, laoreet magna.
00:00 - User2: Nam suscipit faucibus justo, ut malesuada neque aliquet at...
               This text is misaligned with a message from any user with
               a user name of differing length.

Example of the behavior with line_padding=false:

00:00 - Toxic User: Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Integer neque metus, lacinia quis magna ut, laoreet magna.
00:00 - User2: Nam suscipit faucibus justo, ut malesuada neque aliquet at...
This text is always aligned with the first column of the window.

This option also allows long URLs to be copied without the padding being copied along with them, thereby breaking the URL and requiring manual intervention.

A Client_Config pointer parameter has been added to print_wrap because various other routines in the same interface already accept one, as well as to make future text wrapping configuration options easier to implement, should someone desire to.

JFreegman commented 1 month ago

Can you please open this PR in the https://github.com/toktok/toxic fork?