nano-devel
[Top][All Lists]
Advanced

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

[Nano-devel] do_para_begin bug


From: David Benbennick
Subject: [Nano-devel] do_para_begin bug
Date: Thu, 22 Jul 2004 14:30:02 -0400
User-agent: Mutt/1.4.1i

Hi DLR, et. al.

I felt like hacking again, so I took a look at the new justify code.  
There's a bug in do_para_begin().  The attached file consists of 3 
paragraphs (have autoindent turned off!).  From the third line, do ^W^W.  
The cursor moves up two lines, not one.  Add a character to the end of the 
second line, and it works correctly.

The code for do_para_begin and do_para_end was too complicated for me to 
understand (a static local variable and a goto in do_para_search didn't 
help), so I just rewrote them.  They're now stand-alone, and pretty 
simple.  I also simplified do_para_search, since it is now only called 
from do_justify.

Finally, the attached patch makes the quote string regular expression be 
compiled once, globally.  That simplifies the justify code a bit.

Next, I intend to rework do_justify.  It's currently quadratic runtime; I 
think I can make it linear.


By the way: can we use the "bool" data type instead of "int" for boolean 
values?  If it'll get applied, I'll be happy to make a patch that does 
that change globally.

David

Attachment: nanobug
Description: Text document

Attachment: nano.patch
Description: Text document

Attachment: pgp6JQ1LYweNO.pgp
Description: PGP signature


reply via email to

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