Bug 342334 - [client] Should "Find Next" use the current selection?
Summary: [client] Should "Find Next" use the current selection?
Status: RESOLVED FIXED
Alias: None
Product: Orion (Archived)
Classification: ECD
Component: Client (show other bugs)
Version: 0.2   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 0.2   Edit
Assignee: Susan McCourt CLA
QA Contact:
URL:
Whiteboard:
Keywords: polish
Depends on:
Blocks:
 
Reported: 2011-04-08 16:35 EDT by Mark Macdonald CLA
Modified: 2011-09-01 11:41 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Macdonald CLA 2011-04-08 16:35:13 EDT
Orion 0.2 M6

1. Open a file in coding.html
2. Press Ctrl+F, and search for something that has several occurrences (eg. "foo")
3. Now select something else in the editor (eg. "bar")
4. Press Ctrl+K (Find Next)
5. The next occurrence of "foo" is shown, not "bar".

This works differently from the desktop Eclipse editor, where changing the selection affects what will be searched for. I found the Orion editor's behavior surprising.
Comment 1 Susan McCourt CLA 2011-04-25 12:29:05 EDT
fixed.
Note that I did not change the modal nature of the regexp mode.  If you are finding next/previous with a saved regexp pattern, the selection won't alter the mode.  This is because:
- I don't use the regexp mode and I'm not sure what the user expectation is
- I'll err on the side of simplicity for now.  (We could check the selection against a stored pattern to determine whether we should stay in pattern mode or are in a different mode)
Comment 2 Mark Macdonald CLA 2011-05-06 12:23:31 EDT
Reopening because this doesn't behave very well with a case-insensitive search.

My buffer looks like this:
> var Foo;
> // foo
> // Foo

1. Starting from line 1, press Ctrl+F and search for "foo". (Note that this is a case insensitive search)
2. You'll get the match "Foo" on line 1.
3. Press Ctrl+K. You'll get the match "Foo" on line 3. 

Instead I expected it to match "foo" on line 2. It seems that once you hit a match that differs in case, it starts searching for a case-exact match from then on. Since I didn't change the selection myself, I expected it to continue searching case-insensitively.
Comment 3 Mark Macdonald CLA 2011-05-06 12:24:13 EDT
(In reply to comment #2)
> 2. You'll get the match "Foo" on line 1.

Sorry, that should say
> 2. You'll get the match "foo" on line 1.
Comment 4 Mark Macdonald CLA 2011-05-06 12:25:03 EDT
(In reply to comment #3)
Wait, no it shouldn't. Ignore Comment #3. I wish Bugzilla had an "Edit" button :-/
Comment 5 Susan McCourt CLA 2011-05-12 12:42:05 EDT
I'll make a quick fix to be case insensitive and leave it to bug 345033 to give user options.
Comment 6 Susan McCourt CLA 2011-05-19 18:53:09 EDT
fixed.
We were inferring case sensitivity based on whether the user had typed with case.  (Infer that case matters if they do).

But...for the case where we enter find next/find previous and we're not already in incremental search mode, we can't rely on the presence of mixed case to infer that case matters.  It could have been typed in a dialog or could have been simply selected.

This means we're a little inconsistent in how we infer case, but I think this is better.  We can let the user have a say in bug 345033