Move checkoutHead implementation to Editor

This commit is contained in:
Kevin Sawicki
2013-11-13 17:49:53 -08:00
parent 618d281d6c
commit 5fdec4dc7b
2 changed files with 4 additions and 8 deletions

View File

@@ -586,8 +586,10 @@ class Editor extends View
@showIndentGuide = showIndentGuide
@resetDisplay()
# {Delegates to: TextBuffer.checkoutHead}
checkoutHead: -> @getBuffer().checkoutHead()
# Checkout the HEAD revision of this editor's file.
checkoutHead: ->
if path = @getPath()
@project.getRepo()?.checkoutHead(path)
# {Delegates to: EditSession.setText}
setText: (text) -> @activeEditSession.setText(text)

View File

@@ -632,12 +632,6 @@ class TextBuffer extends Model
return match[0][0] != '\t'
undefined
# Checks out the current `HEAD` revision of the file.
checkoutHead: ->
path = @getPath()
return unless path
@project.getRepo()?.checkoutHead(path)
### Internal ###
transact: (fn) -> @text.transact fn