nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nano-devel] linewrap bug with words longer than terminal


From: David Lawrence Ramsey
Subject: Re: [Nano-devel] linewrap bug with words longer than terminal
Date: Sun, 11 Jun 2006 16:00:19 -0400
User-agent: Thunderbird 1.5.0.4 (X11/20060516)

Mike Frysinger wrote:
> if you have a "word" that is longer than the terminal (say 80 char
> terminal and the word is 100 chars) and line wrapping enabled, then
> the words after it don't get wrapped properly
>
> for example, set your terminal to 80 characters, and then run:
> $ perl -e "print 'a' x 100" > foo
> $ echo " hi there bub" >> foo
> $ nano foo
>
> turn on line wrapping, and then with your cursor at the beginning of
> the "word" 'a', hit space ... instead of bringing down the words after
> the long string of a's, the whole line is wrapped down

This looks like a bug at first glance, but it actually isn't one.  The
routine to break the line works backwards from the optimum wrap point,
and if the only blank it finds is the space you just typed at the
beginning of the a's, that's what it'll use.  Pico wraps its lines the
same way.

> if you expand the terminal to over 100 chars so you can start to see
> the stuff after the string of a's (like expand the terminal to just
> 105 cols), then the stuff after will get line wrapped properly when
> you start inserting whitespace at the beginning of the string of a's

I'm guessing you're using the default fill of -8.  If so, the difference
in wrapping behavior is due to it.  When the stuff after the string of
a's is within 8 columns of the edge of the screen, it will be wrapped;
otherwise, it won't.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]