Skip to content

Added action remove selection#348

Merged
AndreasArvidsson merged 7 commits intomainfrom
removeSelection
Dec 1, 2021
Merged

Added action remove selection#348
AndreasArvidsson merged 7 commits intomainfrom
removeSelection

Conversation

@AndreasArvidsson
Copy link
Copy Markdown
Member

@AndreasArvidsson AndreasArvidsson commented Dec 1, 2021

Closes #95

Copy link
Copy Markdown
Member

@pokey pokey left a comment

Choose a reason for hiding this comment

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

Looks good! Left one minor comment. The tests look really good. I see you have an example where the target strictly contains the selection. In that vein, I'd add a test for the converse:

  • Test where selection strictly contains target

Comment thread src/actions/RemoveSelection.ts Outdated
Copy link
Copy Markdown
Member

@pokey pokey left a comment

Choose a reason for hiding this comment

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

Ok nice tests thanks. Left a few more comments. I think I found a case we're missing

Comment thread src/actions/Deselect.ts
Comment thread src/actions/Deselect.ts
});

return {
thatMark: targets.map((target) => target.selection),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do you think the that mark would be more useful if it were the selections that got dropped? We could probably just leave it for now and see how it works in practice but just a thought

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think we can leave it like this and try it out. In most cases that is token you actually referenced. But I do agree that could potentially be useful.

Maybe we can use the source mark?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hmm not sure source mark is right here but interesting idea. Agreed tho let's just see if we ever actually want a way to refer to the removed selections in practice

Comment thread src/test/suite/fixtures/recorded/actions/giveDrum.yml
Comment thread src/actions/Deselect.ts Outdated
Comment thread src/actions/Deselect.ts Outdated
@AndreasArvidsson AndreasArvidsson merged commit d3a91b9 into main Dec 1, 2021
@AndreasArvidsson AndreasArvidsson deleted the removeSelection branch December 1, 2021 13:25
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.

Add "remove cursor" action

2 participants