[prev in list] [next in list] [prev in thread] [next in thread] 

List:       boost
Subject:    Re: [boost] [program_options] Formatting; split at space
From:       Sascha Ochsenknecht <s.ochsenknecht () googlemail ! com>
Date:       2009-11-30 16:56:17
Message-ID: 4B13F931.509 () googlemail ! com
[Download RAW message or body]

Hi Chad,


Am 30.11.2009 17:03, schrieb Chard:
> Function: format_paragraph 
> File: options_description.cpp, line 423:
>  
>   if (last_space != line_begin) 
>   {                 
>     // is last_space within the second half ot the 
>     // current line 
>     if ((unsigned)distance(last_space, line_end) <
>         (line_length - indent) / 2)                 // "- indent" ? 
>     { 
>       line_end = last_space; 
>     } 
>   }
> 
> I'm given to understand that the code around here is designed to split the 
> description at a space, iff the space occurs at least half-way through the 
> description text.
> 
> The code currently subtracts the indent from the line_length, where the 
> line_length (within format_paragraph) represents the space available for the 
> description (indent has already been subtracted from line_length at the 
> beginning of format_paragraph).
> 
> The result is that the longer the option names, the less chance of the split 
> occurring at a space within the description.  Was this the intention?
> 
> E.g. if an option is 40 chars long, then there is no chance of it splitting at 
> a space (for 80 column default).
> 

This is code is already patched on trunk:

if (last_space != line_begin)
{
    // is last_space within the second half ot the
    // current line
    if (static_cast<unsigned>(distance(last_space, line_end)) <
        (line_length / 2))
    {
        line_end = last_space;
    }
}

So, it will look for a space in the second half of the description part
of the text.
This patch was submitted with Ticket #2613.

I can not say if it is already merged to release branch.

Cheers,
Sascha
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic