Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 407446

Summary: Find toolbar broken after following search link
Product: [ECD] Orion Reporter: Mark Macdonald <mamacdon>
Component: ClientAssignee: Silenio Quarti <Silenio_Quarti>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: Silenio_Quarti
Version: 3.0   
Target Milestone: 3.0 M2   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Mark Macdonald CLA 2013-05-07 13:03:01 EDT
1. Search for 'setPageTarget' using the Search page
2. Assuming you have the Orion client source code checked out, you will see hits from globalCommands.js.
3. Expand globalCommands.js and click one of the hits inside the file.
4. You are taken to the editor page with a URL looking like this:
http://localhost:8080/edit/edit.html#/file/mamacdon/orion.client/bundles/org.eclipse.orion.client.ui/web/orion/globalCommands.js,find=setpagetarget,atLine=1019

5. Close the find toolbar that appears.
6. Press Ctrl+F. Nothing happens

The find toolbar is dead until you reload the page
Comment 1 Silenio Quarti CLA 2013-05-07 14:24:49 EDT
I believe this started happening when I moved the scrolling animation code from editor.js to textview.js.  In editorCommands.js#244, the toolbar is only built if the scrolling callback is called, but that does not happen if the offset is already visible.

editor.moveSelection(offset, offset, function(){
   self._localSearcher.buildToolBar(searchString, parsedParam.replaceWith);
   self._localSearcher.findNext(true);
}, focus);
Comment 2 Silenio Quarti CLA 2013-05-07 14:31:14 EDT
Hum, maybe this was broken already before my changes. It seems the previous code in Editor.moveSelection() did not call the callback either if the offset was already visible:

http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/bundles/org.eclipse.orion.client.editor/web/orion/editor/editor.js?id=9e2eb7cba595f19fbdd4dee90d11facc92d8bf2c
Comment 3 Silenio Quarti CLA 2013-05-08 17:10:00 EDT
Changed the behavior of textView.setSelection() and textView.setCaretOffset() to call the callback even if no scrolling happens.

http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=eeb68977640f7292c5c424839531f9d9c75fed62