<div dir="ltr">I have made the patches for myself.<div><br></div><div>Please do what you like with them.</div><div><br></div><div>Thank you</div><div><br></div><div>Duilio.<div><br></div><div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Mar 16, 2021 at 9:42 PM Martin Frb via lazarus <<a href="mailto:lazarus@lists.lazarus-ide.org">lazarus@lists.lazarus-ide.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 15/03/2021 19:01, duilio foschi via lazarus wrote:<br>
><br>
> You will find a zip file at this link:<br>
> <a href="https://mega.nz/file/T85iARDY#kK9i6JbM-aDJfRafL5PMN2MenSfxJoK4Yg9tnVwGsTo" rel="noreferrer" target="_blank">https://mega.nz/file/T85iARDY#kK9i6JbM-aDJfRafL5PMN2MenSfxJoK4Yg9tnVwGsTo</a> <br>
> <<a href="https://mega.nz/file/T85iARDY#kK9i6JbM-aDJfRafL5PMN2MenSfxJoK4Yg9tnVwGsTo" rel="noreferrer" target="_blank">https://mega.nz/file/T85iARDY#kK9i6JbM-aDJfRafL5PMN2MenSfxJoK4Yg9tnVwGsTo</a>><br>
><br>
> The zip file contains:<br>
><br>
> 1. the corrected synedit.pp for Lazarus stable v. 2.0.12<br>
> 2. the corrected synedit.pp for Lazarus trunk v. 2.1.0<br>
> 3. the diff file for #1<br>
> 4. the diff file for #2<br>
><br>
> I am not accustomed to version control software.<br>
><br>
> Please feel free to use the attached fix in the way you like<br>
><br>
First of all, thanks for the patch.<br>
Please only sent patches, the full files are not needed (and quickly <br>
outdated in case of trunk).<br>
Ideally go to <a href="https://bugs.freepascal.org/" rel="noreferrer" target="_blank">https://bugs.freepascal.org/</a> register and submit your <br>
patch with a new issue. I can not always deal with patches immediately, <br>
and in my mail inbox they can get lost very quickly.<br>
Once you opened an issue, you can link to it, when you sent an email.<br>
<br>
<br>
Patches against trunk are the correct way.<br>
Other than getting trunk, there is no need to deal with svn or any <br>
revision management system.<br>
<br>
Besides the issues described below, your patch was very helpful, as it <br>
pointed me to the correct location for the fix. And it's review brought <br>
up more issues that need/needed fixing.<br>
<br>
------------------------------------<br>
About the patch itself.<br>
<br>
Both of the issues below, had been present before your patch. So they <br>
are not a result of your patch.<br>
I have fixed the first of the 2 issues, and committed this to trunk 2.1<br>
<br>
<br>
***1)<br>
If the text contains tabs, or special chars (such as umlauts äöü, <br>
accents, Japanese, Arabic, ....) then it can fail.<br>
<br>
X (in the search code) is a byte position into the string. It is not a <br>
position on the screen.<br>
<a href="https://wiki.lazarus.freepascal.org/SynEdit#Logical.2FPhysical_caret_position" rel="noreferrer" target="_blank">https://wiki.lazarus.freepascal.org/SynEdit#Logical.2FPhysical_caret_position</a><br>
<br>
Consider those Lines:  . for spaces,  \t shall be a tab, with tab-width = 4<br>
<br>
........ab cd ef gh  // 8 spaces "cd" is at x=12<br>
ääääööööab cd ef gh // 8 umlauts (each 2 bytes) "cd" is at x=20<br>
\t\tab cd ef gh  // 2 tabs (same width as spaces) "cd" is at x=6<br>
........ab cd ef gh  // 8 spaces "cd" is at x=12<br>
<br>
However, the "cd" on each line are aligned on the screen. So you can <br>
have a column selection, that in each line has "cd ef g"<br>
If in that column selection you replace "ef" with "EF", then your <br>
ptStartX=12 and ptEndX=19 => will replace nothing in the 2 middle lines.<br>
<br>
<br>
***2)<br>
Further more, if the text to be replaced occurs twice on a line<br>
........ab cd cd ef gh<br>
and "cd" is replaced by "CB and more", then the 2nd "cd" may get pushed <br>
out of the range, before being replaced.<br>
<br>
This is not yet fixed.<br>
According to me test this is "compatible" with Delphi 10.3<br>
(I.e. it seems to be not working in Delphi too)<br>
<br>
<br>
-- <br>
_______________________________________________<br>
lazarus mailing list<br>
<a href="mailto:lazarus@lists.lazarus-ide.org" target="_blank">lazarus@lists.lazarus-ide.org</a><br>
<a href="https://lists.lazarus-ide.org/listinfo/lazarus" rel="noreferrer" target="_blank">https://lists.lazarus-ide.org/listinfo/lazarus</a><br>
</blockquote></div>