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

Use correct replace method when SEG is String #678

Merged
merged 2 commits into from
Feb 9, 2018
Merged

Use correct replace method when SEG is String #678

merged 2 commits into from
Feb 9, 2018

Conversation

JordanMartinez
Copy link
Contributor

Resolves #676.

In addition to fixing that issue, I also bumped the type of the area's segmentOps field from SegmentOps to TextOps. The area's constructor already requires the latter type, so this just makes it easier to call StyledDocument-related methods.

It is unlikely for this bug to be reproduced in the other areas because their SEG generic isn't purely text. Still, I wonder whether the method names should be changed to prevent problems like this from arising in the future. I think one test that could be written for this would be to check the number of visible paragraphs after constructing each kind of area.

This method calls ReadOnlyStyledDocument.fromString as opposed to ReadOnlyStyledDocument.fromSeg
@JordanMartinez
Copy link
Contributor Author

I think I will wait to merge this until I hear back from Jugen in #656.

@JordanMartinez JordanMartinez merged commit 353d384 into FXMisc:master Feb 9, 2018
@JordanMartinez JordanMartinez deleted the useCorrectMethod branch February 9, 2018 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant