Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search / replace text sometimes work not well #250

Open
jacek-mulawka opened this issue Feb 3, 2024 · 0 comments
Open

Search / replace text sometimes work not well #250

jacek-mulawka opened this issue Feb 3, 2024 · 0 comments

Comments

@jacek-mulawka
Copy link

Hey,

sometimes the functionality 'search / replace' text work not well. Maybe I do something wrong. I checked the SearchReplaceDemo and my own projects. For example I try to replace 'aa' with 'w' (or 'ccc'):
1

aa = aa bb

2

and the result is:
1

w w = aa bb

2

here 'ap_faktury_it' with 'ap_faktury_out':
1

SELECT ap_faktury_it.indeks_wyrobu, ap_faktury_it.nazwa_wyrobu FROM ap_faktury_it

2

and the result is:
1

aap_faktury_outtury_out.indeks_wyrobu, ap_faktury_out.nazwa_wyrobu FROM ap_faktury_out

2

I am not sure why it for some strings work good and for others not. Maybe it depend if a sub-string occurs several times in the same line.

I have a hint. If in the file plgSearchHighlighter.pas change the lines (around line number 95)

    ACanvas.FillRect(Rct);
    ACanvas.TextRect(Rct, Pt.X, Pt.Y, SearchResultText);

to

    ACanvas.FillRect(Rct);
    ACanvas.Rectangle( Rct.Left - margin_c, Rct.Top - margin_c, Rct.Right + margin_c, Rct.Bottom + margin_c ); // const margin_c : integer = 3;
    ACanvas.Font := Editor.Font;
    ACanvas.TextRect(Rct, Pt.X, Pt.Y, SearchResultText);

the text inside the highlight rectangle may better fit to the editor's font (e.g. if someone change the editor's font size) and the rectangle may have a border.

Greetings!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant