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

Conversation

@as-cii
Copy link
Contributor

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

As part of #255, we changed the way the onDidChangeText and onDidStopChanging collected changes so that they could avoid relying on the history (see 8a4a4d8 for more background).

Later, in ce1964f, we improved the performance of combining the accumulated changes by also storing the change's newEnd. This was, however, slightly incorrect, as we calculated such coordinate before normalizing line endings, thus causing the various text change events to start reporting inaccurate information.

With this pull-request we are fixing that oversight (adding also test coverage to ensure we don't regress in the future), as well as streamlining applyChange. In particular, we will now take care of normalizing lines in setTextInRange instead of applyChange, as that's the only call site in which normalization needs to take place.

/cc: @nathansobo

As part of #255, we changed the
way the `onDidChangeText` and `onDidStopChanging` collected changes so
that they could avoid relying on the history (see 8a4a4d8 for more
background).

Later, in ce1964f, we improved the performance of combining the
accumulated changes by also storing the change's `newEnd`. This was,
however, slightly incorrect, as we calculated such coordinate before
normalizing line endings, thus causing the various text change events to
report inaccurate information.

With this commit we are fixing that oversight (adding also test coverage
to ensure we don't regress in the future), as well as streamlining
`applyChange`. In particular, we will now take care of normalizing lines
in `setTextInRange` instead of `applyChange`, as that's the only call
site in which normalization needs to take place.
@as-cii as-cii merged commit 09526d4 into master Sep 18, 2017
@as-cii as-cii deleted the as-fix-line-normalization branch September 18, 2017 08:03
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.

2 participants