Author Topic: Incremental Search  (Read 40235 times)

Offline colski

  • Single posting newcomer
  • *
  • Posts: 4
Incremental Search
« on: September 30, 2008, 02:23:15 pm »
Unless I've missed something, CB is still lacking incremental search.

Please consider this, I use it all the time and it's hard to be without.

colski

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Incremental Search
« Reply #1 on: September 30, 2008, 03:06:41 pm »
Unless I've missed something, CB is still lacking incremental search.
It never did. Just hit "F3" to continue searching the term from the last position.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline colski

  • Single posting newcomer
  • *
  • Posts: 4
Re: Incremental Search
« Reply #2 on: September 30, 2008, 03:14:18 pm »
That's not incremental search, you're describing repeat search.

Incremental search means that the search is performed as you type the keys.

In VC++, for example, Ctrl+I begins incremental search. Then key 's' would search forward to the first instance of 's', then 'e' would search forward to the first instance of 'se' and so on. F3 would then find the next instance.

Seeing the results as you type is the major benefit. You can stop typing as soon as you've found what you want, or discover that there are no matches much faster.

When performing incremental search, the backspace key should remove the last character from the search string, not delete the selection.

colski

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Incremental Search
« Reply #3 on: September 30, 2008, 03:19:53 pm »
That's not incremental search, you're describing repeat search.
Although I don't see any major benefit in this search method you might want to try the ThreadSearch plugin. It does not do the incremental stuff but has similar features. Probably you can enhance it in a way that it would work as you like.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline colski

  • Single posting newcomer
  • *
  • Posts: 4
Re: Incremental Search
« Reply #4 on: September 30, 2008, 04:03:16 pm »
The benefit is obvious to me, since I use it all the time.

Let me see if I can make a convincing argument to you. Incremental search is the search method in firefox and chrome, vc++, emacs and eclipse; whereas the dialog box is the search method in Code::Blocks and internet explorer.

I guess that threadsearch has done most of the work (ie, a non-modal input). It's not in my build, so I'll have to investigate that. Perhaps someone who knows the code base will read this and think it's worth doing.

colski

mariocup

  • Guest
Re: Incremental Search
« Reply #5 on: September 30, 2008, 04:17:14 pm »
Hi,

I agree that the ThreadSearch is a great plug-in for searching strings, but an incremental search would be nice. For example if you use Firefox and use the search shortcut the focus is put in a search command line where you type your search string. The advantage is that the editor/browser view remains visible and you do not have a search window that pops up. I think that together with the highlight occurrence feature the incremental search would be cool in Code::Blocks. The incremental search could also have a scope like: search in current file or search in all opened files.

Bye,

Mario


Offline dje

  • Lives here!
  • ****
  • Posts: 683
Re: Incremental Search
« Reply #6 on: September 30, 2008, 05:01:26 pm »
It is true that going from Firefox incremental search to IE modal popup is quite disgusting.
I find this feature nice even if not absolutely required.

I'm not sure it would be a good idea to implement it in ThreadSearch plugin, because (I have to check but) I think, files are searched in file path or file name ascending order, not by active or open.

Don't also forget than when a search is running, the text box is disabled... and you need to stop it before edition.

Dje

Offline Barking_Mad

  • Multiple posting newcomer
  • *
  • Posts: 47
Re: Incremental Search
« Reply #7 on: October 02, 2008, 04:20:23 pm »
That's not incremental search, you're describing repeat search.
Although I don't see any major benefit in this search method you might want to try the ThreadSearch plugin. It does not do the incremental stuff but has similar features. Probably you can enhance it in a way that it would work as you like.

If its not incremental, its excremental :P

This would be something that falls under the remit of code completion, id expect it a requirement for good code completion to also include incremental search, so hopefully it will be included when the CC is done.
WooF! WooF! - Ubuntu 8.10 & CB 5432 & GCC 4.3.2
To see the world in a grain of sand and heaven in a wild flower
To hold infinity in the palm of your hand and eternity in an hour - W.B

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Incremental Search
« Reply #8 on: October 02, 2008, 04:57:01 pm »
This would be something that falls under the remit of code completion, id expect it a requirement for good code completion to also include incremental search, so hopefully it will be included when the CC is done.

