Bug 328460 - Go To next search result
Summary: Go To next search result
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 4.4   Edit
Hardware: PC All
: P3 normal with 12 votes (vote)
Target Milestone: ---   Edit
Assignee: Platform-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: bugday, helpwanted, noteworthy
: 566034 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-10-22 08:09 EDT by Paul Webster CLA
Modified: 2020-11-04 08:28 EST (History)
16 users (show)

See Also:


Attachments
next/previous search project (3.02 KB, application/octet-stream)
2010-10-22 08:09 EDT, Paul Webster CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Webster CLA 2010-10-22 08:09:29 EDT
Created attachment 181491 [details]
next/previous search project

CTRL+. and CTRL+, work in the search view, but not once the search view loses focus.

This is a simple experiment that will activate the search view, go to the next/previous item, and activate the editor.  By default it's bound to ALT+, and ALT+.

PW
Comment 1 Lars Vogel CLA 2010-10-24 15:07:06 EDT
+1 for having this in the standard platform
Comment 2 Paul Webster CLA 2010-10-25 07:30:17 EDT
I've checked this into CVS /cvsroot/eclipse:
platform-incubator/ui/other/org.eclipse.ui.navigate.search

PW
Comment 3 Eike Stepper CLA 2010-11-16 05:31:48 EST
+1 

I've wished this functionality a thousand times!
Comment 4 Eike Stepper CLA 2010-11-16 05:37:01 EST
BTW. is it somehow possible to create a new search result from the current error markers?
Comment 5 Sebastian Schär CLA 2010-11-16 05:45:47 EST
+1 for having this in the standard platform
Comment 6 Paul Webster CLA 2010-11-16 07:16:29 EST
(In reply to comment #4)
> BTW. is it somehow possible to create a new search result from the current
> error markers?

You mean taking a set of markers and then having the same information in the search view format, just like a search?  I don't think so.

But search is pluggable, someone could write that.

PW
Comment 7 Krzysztof Daniel CLA 2010-11-16 07:43:37 EST
*** Bug 330325 has been marked as a duplicate of this bug. ***
Comment 8 Dani Megert CLA 2010-11-16 07:46:46 EST
This is a good start. Could the mechanism be improved/generalized that the same thing works in the Problems view as well?
Comment 9 Dani Megert CLA 2010-11-16 07:54:39 EST
(In reply to comment #8)
> This is a good start. Could the mechanism be improved/generalized that the same
> thing works in the Problems view as well?
See bug 115202.

The general bug is bug 32330.
Comment 10 rakshit CLA 2010-11-16 09:46:16 EST
Also If you pin the search view then pressing the dedicated button should open the latest search view and start finding next
Comment 11 rakshit CLA 2010-11-16 09:50:42 EST
Also open in new tab must be there for search view
Comment 12 rakshit CLA 2010-11-16 09:51:49 EST
(In reply to comment #11)
> Also open in new tab must be there for search view

I mean in the preference page open in new tab once activated all subsequent search must open in new tabs
Comment 13 David M. Karr CLA 2010-11-16 12:05:10 EST
I now have this functionality by utilizing a saved keyboard macro with the
Emacs+ plugin.

I described this implementation at
<http://davidmichaelkarr.blogspot.com/2010/10/keyboard-nirvana-with-eclipse-and-emacs.html>.
Comment 14 Rupert Rawnsley CLA 2012-02-22 04:35:36 EST
+1 for having it as standard. This is the thing I miss most from Visual Studio.
Comment 15 David Rees CLA 2012-12-11 14:47:11 EST
When looking at this, please consider how to support this generally across markers and problems. Perhaps it could be the that the next/previous actions simply execute against the last active list view.
Comment 16 David Rees CLA 2012-12-11 14:48:20 EST
Also see this related StackOverflow asking how to do this (for markers in particular) - http://stackoverflow.com/questions/2329438/how-can-i-go-to-the-next-eclipse-marker-e-g-build-error-using-the-keyboard
Comment 17 Paul Webster CLA 2012-12-11 14:51:41 EST
If someone wants to adapt this so it can go into the Platform I'm willing to mentor them.

PW
Comment 18 Markus Keller CLA 2012-12-13 06:53:18 EST
See bug 115202 comment 13 for a general solution.
Comment 19 Lars Vogel CLA 2014-03-21 10:20:52 EDT
https://git.eclipse.org/r/23721
Comment 20 Lars Vogel CLA 2016-04-20 12:10:28 EDT
Mass move to 4.7 as M7 is approaching. Please move back in case you are planning to fix it for Neon.
Comment 21 Lars Vogel CLA 2020-08-13 05:55:47 EDT
*** Bug 566034 has been marked as a duplicate of this bug. ***
Comment 22 Dieter Mai CLA 2020-10-11 13:07:38 EDT
I had a look at how it currently works and how the requested feature could be implemented.

Currently:
- while the Search dialog is focused, it handles the event(ShowNextResultAction), by opening the file and focusing the editor to the search result.
- while the editor is focused, it handles the event (GotoAnnotationAction), by going to the next/prev annotation.
- if something else is selected, noting happens.

Possible solution:
- org.eclipse.ui.workbench.texteditor provides a new extension point: gotoConsumer.
- when the GotoAnnotationAction of the editor is triggered, it is first checked if an enabled gotoConsumer is registered. 
- if no, the event is handled like before.
- if yes, the event is delegated to the class defined in the gotoConsumer extension.
- org.eclipse.search needs to implement a gotoConsumer.
- org.eclipse.search should disable its gotoConsumer if there is no search or if the user deactivated this delegation.

All changes of this solution would be in eclipse.platform.text. This component of this ticket could changed to reflect this.
Comment 23 Lars Vogel CLA 2020-10-29 07:27:35 EDT
(In reply to Dieter Mai from comment #22)
> I had a look at how it currently works and how the requested feature could
> be implemented.


Great, thank you. Would be great to get a Gerrit from you for this feature.

> Currently:
> - while the Search dialog is focused, it handles the
> event(ShowNextResultAction), by opening the file and focusing the editor to
> the search result.
> - while the editor is focused, it handles the event (GotoAnnotationAction),
> by going to the next/prev annotation.
> - if something else is selected, noting happens.
> 
> Possible solution:
> - org.eclipse.ui.workbench.texteditor provides a new extension point:
> gotoConsumer.
> - when the GotoAnnotationAction of the editor is triggered, it is first
> checked if an enabled gotoConsumer is registered. 
> - if no, the event is handled like before.
> - if yes, the event is delegated to the class defined in the gotoConsumer
> extension.
> - org.eclipse.search needs to implement a gotoConsumer.
> - org.eclipse.search should disable its gotoConsumer if there is no search
> or if the user deactivated this delegation.

I assume this could be confusing, e.g., if the user triggered a search a while ago, it would still jump to the next result even if the user now works in the editor. I think Pauls suggestion to offer a new shortcut is less confusing. Maybe we just use a new keybinding for the next search result, as Paul did?


> All changes of this solution would be in eclipse.platform.text. This
> component of this ticket could changed to reflect this.

Done.
Comment 24 Eclipse Genie CLA 2020-11-04 08:28:57 EST
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.text/+/171742