Remove delegato dependency

This commit is contained in:
Nathan Sobo
2015-09-21 18:53:46 -06:00
parent 8d104fa838
commit d4afe881e9
2 changed files with 16 additions and 7 deletions

View File

@@ -21,7 +21,6 @@
"clear-cut": "^2.0.1",
"coffee-script": "1.8.0",
"color": "^0.7.3",
"delegato": "^1",
"event-kit": "^1.3.0",
"first-mate": "^5.0.0",
"fs-plus": "^2.8.0",

View File

@@ -1,7 +1,6 @@
_ = require 'underscore-plus'
path = require 'path'
Serializable = require 'serializable'
Delegator = require 'delegato'
Grim = require 'grim'
{CompositeDisposable, Emitter} = require 'event-kit'
{Point, Range} = TextBuffer = require 'text-buffer'
@@ -58,7 +57,6 @@ module.exports =
class TextEditor extends Model
Serializable.includeInto(this)
atom.deserializers.add(this)
Delegator.includeInto(this)
deserializing: false
callDisplayBufferCreatedHook: false
@@ -72,10 +70,6 @@ class TextEditor extends Model
selectionFlashDuration: 500
gutterContainer: null
@delegatesMethods 'suggestedIndentForBufferRow', 'autoIndentBufferRow', 'autoIndentBufferRows',
'autoDecreaseIndentForBufferRow', 'toggleLineCommentForBufferRow', 'toggleLineCommentsForBufferRows',
toProperty: 'languageMode'
constructor: ({@softTabs, initialLine, initialColumn, tabLength, softWrapped, @displayBuffer, buffer, registerEditor, suppressCursorCreation, @mini, @placeholderText, lineNumberGutterVisible, largeFileMode}={}) ->
super
@@ -3033,3 +3027,19 @@ class TextEditor extends Model
willInsertEvent = {cancel, text}
@emitter.emit 'will-insert-text', willInsertEvent
result
###
Section: Language Mode Delegated Methods
###
suggestedIndentForBufferRow: (bufferRow, options) -> @languageMode.suggestedIndentForBufferRow(bufferRow, options)
autoIndentBufferRow: (bufferRow, options) -> @languageMode.autoIndentBufferRow(bufferRow, options)
autoIndentBufferRows: (startRow, endRow) -> @languageMode.autoIndentBufferRows(startNow, endRow)
autoDecreaseIndentForBufferRow: (bufferRow) -> @languageMode.autoDecreaseIndentForBufferRow(bufferRow)
toggleLineCommentForBufferRow: (row) -> @languageMode.toggleLineCommentsForBufferRow(row)
toggleLineCommentsForBufferRows: (start, end) -> @languageMode.toggleLineCommentsForBufferRows(start, end)