I don't think that it's really needed for that.

Incremental search for one file is easy to implement.
In fact I just created this as plugin (with a really ugly modal dialog at the moment).
It might be a better idea to use a toolbar instead, but that's another thing (and I might work on it the next days).

I'm not sure if incremental search in more then one file is really needed.
I think that's something ThreadSearch-plugin can do better (even if it not searches incremental).

mariocup

  • Guest
Re: Incremental Search
« Reply #9 on: October 02, 2008, 09:14:03 pm »
Hi jens,

I agree that incremental search for one file is better then in all opened files. I think a search bar with the options like Firefox 3 would be sufficient.

Bye,

Mario

Offline Barking_Mad

  • Multiple posting newcomer
  • *
  • Posts: 47
Re: Incremental Search
« Reply #10 on: October 03, 2008, 03:13:40 pm »

I don't think that it's really needed for that.

Incremental search for one file is easy to implement.
In fact I just created this as plugin (with a really ugly modal dialog at the moment).
It might be a better idea to use a toolbar instead, but that's another thing (and I might work on it the next days).

I'm not sure if incremental search in more then one file is really needed.
I think that's something ThreadSearch-plugin can do better (even if it not searches incremental).


I have been researching code completion recently, incremental search methods are certainly one of the best methods for parsing user input for code completion as far as i can see.

Just type into the google chrome Ctrl-F search or google search bar to see why, they know a thing or two about search, its one of the best methods for reducing solution sets in realtime for Function lists and the autocomplete method afaik.

If you want ill post my notes, which are incomplete at the moment so id rather not.

For one reason why i believe its superior, see this comment: http://forums.codeblocks.org/index.php/topic,8346.msg61758.html#msg61758

Resolving to individual symbols on input is afaik best done incrementally.
« Last Edit: October 03, 2008, 03:29:18 pm by Barking_Mad »
WooF! WooF! - Ubuntu 8.10 & CB 5432 & GCC 4.3.2
To see the world in a grain of sand and heaven in a wild flower
To hold infinity in the palm of your hand and eternity in an hour - W.B

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Incremental Search
« Reply #11 on: October 03, 2008, 03:35:53 pm »
Incremental search for one file is easy to implement.
In fact I just created this as plugin (with a really ugly modal dialog at the moment).
It might be a better idea to use a toolbar instead, but that's another thing (and I might work on it the next days).
The already implemented "show occurences" feature does just that. It's hard/impossible to implement it properly for all project files though, due to the sheer (im)possible number of files and hits. Imagine a project with 15,000 files.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Incremental Search
« Reply #12 on: October 07, 2008, 11:57:57 am »
I created a plugin that does incremental search from a toolbar.

You can download the sorces from http://apt.jenslody.de/patches/IncrementalSearch_0.2.tar.bz2.

The archive contains the folder "IncrementalSearch", that has to be copied to "src/plugins/contrib", and a patch file for the contrib-plugins workspace and the autoconf-files.
The patch is against svn r5243.

It works, without conflicting with Highlight occurences.
The only thing I really don't like is that the highlighting (as with Highlight occurences) is not really colourful.

If anybody can test it and give a feedback, I would be glad.


Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Incremental Search
« Reply #13 on: October 07, 2008, 02:42:07 pm »
I created a plugin that does incremental search from a toolbar.

...

If anybody can test it and give a feedback, I would be glad.

Looks good, though highlighting didn't work for me at all.
Be patient!
This bug will be fixed soon...

mariocup

  • Guest
Re: Incremental Search
« Reply #14 on: October 07, 2008, 04:01:19 pm »
Hi jens,

I tried it on windows and that is exactly how incremental search should look like :D. Nice job.

The hint for "Select only" should be changed to "Selected text" to be consistent with the search dialogue. The highlight colour is very decent, so it is not easy to see the highlighting on a laptop screen, perhaps it should be customizable.

Thx to jens.

Mario