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

Add a 'touch' invalidation strategy #17

Merged
merged 2 commits into from
Apr 10, 2014

Conversation

nathansobo
Copy link
Contributor

This PR adds a 'touch' invalidation strategy that takes over the old behavior of 'inside'. Now the 'inside' strategy no longer invalidates for changes that abut the marker's range.

Closes #16.

/cc @kevinsawicki

@@ -1,7 +1,7 @@
{difference} = require 'underscore-plus'
TextBuffer = require '../src/text-buffer'

describe "Marker", ->
fdescribe "Marker", ->
Copy link
Contributor

Choose a reason for hiding this comment

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

🔥 or are you still tweaking things?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No that was a screwup. Gonna force push.

Nathan Sobo added 2 commits April 10, 2014 11:12
A 'touch' marker is invalidated for any change that touches the marker,
including changes that end at the marker's start position or start at
the marker's end position.

This was the former behavior of 'inside' markers, which are now only
invalidated for changes that are truly *inside* the marker.

This distinction allows find-and-replace markers to use the 'inside'
strategy but spellcheck to use the 'touch' strategy. The logic is that
an edit occurring adjacent to a find result doesn't invalidate the
result, but an edit occurring next to a spellchecked word could actually
change the word.
kevinsawicki added a commit that referenced this pull request Apr 10, 2014
@kevinsawicki kevinsawicki merged commit 85ad1ed into master Apr 10, 2014
@kevinsawicki
Copy link
Contributor

💚

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.

Add touch invalidation strategy
2 participants