[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kwrite-devel
Subject:    Getting rid of KateSearch ?
From:       Anders Lund <anders () alweb ! dk>
Date:       2007-02-19 22:51:51
Message-ID: 200702192351.53884.anders () alweb ! dk
[Download RAW message or body]

Hi,

Maybe this is the time to get rid of KateSearch (katesearch.cpp/h)?

The classes therein are badly cluttered, and it's probably as easy to just 
dismiss it and start with what is already in katesearchbar.

What is missing form that is

* replacement (requires some work, but not scaringly much)

* picking up search phrases based on the cursor position/selection (this needs 
some deciding, if we pick up a search phrase we should wait for user 
activation before searching, and not nessecarily search whenever the pattern 
is changed)
  
* search options (the buttons are there but not all working)

* saving options over sesisons (do we want that?)

* saving search phrases (do we want that?)

* sane defaults (case sensitive off, whole words off, regex off, from cursor 
on, selection only automatic(?), highlight all off) (user configurable?)

* command line support (which is not as important with the embedded interface, 
though still nice - at least for me it has become a habit using the command 
line)

Supposedly this would allow us to close quite a few bugs related to searching!

Problems and thoughts:
Getting enough space for all those widgets!

The 'Previous' and 'Next' buttons already suffer, since the labels should 
really be 'Find Next/Previous' or 'Next/previous Match' to really make sense.

For replacement, at least one more line will be needed, probably two to make 
room for the placeholder stuff.

We could make it possible to hide the search options, to benefit users with 
simple needs. I personally often wants exactly what the searchbar provides pr 
default: incremental search for a simple string from the cursor position.  ;)

We could make the incremental search optional, I'd personally like that quite 
often.

There is a hidden feature!! (TAB/BS key does find next/previous). How do we 
expose that? (also, ESC hides the widget)

The 'lightsalmon' color used to visually indicate that the text could not be 
found. visual feedback is cool, but could we use a red color instead of an 
orange? (the 'palegreen' works better, green as it is)

I send this just having comitted a lot of functionality to the search:

SVN commit 635416 by alund:

Make the functions in the search bar work (mostly), here is a status:

[x] case sensitive (was working already.)
[x] whole words (like in 3.5, add \b at the ends of the pattern.
[x] regular expression (if not enabled, the pattern used is passed through 
QRegExp::excape(). Search is not performed unless the pattern is valid.)
[x] from cursor (begin in the proper place IMO, this should be enabled pr 
default.)
[/] selection only (when enabled, the search is not incremental and you have 
to press the RETURN key to perform the search. This is because the result is 
selected, and as such the selection is moved. We could store the original 
selection to work around this, and eventually highlight it differently. 
thoughts about this is wellcome.)
[/] highlight all (all matches are found, and highlight added but not 
displayed or removed *visually* again EVER. read kwrite-devel from today for 
the entertaining story ;). Code-wise, the highlight are removed when a new 
search is initiated, this should be subject to discussion as well, maybe we 
should provide a way to unhighlight it, or do it in other/more events (hiding 
the search bar comes to mind.))

TODO: Currently search is always performed when RETURN/ENTER keys are pressed, 
and this is wrong when the incremental searching is active (becomes like find 
next). A possible fix is comparing the potential pattern to that in the 
regex.

In addition, I have made this small improvement: When searching incrementally 
and you get no match, the non-matching string is selected in the pattern 
entry, so that you just overwrite it with the next keypress.

Happy searching :-)

I *mean* it -- go ahead and beat away on it! And don't forget to post your 
experiences and comments.
-- 
Anders

www: http://www.alweb.dk
jabber: anderslund@jabber.dk
_______________________________________________
KWrite-Devel mailing list
KWrite-Devel@kde.org
https://mail.kde.org/mailman/listinfo/kwrite-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic