Limit TextChange's type's possibilities by only using it for merging#487
Merged
JordanMartinez merged 1 commit intoFXMisc:masterfrom Apr 12, 2017
JordanMartinez:fixChangeType
Merged
Limit TextChange's type's possibilities by only using it for merging#487JordanMartinez merged 1 commit intoFXMisc:masterfrom JordanMartinez:fixChangeType
JordanMartinez merged 1 commit intoFXMisc:masterfrom
JordanMartinez:fixChangeType
Conversation
ghost
reviewed
Apr 12, 2017
| /** Indicates that the paragraph style of an empty {@link Paragraph} ({@code p.length() == 0}) was changed */ | ||
| RESTYLED_PARAGRAPH | ||
| /** Indicates that the change is a style change, a replacement or something other than the other two types */ | ||
| NEITHER, |
There was a problem hiding this comment.
I really don't like that name. When someone would be reading code, "neither of WHAT?" will be constant question.
Because "style change, a replacement or something other" implies, in code below, that no merge will be done, I propose to rename this to MergeType.NONE
Contributor
Author
There was a problem hiding this comment.
I like NONE better, but it still leaves the similar question of "if it isn't none, then what is it?" 😄
I think we'll just take the minor performance hit and make the code more readable by writing it like so:
if (this.getType == INSERTION || this.getType() == DELETION)
&& this.getType() == that.getType() // and so forth
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes regressions introduced by #458 by implementing the changes proposed in #486.