Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2016-04

Search dialog scope

14 messages · 7 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Michael Van Canneyt

Hello,

Did something change in the search(&replace) dialog scope handling ?

Since some time, I must alwas set the scope to "selection", and the origin to 'beginning' manually. No matter where my cursor is.

I am pretty sure that before, if there is a nonempty selection, the dialog would set these settings correct for me.

Did something change in this regard ?
What is the 'rule' that is followed by the dialog ?

If something changed, can we please get the old behaviour back somehow ?

(this is since some time, but I verified with yesterday's version)

Michael.

Reply by email

Ondrej Pokorny
to Michael Van Canneyt
Michael Van Canneyt wrote
Did something change in the search(&replace) dialog scope handling ?

I changed it a little bit to match Delphi's behavior. The reason is described here: http://mantis.freepascal.org/view.php?id=27039

Since some time, I must alwas set the scope to "selection", and the origin to 'beginning' manually. No matter where my cursor is.

Strange.

I am pretty sure that before, if there is a nonempty selection, the dialog would set these settings correct for me.

Yes, I remember that I changed the behavior so that scope is "selection" and origin "from the beginning" if there is a selection in the editor. So exactly what you want to achieve.

Did something change in this regard ? What is the 'rule' that is followed by the dialog ? If something changed, can we please get the old behaviour back somehow ?

Hmmm, for me it works exactly what you want to have (I changed to this desired behavior).

Can you be more specific about what you are doing and what the IDE does?

Ondrej

Reply by email

Martok
to Michael Van Canneyt: Did something change in the search(&replace) dialog scope handling ? Since some time, I…

Hello,

Show quoted text 5 lines
Since some time, I must alwas set the scope to "selection", and the origin to 'beginning' manually. No matter where my cursor is. I am pretty sure that before, if there is a nonempty selection, the dialog would set these settings correct for me.

I can confirm this behaviour, and also that it confused the hell out of me when it first appeared, but I just thought I was being stupid.

Just did a bit of testing, and it seems everything works fine (sets From Start/Selected) if the selection is on a single line only. Have more than one line selected, and From Cursor/Global is set.

Regards,

Martok

Reply by email

Michael Van Canneyt
to Ondrej Pokorny: I changed it a little bit to match Delphi's behavior. The reason is described here:…
Ondrej Pokorny wrote 19 lines
On 07.04.2016 9:34, Michael Van Canneyt wrote: > Did something change in the search(&replace) dialog scope handling ? I changed it a little bit to match Delphi's behavior. The reason is described here: http://mantis.freepascal.org/view.php?id=27039 > Since some time, I must alwas set the scope to "selection", and the origin > to > 'beginning' manually. No matter where my cursor is. Strange. > I am pretty sure that before, if there is a nonempty selection, the dialog > would set these settings correct for me. Yes, I remember that I changed the behavior so that scope is "selection" and origin "from the beginning" if there is a selection in the editor. So exactly what you want to achieve.

But the dialog's behaviour has always been 'as in delphi' (or at least as long as I remember) so I don't understand what you changed or why you thought it was necessary ?

Show quoted text 8 lines
> Did something change in this regard ? What is the 'rule' that is followed > by the dialog ? > > If something changed, can we please get the old behaviour back somehow ? Hmmm, for me it works exactly what you want to have (I changed to this desired behavior).

Well. You definitely broke it, from my point of view. It used to work correct :)

Can you be more specific about what you are doing and what the IDE does?

- Select 5 lines. (it could be 10) (shift-down, 5 times)
- Press ctrl-q a (classic shortcut for search & replace.)
- Dialog opens.
Scope: global
Origin: from cursor.
Just tested (again).

Tried again, but select five lines with shift-up.
So the cursor is at the start of the selection.
Same result.

I undid your revision, and then it works correct:

Dialog opens,
scope: selected text,
origin: from cursor.

Michael.

Reply by email

Michael Van Canneyt
to Martok: I can confirm this behaviour, and also that it confused the hell out of me when it first…
Martok wrote 13 lines
Hello, > Since some time, I must alwas set the scope to "selection", and the origin to > 'beginning' manually. No matter where my cursor is. > > I am pretty sure that before, if there is a nonempty selection, the dialog > would set these settings correct for me. I can confirm this behaviour, and also that it confused the hell out of me when it first appeared, but I just thought I was being stupid. Just did a bit of testing, and it seems everything works fine (sets From Start/Selected) if the selection is on a single line only. Have more than one line selected, and From Cursor/Global is set.

Phew !!

I thought I was being stupid too, but I am not alone :)

Michael.

Reply by email

Ondrej Pokorny
to Michael Van Canneyt: But the dialog's behaviour has always been 'as in delphi' (or at least as long as I…
Michael Van Canneyt wrote
But the dialog's behaviour has always been 'as in delphi' (or at least as long as I remember)

No, it wasn't.

