mirror of
https://github.com/atom/atom.git
synced 2026-02-11 07:05:11 -05:00
💄 Replace editor.getBuffer().getPath() w/ editor.getPath()
This commit is contained in:
@@ -247,6 +247,7 @@ class Editor extends View
|
||||
|
||||
setText: (text) -> @getBuffer().setText(text)
|
||||
getText: -> @getBuffer().getText()
|
||||
getPath: -> @getBuffer().getPath()
|
||||
getLastBufferRow: -> @getBuffer().getLastRow()
|
||||
getTextInRange: (range) -> @getBuffer().getTextInRange(range)
|
||||
getEofPosition: -> @getBuffer().getEofPosition()
|
||||
@@ -498,7 +499,7 @@ class Editor extends View
|
||||
$(window).off 'resize', @_setSoftWrapColumn
|
||||
|
||||
save: ->
|
||||
if not @getBuffer().getPath()
|
||||
if not @getPath()
|
||||
path = Native.saveDialog()
|
||||
return false if not path
|
||||
@getBuffer().saveAs(path)
|
||||
@@ -539,7 +540,7 @@ class Editor extends View
|
||||
close: ->
|
||||
return if @mini
|
||||
if @getBuffer().isModified()
|
||||
filename = if @getBuffer().getPath() then fs.base(@getBuffer().getPath()) else "untitled buffer"
|
||||
filename = if @getPath() then fs.base(@getPath()) else "untitled buffer"
|
||||
message = "'#{filename}' has changes, do you want to save them?"
|
||||
detailedMessage = "Your changes will be lost if you don't save them"
|
||||
buttons = [
|
||||
|
||||
@@ -132,9 +132,9 @@ class RootView extends View
|
||||
|
||||
if not editor.mini
|
||||
editor.on 'editor-path-change.root-view', =>
|
||||
@trigger 'active-editor-path-change', editor.getBuffer().getPath()
|
||||
if not previousActiveEditor or editor.getBuffer().getPath() != previousActiveEditor.getBuffer().getPath()
|
||||
@trigger 'active-editor-path-change', editor.getBuffer().getPath()
|
||||
@trigger 'active-editor-path-change', editor.getPath()
|
||||
if not previousActiveEditor or editor.getPath() != previousActiveEditor.getPath()
|
||||
@trigger 'active-editor-path-change', editor.getPath()
|
||||
|
||||
activeKeybindings: ->
|
||||
keymap.bindingsForElement(document.activeElement)
|
||||
|
||||
@@ -28,7 +28,7 @@ class StatusBar extends View
|
||||
@editor.on 'cursor-move', => @updateCursorPositionText()
|
||||
|
||||
updatePathText: ->
|
||||
path = @editor.getBuffer().getPath()
|
||||
path = @editor.getPath()
|
||||
if path
|
||||
@currentPath.text(@rootView.project.relativize(path))
|
||||
else
|
||||
|
||||
@@ -1 +1 @@
|
||||
module.exports = require 'autocomplete/autocomplete.coffee'
|
||||
module.exports = require 'autocomplete/autocomplete.coffee'
|
||||
|
||||
@@ -1 +1 @@
|
||||
module.exports = require 'command-panel/command-panel'
|
||||
module.exports = require 'command-panel/command-panel'
|
||||
|
||||
@@ -101,7 +101,7 @@ class TreeView extends View
|
||||
@append(@root)
|
||||
|
||||
selectActiveFile: ->
|
||||
activeFilePath = @rootView.getActiveEditor()?.getBuffer().getPath()
|
||||
activeFilePath = @rootView.getActiveEditor()?.getPath()
|
||||
@selectEntryForPath(activeFilePath)
|
||||
|
||||
selectEntryForPath: (path) ->
|
||||
|
||||
Reference in New Issue
Block a user