nano-devel
[Top][All Lists]
Advanced

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

Re: [Nano-devel] wrapping, etc.


From: David Benbennick
Subject: Re: [Nano-devel] wrapping, etc.
Date: Wed, 3 Apr 2002 07:43:21 -0500 (EST)

On Tue, 2 Apr 2002, David Lawrence Ramsey wrote:
> 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.

Thank you very much!  Since I was convinced my code was right, I never
would have found that bug.  Indeed, that "totsize++;" line was entirely
wrong.  The file size was increasing because of the space being added
between "after_break" and "wrap_line", but I forgot about the space being
turned to NULL, where the wrap happened.  Thus, in the "wrapping" case,
the totsize should not change.

I took the opportunity to comment that fact, and also to re-indent all the
comments in do_wrap() to make them look better.

There is still one improvement I would like to make to do_wrap().  At the
bottom, it calls do_right() many times to get the cursor back where it
started in the text.  This is kludgish and inefficient; perhaps there is a
better way.



The attached patch has some actual code changes too:

* Defines "shortcut *extcmd_list" only if !NANO_SMALL.

* In nano 1.1.8, run "nano -F", ^R <Enter> to open another buffer.  Type
something misspelled.  ^T to spell check it.  The "^G Get Help" and "^C
Cancel" shortcuts appear twice!  A similar effect happens with the
shortcuts displayed after ^R (Read File) ^X (Execute Command).  The
attached patch fixes this bug.  There were two calls to free_shortcutage()
missing.

* Removed a duplicated loop check in do_justify().

Attachment: 03apr07:35.diff
Description: Text document


reply via email to

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