This repository has been archived by the owner on Mar 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17.4k
Add event subscription methods for Editor and associated classes #3456
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Note to peeps: i'm taking this over now |
Our new pattern for booleans is to have ::set and ::is, and that means the property name needs to be in passive voice for ::is to make sense. This is in preparation for adding a new change observation method. * ::setSoftWrapped * ::isSoftWrapped * ::toggleSoftWrapped
It event was not document only being used in EditorComponent. Due to our batching strategy, it’s fine to respond to individual ::onDidMoveCursor events.
If you want to know if a cursor moved, subscribe to the cursor.
Also update EditorComponent to use the new ::onDidAddSelection method.
benogle
force-pushed
the
ns-editor-event-methods
branch
from
September 5, 2014 18:39
79a0626
to
6ad9531
Compare
Only emit the decorations from the events
Guys, this is awesome stuff! This is the kind of stuff that can be extremely educational for people, as well as just interesting from a behind-the-scenes kind of perspective. |
# * `newParams` {Object} eg. `{type: 'gutter', class: 'my-new-class'}` | ||
update: (newParams) -> | ||
# * `newProperties` {Object} eg. `{type: 'gutter', class: 'my-new-class'}` | ||
setProperties: (newProperties) -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@batjko we should do a blog post about this. We'd like to do a post on each large unit of API work. |
Seems like the initial implementation was to handle the event, unfold all then, re-emit the grammar-changed event.
for consistency
Provided tests pass, this is good to go. |
benogle
added a commit
that referenced
this pull request
Sep 9, 2014
Add event subscription methods for Editor and associated classes
🚢 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
::on
Notes
Cursor
,Selection
,Decoration