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

Fix issue #54 and Memory leak in Pascal Highlighters #86

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Fix issue #54 and Memory leak in Pascal Highlighters #86

wants to merge 3 commits into from

Conversation

pyscripter
Copy link
Contributor

Fix print preview issue #54.

Sync with Synedit/Synedit
The created regular expressions were not freed.
@pyscripter pyscripter changed the title Fix issue #54 Fix issue #54 and Memory leak in Pascal Highlighters Jan 26, 2018
@uschuster
Copy link
Contributor

I do not see that the changes in SynEditPrint.pas do fix #54. The issue still occurs very often when I change the size of the preview window and just when I call the preview without changing anything.

I have cherry-picked the memory leak fix commit b69a5ae and committed it after changing SynHighlighterPas.pas from UTF-8 without BOM back to ANSI.

@pyscripter
Copy link
Contributor Author

pyscripter commented Jan 27, 2018

Regarding #54 . what I observed was that TextWidth/CharWidth in certain occasions returned values just above 1, in my case 1.02. In such cases the preview added a whole new space between the characters, causing the issue. Having a tolerance of 4% resolved the issue for me and the preview looked good in all cases. It would be useful if you could set a conditional break point and see what kind of values you get when the problem occurs. I suspect that with a slightly greater tolerance the issue should disappear.

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

Successfully merging this pull request may close these issues.

None yet

2 participants