Bugs item #1869862, was opened at 2008-01-12 10:41
Message generated for change (Comment added) made by lebert
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=111005&aid=1869862&group_id=11005

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Program
Group: development
Status: Open
Resolution: Accepted
Priority: 9
Private: No
Submitted By: Bert Wesarg (lebert)
Assigned to: Nobody/Anonymous (nobody)
Summary: "^" doesn't match all lines

Initial Comment:
To reproduce:

start nedit in a clean NEDIT_HOME

create the following document and move the cursor back to the beginning:

-----cut-----
1
2
3

5
6
7
-----cut-----

open the search dialog in 'regex' and 'keep' mode and search for "^"

keep pressing "Find" to cycle through all lines

you will see that line 5 is never matched

NEdit release of Jan 12, 2008

     Built on: Linux, 486, GNU C
     Built at: Jan 12 2008, 10:26:44
   With Motif: 2.2.3 [@(#)Motif Version 2.2.3]
Running Motif: 2.2 [unknown]
       Server: The X.Org Foundation 10300000
       Visual: 16-bit TrueColor (ID 0x23, Default)
       Locale: en_US.UTF-8


----------------------------------------------------------------------

>Comment By: Bert Wesarg (lebert)
Date: 2008-09-21 11:58

Message:
Unfortunately, the proposed fix breaks backwards search. Thanks anyway.

----------------------------------------------------------------------

Comment By: Thorsten Haude (yooden)
Date: 2008-01-20 18:02

Message:
Logged In: YES 
user_id=119143
Originator: NO

I did the BufGetEmptySelectionPos() transmogrification, please have a
look.
File Added: SF1869862-searchline.2008-01-20.3.diff

----------------------------------------------------------------------

Comment By: Thorsten Haude (yooden)
Date: 2008-01-13 20:11

Message:
Logged In: YES 
user_id=119143
Originator: NO

It seems that on repeated searches, searchMatchesSelection() (search.c)
returns True for empty selections if the search term is not empty but
zero-width (as in the example, where ^ matches "").

So it would solve the problem at hand if we would let
searchMatchesSelection() return False for empty selections. Further, since
BufGetEmptySelectionPos() is only called by searchMatchesSelection(), we
can change *that* to do as promised: "[...] returns TRUE for empty
selections" (note not "non-existing selections").

(It doesn't help that the documentation about selection.zeroWidth is less
than clear: 'Width 0 selections aren't "real" selections, but they can be
useful when creating rectangular selections from the keyboard.' So since
selection.zeroWidth is a char, what does it hold? A boolean? (Would that
imply a True for selection.selected?) An "A" for "A-Ok, continue with your
work!!"?)

----------------------------------------------------------------------

Comment By: Thorsten Haude (yooden)
Date: 2008-01-13 19:15

Message:
Logged In: YES 
user_id=119143
Originator: NO

http://nedit.cvs.sourceforge.net/nedit/nedit/source/search.c?r1=1.83&r2=1.84

----------------------------------------------------------------------

Comment By: Thorsten Haude (yooden)
Date: 2008-01-13 16:46

Message:
Logged In: YES 
user_id=119143
Originator: NO

Yes, that's why I set the Resolution to Accepted.

----------------------------------------------------------------------

Comment By: Bert Wesarg (lebert)
Date: 2008-01-13 16:25

Message:
Logged In: YES 
user_id=122956
Originator: YES

But you see the bug with current CVS HEAD?


----------------------------------------------------------------------

Comment By: Bert Wesarg (lebert)
Date: 2008-01-13 16:22

Message:
Logged In: YES 
user_id=122956
Originator: YES

But you see the bug with current CVS HEAD?


----------------------------------------------------------------------

Comment By: Thorsten Haude (yooden)
Date: 2008-01-13 14:17

Message:
Logged In: YES 
user_id=119143
Originator: NO

I don't see this bug with the 5.5 binary.

NEdit 5.5
Sep 30, 2004

     Built on: Linux, 386, GNU C
     Built at: Oct  1 2004, 15:55:40
   With Motif: 2.1.30 [@(#)Motif Version 2.1.30]
Running Motif: 2.1 [unknown]
       Server: The XFree86 Project, Inc 40300001
       Visual: 24-bit TrueColor (ID 0x23, Default)
       Locale: [EMAIL PROTECTED]


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=111005&aid=1869862&group_id=11005
-- 
NEdit Develop mailing list - [email protected]
http://www.nedit.org/mailman/listinfo/develop

Reply via email to