Topic: Search and Replace dialog (1 of 9), Read 28 times
Conf: Search and Replace
From: Ian Binnie
Date: Monday, April 30, 2007 03:45 AM

I often find myself highlighting a string in a file, then

I enter the "replacement string", but only have options for "Next" or "Previous".
I can easily step through the file, selectively replacing strings, but there is NO option to replace the initial string, which is skipped.

In practice I step to the end of the file, then repeat the search with "Previous", until I get back to the starting point.

It would be so much more convenient if there was a "Current then Next" option.

 


Topic: Search and Replace dialog (2 of 9), Read 28 times
Conf: Search and Replace
From: Pauli Lindgren
Date: Monday, April 30, 2007 04:49 AM

On 4/30/2007 3:45:10 AM, Ian Binnie wrote:
>
>In practice I step to the end of the file, then repeat the
>search with "Previous", until I get back to the starting
>point.

I usually do so that, after I have reached end of file, I press Ctrl-Home to go to the beginning of file, then continue the replace with F3. When the last item is found, I am back to where I began.

>
>It would be so much more convenient if there was a
>"Current then Next" option.

Do you mean an extra button?
Maybe a checkbox for "Start from current" would be better.
However, I would prefer a checkbox "wrap around".
Of course, both of them could be added.

--
Pauli

 


Topic: Search and Replace dialog (7 of 9), Read 27 times
Conf: Search and Replace
From: Ian Binnie
Date: Wednesday, May 02, 2007 08:10 PM

On 4/30/2007 4:49:03 AM, Pauli Lindgren wrote:
>On 4/30/2007 3:45:10 AM, Ian Binnie
>wrote:
>>
>>In practice I step to the end of the file, then repeat the
>>search with "Previous", until I get back to the starting
>>point.
>
>I usually do so that, after I have
>reached end of file, I press Ctrl-Home
>to go to the beginning of file, then
>continue the replace with F3. When the
>last item is found, I am back to where I
>began.
>
>>
>>It would be so much more convenient if there was a
>>"Current then Next" option.
>
>Do you mean an extra button?
>Maybe a checkbox for "Start from
>current" would be better.
>However, I would prefer a checkbox "wrap
>around".
>Of course, both of them could be added.
>
>--
>Pauli

A checkbox for "Start from current" would be OK.

"wrap around" would not work for what I have in mind. I always go back, because I am working in a limited scope (often on a function I have copied from elsewhere).

Previous has the advantage of returning you to your start point.

If I was sure I wanted to replace all, it wouldn't be a problem.

 


Topic: Re: Search and Replace dialog (3 of 9), Read 26 times
Conf: Search and Replace
From: Christian Ziemski
Date: Monday, April 30, 2007 03:03 PM

On Mon, 30 Apr 2007 03:45:00 -0400, Ian Binnie wrote:

>I often find myself highlighting a string in a file, then
>
>I enter the "replacement string", but only have options for
>"Next" or "Previous".
>I can easily step through the file, selectively replacing strings,
>but there is NO option to replace the initial string, which is skipped.


What about this to improve that inconvenient behaviour:

In the case that the highlighted block is smaller than nn characters
and therefore is treated as the string to search for/replace
the cursor position should be automatically set to the (normalized)
Block_Begin when pressing "Next" and the Block_End when pressing
"Previous".

This way the highlighted string should be always included in the
search/replace and there are no additional buttons or options needed.


On Mon, 30 Apr 2007 04:49:00 -0400, Pauli Lindgren wrote:

>However, I would prefer a checkbox "wrap around".

As config option I would like that too.


Christian

 


Topic: Re: Search and Replace dialog (4 of 9), Read 28 times
Conf: Search and Replace
From: Ted Green
Date: Monday, April 30, 2007 04:24 PM

I will reply next week.
We are moving to a new, bigger office this week. (About 8000sqft, 900mm)
Ted.

 


Topic: Re: Search and Replace dialog (5 of 9), Read 28 times
Conf: Search and Replace
From: Pauli Lindgren
Date: Wednesday, May 02, 2007 11:49 AM

On 4/30/2007 3:03:18 PM, Christian Ziemski wrote:
>
>This way the highlighted string should
>be always included in the
>search/replace and there are no
>additional buttons or options needed.

This would not be good idea for Search. If you are searching a highlighted word, you do not want to find the word you have already highlighted. In practice, this would look like the search didn't work at all.

If this would be implemented in Replace only, then the Search and Replace would not work the same way, which may cause confusion. But maybe that is not a problem, I don't know.


>
>>However, I would prefer a checkbox "wrap around".
>
>As config option I would like that too.

If that feature is added as config option, it should be in the dialog box, too. Otherwise you would never know what the search/replace is actually doing. And the need for this setting depends on what you are searching, just like the other search options. It would be too difficult to change it from Config all the time.

Some programs (such as Netscape) do have the "wrap around" checkbox in Search dialog.

--
Pauli

 


Topic: Re: Search and Replace dialog (6 of 9), Read 29 times
Conf: Search and Replace
From: Christian Ziemski
Date: Wednesday, May 02, 2007 01:22 PM

On Wed, 02 May 2007 11:49:00 -0400, Pauli Lindgren wrote:

>On 4/30/2007 3:03:18 PM, Christian Ziemski wrote:
>>
>>This way the highlighted string should
>>be always included in the
>>search/replace and there are no
>>additional buttons or options needed.
>
>This would not be good idea for Search. If you are searching a highlighted
>word, you do not want to find the word you have already highlighted. In
>practice, this would look like the search didn't work at all.

Oops, yes, You are correct.

>If this would be implemented in Replace only, then the Search and Replace would
>not work the same way, which may cause confusion. But maybe that is not a
>problem, I don't know.

There seems to be some place for discussions about pros and cons. ;-)


>>>However, I would prefer a checkbox "wrap around".
>>
>>As config option I would like that too.
>
>If that feature is added as config option, it should be in the dialog box, too.

The combination may be the best: The default is set by config option
and may be changed in every search dialog for that single run.


BTW: Introducing "wrapping" would have heavy influence on the macro
commands Search() and Replace() and their return codes too.
I'm afraid that would be not an easy change.


Christian

 


Topic: Re: Search and Replace dialog (8 of 9), Read 28 times
Conf: Search and Replace
From: Pauli Lindgren
Date: Thursday, May 03, 2007 11:39 AM

On 5/2/2007 1:22:38 PM, Christian Ziemski wrote:
>
>BTW: Introducing "wrapping" would have heavy influence on the macro
>commands Search() and Replace() and their return codes too.
>I'm afraid that would be not an easy change.

I don't think it would be necessary to implement wrapping option in macro language at all. It can always be done with few commands anyway.
Adding "wrap around" option in search dialog does not require any changes in macro language.

--
Pauli

 


Topic: Re: Search and Replace dialog (9 of 9), Read 29 times
Conf: Search and Replace
From: Christian Ziemski
Date: Thursday, May 03, 2007 03:46 PM

On Thu, 03 May 2007 11:39:00 -0400, Pauli Lindgren wrote:

>On 5/2/2007 1:22:38 PM, Christian Ziemski wrote:
>>
>>BTW: Introducing "wrapping" would have heavy influence on the macro
>>commands Search() and Replace() and their return codes too.
>>I'm afraid that would be not an easy change.
>
>I don't think it would be necessary to implement wrapping option in macro
>language at all. It can always be done with few commands anyway.
>Adding "wrap around" option in search dialog does not require any changes in
>macro language.

I don't know how the search dialog is implemented internally. I
thought it's simply an input dialog for the macro commands Search()
and Replace(). Therefore my sentence above.

Let's wait for Ted's reply next week - when his office' move is
finished.

Christian