so I don't understand what you changed or why you thought it was necessary ?

Read the issue report. Lazarus picked scope "from cursor" when executing search on a selection. Delphi picks up "from beginning" in this case.

Well. You definitely broke it, from my point of view. It used to work correct :)

Well yes, if you search with single-line selection, it works as expected (I fixed this). I forgot to test multi line selection. I'll fix that as well.

Show quoted text 9 lines
Tried again, but select five lines with shift-up. So the cursor is at the start of the selection. Same result. I undid your revision, and then it works correct: Dialog opens, scope: selected text, origin: from cursor.

Exactly this is wrong behavior what I wanted to fix. It should be scope: selected text,
*origin: from beginning.*
Because if you select with shift-down, you get nothing in the search.

Lazarus does it correctly after r51697 for single line selection but not multi-line. I'll fix it.

Ondrej
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20160407/bb4dc610/attachment.html>

Reply by email

Ondrej Pokorny
to Michael Van Canneyt: Did something change in the search(&replace) dialog scope handling ? Since some time, I…

I fixed it in r52143. But the behavior is not like it was before. It's now: scope: selected text,
*origin: from beginning.*
for search on selection.
(it was
scope: selected text,
origin: from cursor.
before).

Please test, it should fulfill your and my needs ;) Thanks for reporting!

Ondrej
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20160407/39b0feaf/attachment.html>

Reply by email

Zeljko
to Michael Van Canneyt: Did something change in the search(&replace) dialog scope handling ? Since some time, I…
Michael Van Canneyt wrote 18 lines
Hello, Did something change in the search(&replace) dialog scope handling ? Since some time, I must alwas set the scope to "selection", and the origin to 'beginning' manually. No matter where my cursor is. I am pretty sure that before, if there is a nonempty selection, the dialog would set these settings correct for me. Did something change in this regard ? What is the 'rule' that is followed by the dialog ? If something changed, can we please get the old behaviour back somehow ? (this is since some time, but I verified with yesterday's version)

Same thing is killing me. Always have to check "Selection" manually :(

zeljko

Reply by email

Michael Van Canneyt
to Ondrej Pokorny: I fixed it in r52143. But the behavior is not like it was before. It's now: *origin: from…
Ondrej Pokorny wrote 10 lines
I fixed it in r52143. But the behavior is not like it was before. It's now: scope: selected text, *origin: from beginning.* for search on selection. (it was scope: selected text, origin: from cursor. before). Please test, it should fulfill your and my needs ;) Thanks for reporting!

Yay !

It works correctly now, thank you very much for the quick fix !!

Michael.

Reply by email

Sven Barth
to Graeme Geldenhuys

Am 07.04.2016 17:18 schrieb "Graeme Geldenhuys" <

: On 2016-04-07 10:43, Ondrej Pokorny wrote: >> > But the dialog's behaviour has always been 'as in delphi' (or at

least

Show quoted text 7 lines
>> > as long as I remember) > No, it wasn't. > Since when is Lazarus design goal now "Delphi IDE compatible"? The LCL yes, the IDE no!

The linked report also mentions other editors, so it's more like "common sense compatible" than "Delphi compatible" ;)

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20160407/3942c879/attachment.html>

Reply by email

Ondrej Pokorny
to Graeme Geldenhuys: Since when is Lazarus design goal now "Delphi IDE compatible"? The LCL yes, the IDE no!…
Graeme Geldenhuys wrote 8 lines
On 2016-04-07 10:43, Ondrej Pokorny wrote: >>> But the dialog's behaviour has always been 'as in delphi' (or at least >>> as long as I remember) > No, it wasn't. > Since when is Lazarus design goal now "Delphi IDE compatible"? The LCL yes, the IDE no!

At some places the Lazarus IDE has to be Delphi-compatible. E.g. another place is that the text is inserted into the IDE editor with a keyboard and it prints its contents on the screen. I hope you are not against this compatibility :P
We are really not your enemies, Graeme.

Ondrej

Reply by email

Graeme Geldenhuys
to Ondrej Pokorny
Ondrej Pokorny wrote
another place is that the text is inserted into the IDE editor with a keyboard

Oh wow - I haven't seen one of those in years. My computer uses mind control - I think of code and it appears (coffee is my fuel). ;-)

Regards,
- Graeme -

Reply by email

Unknown author
to Graeme Geldenhuys
Graeme Geldenhuys wrote 6 lines
On 2016-04-07 17:42, Ondrej Pokorny wrote: > another place is that the text is inserted into the IDE editor with a > keyboard Oh wow - I haven't seen one of those in years. My computer uses mind control - I think of code and it appears (coffee is my fuel). ;-)

ROTFL!

PS: you misspelled c0ffee ;) O:)

NOTE: No off-list assistance is given without prior approval. *Please keep mailing list traffic on the list* unless private contact is specifically requested and granted.

Reply by email