Subject: Re: Looking for problem confirmation
From: Sam TH (sam@uchicago.edu)
Date: Fri Jan 05 2001 - 21:33:30 CST
On Fri, Jan 05, 2001 at 10:23:17PM -0500, Thomas Fletcher wrote:
> On Sat, 6 Jan 2001, Bruce Pearson wrote:
>
> > This is by design.
> > For word wrapping with various justifications it is important that spaces do
> > not get wrapped to the beginning of the line. When breaking a line we look
> > for the first non space character that is passed the end of the line and
> > then break at this point.
>
> It may be by design, but it is also wrong for certain cases. Once
> we pass a boundary then we need to wrap. I refuse to accept that
> this is correct behaviour. If you think it is, then please explain
> it to me and tll me why no other word processor has this feature =;-)
>
It sounds like our current algorithm looks like this:
while(curchar != space) && (pos<endOfLine)
{
keepGoing();
}
breakToNewLine();
What we want is this:
while ((pos<endOfLine) ||
((curchar == space) && (prevchar != space) &&(pos == endOfLine)))
This eats the one space in between normal words, but if you type extra
spaces, it is assumed that you want them to appear on the new line.
Also, if the previous character is a space, then we want to break
right there, since this again isn't a space we want to hide.
This algorith breaks down in the case of double spaces at the end of a
sentence, though.
Any other ideas?
sam th
sam@uchicago.edu
http://www.abisource.com/~sam/
GnuPG Key:
http://www.abisource.com/~sam/key
This archive was generated by hypermail 2b25 : Fri Jan 05 2001 - 21:33:40 CST