On Aug 15, 2007, at 3:21 AM, Matthew Winn wrote:
>
> I get the impression that the OP doesn't want right-aligned text, but
> wants a better distribution of ragged-right lines. For example,
> consider the first two lines of this paragraph. The naïve breaking
> algorithm used by my mail client has left a deep indentation at the
> end of the second line. A better algorithm would move the "but" from
> the end of the first line to the start of the second, making the ends
> of the lines appear more regular.

Exactly. For a small example, suppose that the text width is 10. The  
current greedy algorithm tries to pack as much onto each line as  
possible before inserting a line break. Sometimes this means it does  
a bad job of filling later lines,  resulting in text like this:

xxx yyy zz
aaaa
bbbbbbb.

when it would be better to break the first line earlier:

xxx yyyy
aaaa zz
bbbbbb.

Equalizing line lengths makes a very noticeable difference when  
applied to large blocks of text. (Note that the last line in a  
paragraph doesn't count -- you don't try to make that one equal-length.)

A couple of people have commented, "I like what gq does now because I  
use it on code."  It seems to me that the proposed change would make  
it do no worse a job of formatting code, and would improve the  
formatting of comments within code.

Cheers,

-- Andrew
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui