[PB IDE 4.50] Block-select find/replace selection
[PB IDE 4.50] Block-select find/replace selection
If I select a block of text in the PB IDE using Ctrl-Alt, then choose to do a Find/Replace in that block of text with the Search Inside selection only, I expected only that text inside the text block to be changed. However the PB IDE is changing all the matching characters on the entire selected lines, not limiting itself to within the selected text block only.
Re: [PB IDE 4.50] Block-select find/replace selection
Window - Find/Replace
[x] Search inside Selection only
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and more ― Typeface - Sprite-based font include/module
Lizard - Script language for symbolic calculations and more ― Typeface - Sprite-based font include/module
Re: [PB IDE 4.50] Block-select find/replace selection
I don't follow what you're saying?STARGÅTE wrote:Window - Find/Replace[x] Search inside Selection only
Re: [PB IDE 4.50] Block-select find/replace selection
Hi USCode,
STARGÅTE only kind of asked you, if you might have missed to check the checkbox
inside selection only
on the search/replace GUI.
greetings ~ Vera
STARGÅTE only kind of asked you, if you might have missed to check the checkbox
inside selection only
on the search/replace GUI.
greetings ~ Vera
Two growing code-collections: WinApi-Lib by RSBasic ~ LinuxAPI-Lib by Omi
Missing a download-file on the forums? ~ check out this backup page.
Missing a download-file on the forums? ~ check out this backup page.
Re: [PB IDE 4.50] Block-select find/replace selection
I mentioned it in my original post but I guess not very clearly. Yep, I have "Search inside selection only" checked.Vera wrote:Hi USCode,
STARGÅTE only kind of asked you, if you might have missed to check the checkbox
inside selection only
on the search/replace GUI.
greetings ~ Vera
Otherwise it would perform the search/replace throughout the entire file.
The problem here is it is doing the search/replace on the entire lines I have selected but it should only be doing it in the actual (ctrl-alt) text block I have selected.
Re: [PB IDE 4.50] Block-select find/replace selection
@USCode: You should provide reproducible steps to show it,
as I have been unable to see the problem when replacing the
text "th" in the below code. Works fine for me.
In my testing of the above, both commented lines do NOT have
"th" replaced at all. Only the selected lines in the middle (lines
2, 3 and 4) have "th" replaced. I even tried a vertical block
selection (holding down Alt while selecting with the mouse)
and it still worked as expected.
as I have been unable to see the problem when replacing the
text "th" in the below code. Works fine for me.
Code: Select all
path="C:\" ; Unselected.
a$="this is a test"
thick=1
i=CreateImage(thick,640,480)
th=999 ; Also unselected.
"th" replaced at all. Only the selected lines in the middle (lines
2, 3 and 4) have "th" replaced. I even tried a vertical block
selection (holding down Alt while selecting with the mouse)
and it still worked as expected.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
"PureBasic won't be object oriented, period" - Fred.
Re: [PB IDE 4.50] Block-select find/replace selection
PB you're right, I need to provide a clear example as this is rather rare corner case but sometimes it can be useful when using block-select.PB wrote:@USCode: You should provide reproducible steps to show it ...
For example, here's a screenshot of a section of spaces block-selected:
In the example above after hitting "Replace All" you would expect all the blanks selected in the code block to be changed to *, but this is what happens:
Not really a good real-world example but it gets the idea across. In the past with other editors I've normally used this block-text find/replace feature to generate sample text data by using the editor. Bottom-line, the editor should only be performing the find/replace inside the selected area.
HTH in understanding the issue.
Re: [PB IDE 4.50] Block-select find/replace selection
Hello USCode,
now with the closer infos I could check what you meant far better and found out it's the same on Win as on Linux, and it also occurs in former versions.
After testing a lot of possibilities I found out in the end it is due to the cursor's start and endposition and not to the 'selected' (highlighted) text.
The first image shows the selected text for all 4 possible ways of marking a block and below the two corresponding results:
1 - downwards to left (behind)
1 - upwards to right (ahead)
2 - upwards to left (behind)
2 - downwards to right (ahead)
The second image shows that a block-selection beyond text of the same length can only be done by one way (backwards) and here the result is even more obvious.
It's kind of true that only the selected text is taken for search and replace - but the marking points are obtained by the cursors positions.
Still this is very missleading compared to e.g. copy / paste actions with selected blocks and may lead to corrupting the code if you're not aware of it.
So it should at least be mentioned in the IDE handling description unless it cannot be changed to an expected behaviour.
greetings ~ Vera
now with the closer infos I could check what you meant far better and found out it's the same on Win as on Linux, and it also occurs in former versions.
After testing a lot of possibilities I found out in the end it is due to the cursor's start and endposition and not to the 'selected' (highlighted) text.
The first image shows the selected text for all 4 possible ways of marking a block and below the two corresponding results:
1 - downwards to left (behind)
1 - upwards to right (ahead)
2 - upwards to left (behind)
2 - downwards to right (ahead)
The second image shows that a block-selection beyond text of the same length can only be done by one way (backwards) and here the result is even more obvious.
It's kind of true that only the selected text is taken for search and replace - but the marking points are obtained by the cursors positions.
Still this is very missleading compared to e.g. copy / paste actions with selected blocks and may lead to corrupting the code if you're not aware of it.
So it should at least be mentioned in the IDE handling description unless it cannot be changed to an expected behaviour.
greetings ~ Vera
Two growing code-collections: WinApi-Lib by RSBasic ~ LinuxAPI-Lib by Omi
Missing a download-file on the forums? ~ check out this backup page.
Missing a download-file on the forums? ~ check out this backup page.