Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Renamed VirtualSelection to Highlight. #1091

Merged
merged 4 commits into from
Aug 22, 2017
Merged

Renamed VirtualSelection to Highlight. #1091

merged 4 commits into from
Aug 22, 2017

Conversation

szymonkups
Copy link
Contributor

@szymonkups szymonkups commented Aug 21, 2017

Suggested merge commit message (convention)

Other: Renamed virtual selection to highlight. Closes ckeditor/ckeditor5#4151.


Additional information

Depending branch in widget repository: https://github.com/ckeditor/ckeditor5-widget/tree/t/ckeditor5-engine/1085

@szymonkups szymonkups requested review from Reinmar and pjasiun August 21, 2017 13:53
* @return {Function}
*/
export function convertElementsInsideMarker( selectionDescriptor ) {
export function convertElementsInsideMarker( highlightDescriptor ) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since most of the methods names here focus on what will be done on the view and highlight works well as a verb, maybe a better name would be highlightElement and highlightText?

@@ -475,9 +475,9 @@ export function convertElementsInsideMarker( selectionDescriptor ) {

const viewElement = conversionApi.mapper.toViewElement( modelItem );
const addMarker = evt.name.split( ':' )[ 0 ] == 'addMarker';
const selectionHandlingMethod = addMarker ? 'setVirtualSelection' : 'removeVirtualSelection';
const highlightHandlingMethod = addMarker ? 'setHighlight' : 'removeHighlight';
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about setHighlight. First sounds strange that it's setHighlight instead of just highlight. Second, if we have remove the better pair might be add, especially when you can add multiple highlights. So I would go with addHighlight instead of setHighlight.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Especially, when its default action is stack.add and stack.remove.

@Reinmar
Copy link
Member

Reinmar commented Aug 21, 2017

Please do remember that these changes are internal, not breaking, because this whole API has appeared in this milestone.

@szymonkups
Copy link
Contributor Author

@Reinmar - true, I'll remove breaking changes from suggested merge commit message.

convertTextsInsideMarker,
convertElementsInsideMarker
highlightTexts,
highlightElements
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All other methods here are singular (wrapItem, removeUIElement). I think this should be too.

@pjasiun pjasiun merged commit 1955869 into master Aug 22, 2017
@pjasiun pjasiun deleted the t/1085 branch August 22, 2017 09:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rename virtual selection to highlight
3 participants