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

Bug 410394

Summary: Find toolbar is in a bad state
Product: [ECD] Orion Reporter: Mark Macdonald <mamacdon>
Component: EditorAssignee: Bogdan Gheorghe <gheorghe>
Status: RESOLVED FIXED QA Contact:
Severity: critical    
Priority: P3 CC: gheorghe, libingw, Silenio_Quarti
Version: 3.0   
Target Milestone: 3.0 RC2   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Mark Macdonald CLA 2013-06-10 18:07:46 EDT
I just pulled and the Find feature is not working at all. 

1. Open the Orion editor on a large file (eg. textView.js). Your editing caret is at index 0.
2. Press Ctrl+F to open the find toolbar. 
3. Type a query that will match something (for example "v")
4. I get "Not Found".

If I move the editing caret to a different index before I open the Find toolbar, I can sometimes see results highlighted as annotations. But when I click Next or Previous to step through the results, I immediately get "Not Found" and the annotations disappear.

Sometimes the annotations are shown over areas of text that are not matches at all. 

I also get DOM exceptions when I press ESC to close the Find toolbar:

> Uncaught Error: IndexSizeError: DOM Exception 1     textView.js:5743
>    TextView._setDOMSelection textView.js:5743
>   TextView._updateDOMSelection textView.js:6282
>   TextView._update textView.js:6600
>   (anonymous function) textView.js:5498
Comment 1 libing wang CLA 2013-06-11 16:12:14 EDT
I quickly debugged with a simple text, something like 
aaa
bbb
ccc
aaa
bbb
ccc

Even for that the textModel.find() function does not give back a correct answer.
Comment 2 Bogdan Gheorghe CLA 2013-06-11 16:33:13 EDT
Fixed in master. Please give it a try - (we weren't getting the DOM exception).
Comment 3 libing wang CLA 2013-06-12 08:24:55 EDT
(In reply to comment #2)
> Fixed in master. Please give it a try - (we weren't getting the DOM
> exception).

Pulled and tried. It looks good now.
But I have something minor:
1.When I use "find next", looks to me all the occurrence is blinking. Is this work as design?

2.If you use "find next" in a file and click on the side bar to select another file. The caret state kind of stays in the previous file. That says:
In file A, I searched "foo" and "find next" brings the caret to line 100, for example. Then I selected file B, the caret is blinking at the start of the file but when I do search, it highlights all the occurrence but put the current hit beyond line 100.
Comment 4 Silenio Quarti CLA 2013-06-12 10:32:55 EDT
(In reply to comment #3)
> (In reply to comment #2)
> > Fixed in master. Please give it a try - (we weren't getting the DOM
> > exception).
> 
> Pulled and tried. It looks good now.
> But I have something minor:
> 1.When I use "find next", looks to me all the occurrence is blinking. Is
> this work as design?

This was not intended. Fixed with:

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

> 2.If you use "find next" in a file and click on the side bar to select
> another file. The caret state kind of stays in the previous file. That says:
> In file A, I searched "foo" and "find next" brings the caret to line 100,
> for example. Then I selected file B, the caret is blinking at the start of
> the file but when I do search, it highlights all the occurrence but put the
> current hit beyond line 100.

I am not able to reproduce this one with the latest code. Please let me know if you still can reproduce it.