[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Nano-devel] wrapping, etc.
From: |
David Lawrence Ramsey |
Subject: |
Re: [Nano-devel] wrapping, etc. |
Date: |
Tue, 2 Apr 2002 20:31:36 -0800 (PST) |
--- David Benbennick <address@hidden> wrote:
>On Sun, 31 Mar 2002, David Lawrence Ramsey wrote: <snip>
>> I'm not in front of my box right now, but IIRC, the bug
>> could be reproduced as follows using the following
>> instructions (and, of course, your original wrapping
>> patch). It's easy to see if you turn on constant cursor
>> position display before doing this.
>>
>> 1. start with a blank buffer
>> 2. type in "one two three"
>> 3. move the cursor to the space between "one" and "two"
>> 4. hold down the spacebar until "two three" has wrapped
>> onto the next line
>
>
>I guess it doesn't really matter, but I don't see an error here. I do
> ./nano -c
>in an 80-column xterm. I type
> one two three
>then move the cursor to column 4. I type space until the cursor is in
>column 63. The file has 73 characters (that is, 72 plus the \n). Then
>one more space wraps the "three" and nano correctly says there are 74
>characters.
Hmmm ... I tried it in an 80x24 rxvt, with "this is a test"
and with the cursor initially between "this" and "is", hit
space until "is a test" is on the next line, and then moved
down to the magicline, where nano said I was on character 81
of 82; totsize was high by one. With the fix mentioned
below, nano said I was on character 81 of 81.
>If my original calculation of totsize is correct, then I vote to use it in
>do_wrap(). Three reasons:
> 1) nano is 160 bytes smaller that way. Every little bit helps.
> 2) it is slightly more efficient.
> 3) Mainly, I think the totsize code is more readable that way,
>since it explicitly says how totsize is changing and why.
I'm now going with it for those reasons; see below.
The first attached patch is the last one you sent, with the
following changes:
* reversion to your totsize calculation method; however,
one "totsize++;" in it is commented out for now to keep
totsize from being high by one in certain situations (it
appears to work properly in my preliminary testing; let me
know if any problems result when you try it)
* a few miscellaneous comment and spacing fixes
The second attached patch is nanopieces2.patch, which is
just the old nanopieces.patch updated to a very recent
1.1.7-cvs snapshot (I haven't been able to upgrade to
1.1.8-cvs yet) and built on top of the other patch (since
the former makes some major changes).
_____________________________________________________________
Sluggy.Net: The Sluggy Freelance Community!
_____________________________________________________________
Run a small business? Then you need professional email like address@hidden from
Everyone.net http://www.everyone.net?tag
nanodbdlrwrapetc3.patch.bz2
Description: Binary data
nanopieces2.patch.bz2
Description: Binary data
- Re: [Nano-devel] wrapping, etc.,
David Lawrence Ramsey <=