mirror of
https://github.com/atom/atom.git
synced 2026-01-23 22:08:08 -05:00
Move checkoutHead implementation to Editor
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user