Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Clear selections tail when they become empty after a text change #63

Merged
merged 4 commits into from
Sep 29, 2017

Conversation

as-cii
Copy link
Contributor

@as-cii as-cii commented Sep 20, 2017

Depends on atom/text-buffer#261
Fixes #61

Originally, we attempted to solve this by relaying the exclusive parameter from the site owning the marker. This was, however, inaccurate because selections only become exclusive if text changes and the selected region becomes empty.

For this reason, similarly to what we do in selection.coffee, we will observe all selection markers, and if they move as a result of a text change, we will clear the tail if their range becomes empty.

/cc: @nathansobo @jasonrudolph @ungb @rsese @Ben3eeE

@as-cii as-cii force-pushed the clear-remote-selections-tail-after-text-changes branch from fc14601 to 0ba13c4 Compare September 20, 2017 09:36
@as-cii as-cii changed the title Clear tail of remote markers when they become empty after a text change Clear selections tail when they become empty after a text change Sep 20, 2017
@as-cii as-cii changed the title Clear selections tail when they become empty after a text change [WIP] Clear selections tail when they become empty after a text change Sep 20, 2017
@as-cii
Copy link
Contributor Author

as-cii commented Sep 20, 2017

Tests currently fail because we need to merge atom/text-buffer#261 first and bump text-buffer both on master and beta.

@nathansobo
Copy link
Contributor

Okay, that text-buffer PR is on 1.21-releases, but we'll need to wait for the 1.12.0-beta2 hotfix to be published before merging this.

@as-cii as-cii changed the title [WIP] Clear selections tail when they become empty after a text change Clear selections tail when they become empty after a text change Sep 28, 2017
@as-cii as-cii force-pushed the clear-remote-selections-tail-after-text-changes branch 3 times, most recently from b2fd774 to 93cd55e Compare September 29, 2017 08:48
Antonio Scandurra added 4 commits September 29, 2017 11:55
Originally, we attempted to solve this by relaying the `exclusive`
parameter from the site owning the marker. This was, however, inaccurate
because selections only become exclusive if text changes and the
selected region becomes empty.

For this reason, similarly to what we do in
[selection.coffee](https://github.com/atom/atom/blob/a3e98d54e3d24bbc5c4a67a135cfae2744805285/src/selection.coffee),
we will observe remote selection markers, and if they move as a result
of a text change, we will clear the tail if their range becomes empty.
@as-cii as-cii force-pushed the clear-remote-selections-tail-after-text-changes branch from 93cd55e to 0538d57 Compare September 29, 2017 09:56
@as-cii as-cii merged commit 2b61e22 into master Sep 29, 2017
@as-cii as-cii deleted the clear-remote-selections-tail-after-text-changes branch September 29, 2017 10:32
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.

None yet

2 participants