On Wed, Aug 15, 2007 at 10:55:07AM -0700, Gary Johnson wrote:

> Oh!  I misunderstood.  Thanks for the explanation.  Yes, that would be
> a nice alternative to the current algorithm.

I recently wrote an implementation of the optimal line breaking
algorithm (in Ruby). If you are interested, the file is located here,
with a small piece of test code at the end:
http://lissujaismo.net/rbpar/rbpar_engine.rb

You can run the test code by saying "ruby rbpar_engine.rb".

The library is actually part of a (yet unreleased) email text
processing
framework that I've been writing for Vim and other plain text editors.
I think it shouldn't be too difficult to use Vim Ruby bindings to run
the
algorithm for a range of text lines, but I haven't looked at that yet.
One possible problem could be maintaining the cursor position.

--
Ismo Puustinen <[EMAIL PROTECTED]>


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

Raspunde prin e-mail lui