Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

Add event subscription methods for Editor and associated classes #3456

Merged
merged 59 commits into from
Sep 9, 2014

Conversation

nathansobo
Copy link
Contributor

  • Add event subscription methods
    • 🔧 Editor
    • Cursor
    • Selection
    • Decoration
    • DisplayBuffer
    • TokenizedBuffer
  • Deprecate ::on
    • Editor
    • Cursor
    • Selection
    • Decoration
    • DisplayBuffer
    • TokenizedBuffer
  • Document new methods

Notes

  • We should drop events on editor that can be replaced by methods on Cursor, Selection, Decoration
  • Don't forget to dispose emitter instances on destruction of the owner

@benogle benogle self-assigned this Sep 4, 2014
@benogle
Copy link
Contributor

benogle commented Sep 4, 2014

Note to peeps: i'm taking this over now

Nathan Sobo added 20 commits September 5, 2014 11:36
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 benogle force-pushed the ns-editor-event-methods branch from 79a0626 to 6ad9531 Compare September 5, 2014 18:39
@batjko
Copy link
Contributor

batjko commented Sep 6, 2014

Guys, this is awesome stuff!
Do you think you one of you could write a blog post on the reasoning behind changing the event logic and the benefits of doing it this way etc?

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) ->
Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

@benogle
Copy link
Contributor

benogle commented Sep 8, 2014

@batjko we should do a blog post about this. We'd like to do a post on each large unit of API work.

@benogle
Copy link
Contributor

benogle commented Sep 9, 2014

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
@benogle benogle merged commit f357f69 into master Sep 9, 2014
@benogle benogle deleted the ns-editor-event-methods branch September 9, 2014 20:41
@nathansobo
Copy link
Contributor Author

🚢

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.

4 participants