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
Merged
Changes from 1 commit
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
b731f7c
Add Editor::onDidChangeTitle
Sep 4, 2014
133f3f4
Add Editor::onDidChangePath
Sep 4, 2014
d15d157
Add Editor::onDidChangeModified
Sep 4, 2014
965afc2
Rename softWrap to softWrapped
Sep 4, 2014
3e260ee
Add Editor::onDidChangeSoftWrapped
Sep 4, 2014
1c95a55
Add ::onDidChangeGrammar to Editor, DisplayBuffer, and TokenizedBuffer
Sep 4, 2014
5a02303
Add Editor::onDidStopChanging which delegates to TextBuffer
Sep 4, 2014
63c9da0
Add Editor::onDidConflict
Sep 4, 2014
05ea381
Add Editor::onWill/DidInsertText
Sep 4, 2014
2a81687
Add Editor::onDidMoveCursor
Sep 4, 2014
161edfd
Remove ‘cursors-moved’ event
Sep 4, 2014
3b6e40f
Add Editor::onDidAddCursor
Sep 4, 2014
e77b4a5
Add Editor::onDidRemoveCursor
Sep 4, 2014
3e77b9b
Eliminate Editor::onDidMoveCursor
Sep 4, 2014
651eb78
Add Editor::onDidAdd/RemoveSelection
Sep 4, 2014
1131b33
Add DisplayBufferMarker::onDidChange and ::onDidDestroy
Sep 4, 2014
c69b5fc
Remove specs for ::onDidMoveCursor, which was removed
Sep 4, 2014
6bd8702
Deprecate DisplayBufferMarker::on
Sep 4, 2014
5668702
Add Cursor::onDidChangePosition and ::onDidDestroy and deprecate ::on
Sep 4, 2014
6ad9531
Add Selection::onDidChangeRange and ::onDidDestroy and deprecate ::on
Sep 4, 2014
569c403
Update the events on decorations
benogle Sep 5, 2014
9435f85
Use new decoration updated event method
benogle Sep 5, 2014
bcc6adf
No longer need this as the event method passes it through
benogle Sep 5, 2014
48a68d8
Add TextBuffer::onDidChange
benogle Sep 5, 2014
a2adbff
Add TokenizedBuffer::onDidTokenize
benogle Sep 5, 2014
53fbfb8
Merge decoration-changed and decoration-updated
benogle Sep 5, 2014
289b22c
Use event methods in TokenizedBuffer spec
benogle Sep 5, 2014
0a920b1
Update TokenizedBUffer::on deprecations
benogle Sep 5, 2014
557562d
Fix linter error
benogle Sep 5, 2014
db84b79
fix another linter error
benogle Sep 5, 2014
21e4d8a
Add DisplayBuffer::onDidChange
benogle Sep 5, 2014
6e8a626
Add ::onDidChangeSoftWrapped to DisplayBuffer and Editor
benogle Sep 5, 2014
f3e8f11
Use DisplayBuffer::onDidChangeSoftWrapped in Editor
benogle Sep 5, 2014
e6e6028
Deprecate decoration events
benogle Sep 5, 2014
7ae25d3
Decoration Params -> Properties
benogle Sep 5, 2014
aeffef3
Directly subscribe to the decorations in EditorComponent
benogle Sep 5, 2014
86e9778
Remove the decoration changed event
benogle Sep 5, 2014
47ef54a
Subscribe directly to the decoration destroy for removal
benogle Sep 5, 2014
e6dbea0
Add onDidCreateMarker and onDidUpdateMarkers
benogle Sep 6, 2014
250c21f
Deprecate all events from ::on
benogle Sep 6, 2014
8aa1784
Add Editor::onDidChangeScreenLines
benogle Sep 8, 2014
efea168
Add deprecation warnings for all the other converted events
benogle Sep 8, 2014
b6a9e1b
Fix deprecation warning
benogle Sep 8, 2014
6f9f087
:lipstick: consistency
benogle Sep 8, 2014
d4835e1
Add Editor:onScrollTopChanged and Editor:onScrollLeftChanged
benogle Sep 8, 2014
601b311
Add Editor::onDidMoveCursor
benogle Sep 8, 2014
1d07317
Add Editor::onDidChangeSelectedScreenRange
benogle Sep 8, 2014
5883e27
Make Editor::onDidChangeGrammar emit from Editor
benogle Sep 8, 2014
aebdfb4
Event docs
benogle Sep 9, 2014
7198a91
onDidMoveCursor -> onDidChangeCursorPosition
benogle Sep 9, 2014
c7525e8
:lipstick: doc strings
benogle Sep 9, 2014
9db804b
Doc events in `Cursor`
benogle Sep 9, 2014
858ac5b
onDidChangeSelectionScreenRange -> onDidChangeSelectionRange
benogle Sep 9, 2014
789d9c8
:memo: Selection event methods
benogle Sep 9, 2014
72be167
isDestroyed -> destroyed
benogle Sep 9, 2014
3e5666f
use getPaneView rather than getPane
benogle Sep 9, 2014
0f83fe5
Add and use Editor::observeSelections() and ::observeCursors()
benogle Sep 9, 2014
e452b88
Add sections for events
benogle Sep 9, 2014
2a02375
Move the Decoration events to an events section
benogle Sep 9, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add Editor::onDidRemoveCursor
  • Loading branch information
Nathan Sobo authored and benogle committed Sep 5, 2014
commit e77b4a54dda6f26d04fe3c2b5ea21588e200b462
4 changes: 4 additions & 0 deletions src/editor.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,9 @@ class Editor extends Model
onDidAddCursor: (callback) ->
@emitter.on 'did-add-cursor', callback

onDidRemoveCursor: (callback) ->
@emitter.on 'did-remove-cursor', callback

# Retrieves the current {TextBuffer}.
getBuffer: -> @buffer

Expand Down Expand Up @@ -1852,6 +1855,7 @@ class Editor extends Model
removeCursor: (cursor) ->
_.remove(@cursors, cursor)
@emit 'cursor-removed', cursor
@emitter.emit 'did-remove-cursor', cursor

moveCursors: (fn) ->
fn(cursor) for cursor in @getCursors()
Expand Down