-
Notifications
You must be signed in to change notification settings - Fork 4
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
Implement Tree.RemoveStyle #171
Conversation
return when { | ||
attributes?.isNotEmpty() == true -> { | ||
tree.style(fromPos to toPos, attributes, executedAt).map { | ||
TreeStyleOpInfo( | ||
it.from, | ||
it.to, | ||
it.fromPath, | ||
it.attributes.orEmpty(), | ||
path = root.createPath(parentCreatedAt), | ||
) | ||
} | ||
} | ||
|
||
attributesToRemove?.isNotEmpty() == true -> { | ||
tree.removeStyle(fromPos to toPos, attributesToRemove, executedAt).map { | ||
TreeStyleOpInfo( | ||
it.from, | ||
it.to, | ||
it.fromPath, | ||
attributesToRemove = it.attributesToRemove.orEmpty(), | ||
path = root.createPath(parentCreatedAt), | ||
) | ||
} | ||
} | ||
|
||
else -> emptyList() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it assured that only one of attributes
or attributesToRemove
will be set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the current interface, style()
can only set attributes
, and removeStyle()
can only set attributesToRemove
. So I think it is logically assured that only one of them will be set.
What this PR does / why we need it?
Implement
JsonTree.removeStyle()
.Any background context you want to provide?
What are the relevant tickets?
Checklist