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

Added action remove selection #348

Merged
merged 7 commits into from
Dec 1, 2021
Merged

Added action remove selection #348

merged 7 commits into from
Dec 1, 2021

Conversation

AndreasArvidsson
Copy link
Member

@AndreasArvidsson AndreasArvidsson commented Dec 1, 2021

Closes #95

Copy link
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

src/actions/RemoveSelection.ts Outdated Show resolved Hide resolved
Copy link
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

src/actions/Deselect.ts Show resolved Hide resolved
});

return {
thatMark: targets.map((target) => target.selection),
Copy link
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
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
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

src/actions/Deselect.ts Outdated Show resolved Hide resolved
src/actions/Deselect.ts Outdated Show resolved Hide resolved
@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