diff --git a/src/editor.coffee b/src/editor.coffee index 50cb3e2c6..d0cd623d6 100644 --- a/src/editor.coffee +++ b/src/editor.coffee @@ -410,13 +410,13 @@ class Editor extends Model saveAs: (filePath) -> @buffer.saveAs(filePath) checkoutHead: -> - if path = @getPath() - atom.project.getRepo()?.checkoutHead(path) + if filePath = @getPath() + atom.project.getRepo()?.checkoutHead(filePath) # Copies the current file path to the native clipboard. copyPathToClipboard: -> - path = @getPath() - atom.clipboard.write(path) if path? + if filePath = @getPath() + atom.clipboard.write(filePath) # Public: Returns the {String} path of this editor's text buffer. getPath: -> @buffer.getPath()