Build 713: select one line is not taken as "Scope Selection"

Started by Stefan, September 05, 2009, 03:57:16 AM

Previous topic - Next topic

Stefan

Build 713: select one line is  not taken as "Scope Selection"

Scenario:
- i select an part of an line only
- i use Search and replace

Problem:
--> Scope is "Document" ?!  :o

Suggest:
The scope should be set to "Selection" here two.

Test:
The same for "Find".
No matter what selection mode is set.
If i select at least two lines then Scope is set to "Selection"
Stefan, HippoEDIT beta tester 
HippoEDIT - the editor programmers wants to code thyself when they are dreaming.        -Don't just edit. HippoEDIT!-

alex

Hello Stefan,

this is by design. The Scope of search is set to Selection only if you have multi-line selection in the document. If you select Selection by default also when single (or line part) selection exist, then very big probability that this is not that user wants. Imagine search for current word when it is only one in line.
In such cases decision is left to user, you can always switch to search scope you want.

Best regards,
Alex.
HippoEDIT team
[url="http://www.hippoedit.com/"]http://www.hippoedit.com/[/url]

Stefan

Hi Alex  ;D

I find this behaviour dangerous. Because:
I select an line and s&r not aware that scope is set to document
and so the whole document is s&r.
Maybe it replace only one more place down the code
so i am not aware what happens accidentally
and so had some additional hour to find the selfmade bug.



> Imagine search for current word when it is only one in line.
I don't understood, what means this?
Do you mean If i had select an word and want to search for this? (Changes i didn't get your logic fully)


I think it's better to make
your scenario (Imagine search for current word when it is only one in line.) fail
so user have to switch from scope selection to document by his own
what not brings data loose
rather then messing up my whole source code as it's now.


As far as i understood right now
it's that the user have to set the right scope
but in my logic it is only disturbing and in your logic it can mess up the document.
Sorry if i didn't get it  ;D
Stefan, HippoEDIT beta tester 
HippoEDIT - the editor programmers wants to code thyself when they are dreaming.        -Don't just edit. HippoEDIT!-

alex

Normally, if you select a text in the document and call Find Dialog, I need to understand what user wants: use text as search term or want to use selection as scope for search. The rule is, if multi-line selection is done, mostly user wants to search withing selection, in other case selected text used as search term and copied into Find What field. This is what I meant.

The same logic, used in Visual Studio. I have already adopted logic here several times and found the current as best compromise. And, sorry, would keep it like it is now ;)

With your example with Replace, this is always change of the current document and you have one Undo call to revert changes.

Best regards,
Alex.
HippoEDIT team
[url="http://www.hippoedit.com/"]http://www.hippoedit.com/[/url]

Stefan

O.K., you do more coding work then i, you should know it better, thanks for the explanation  :)
Stefan, HippoEDIT beta tester 
HippoEDIT - the editor programmers wants to code thyself when they are dreaming.        -Don't just edit. HippoEDIT!-