mirror of
https://github.com/atom/atom.git
synced 2026-01-23 05:48:10 -05:00
Remove unused relative path from Editor/EditSession/TextBuffer
This commit is contained in:
@@ -335,9 +335,6 @@ class EditSession
|
||||
# {Delegates to: TextBuffer.getPath}
|
||||
getPath: -> @buffer.getPath()
|
||||
|
||||
# {Delegates to: TextBuffer.getRelativePath}
|
||||
getRelativePath: -> @buffer.getRelativePath()
|
||||
|
||||
# {Delegates to: TextBuffer.getText}
|
||||
getText: -> @buffer.getText()
|
||||
|
||||
|
||||
@@ -600,9 +600,6 @@ class Editor extends View
|
||||
# {Delegates to: EditSession.getPath}
|
||||
getPath: -> @activeEditSession?.getPath()
|
||||
|
||||
# {Delegates to: EditSession.getRelativePath}
|
||||
getRelativePath: -> @activeEditSession?.getRelativePath()
|
||||
|
||||
# {Delegates to: TextBuffer.getLineCount}
|
||||
getLineCount: -> @getBuffer().getLineCount()
|
||||
|
||||
|
||||
@@ -27,8 +27,6 @@ class TextBuffer extends Model
|
||||
modifiedWhenLastPersisted: false
|
||||
digestWhenLastPersisted: null
|
||||
|
||||
@::lazyGetter 'project', -> @grandparent
|
||||
|
||||
stoppedChangingDelay: 300
|
||||
stoppedChangingTimeout: null
|
||||
cachedDiskContents: null
|
||||
@@ -46,7 +44,7 @@ class TextBuffer extends Model
|
||||
@subscribe @text, 'marker-created', (marker) => @emit 'marker-created', marker
|
||||
@subscribe @text, 'markers-updated', => @emit 'markers-updated'
|
||||
|
||||
@setPath(@project.resolve(@filePath)) if @project
|
||||
@setPath(@filePath)
|
||||
|
||||
# Private: Called by telepath
|
||||
beforePersistence: ->
|
||||
@@ -118,7 +116,6 @@ class TextBuffer extends Model
|
||||
@emitModifiedStatusChanged(@isModified())
|
||||
|
||||
@file.on "moved", =>
|
||||
@relativePath = @project.relativize(@getPath())
|
||||
@emit "path-changed", this
|
||||
|
||||
### Public ###
|
||||
@@ -161,10 +158,7 @@ class TextBuffer extends Model
|
||||
@file?.getPath()
|
||||
|
||||
getUri: ->
|
||||
@getRelativePath()
|
||||
|
||||
getRelativePath: ->
|
||||
@relativePath
|
||||
@getPath()
|
||||
|
||||
# Sets the path for the file.
|
||||
#
|
||||
@@ -180,7 +174,6 @@ class TextBuffer extends Model
|
||||
else
|
||||
@file = null
|
||||
|
||||
@relativePath = @project.relativize(path)
|
||||
@emit "path-changed", this
|
||||
|
||||
# Retrieves the current buffer's file extension.
|
||||
|
||||
@@ -36,7 +36,7 @@ class TokenizedBuffer
|
||||
{ @buffer, tabLength } = optionsOrState
|
||||
@state = atom.site.createDocument
|
||||
deserializer: @constructor.name
|
||||
bufferPath: @buffer.getRelativePath()
|
||||
bufferPath: @buffer.getPath()
|
||||
tabLength: tabLength ? atom.config.get('editor.tabLength') ? 2
|
||||
|
||||
@subscribe syntax, 'grammar-added grammar-updated', (grammar) =>
|
||||
@@ -48,7 +48,7 @@ class TokenizedBuffer
|
||||
|
||||
@on 'grammar-changed grammar-updated', => @resetTokenizedLines()
|
||||
@subscribe @buffer, "changed", (e) => @handleBufferChange(e)
|
||||
@subscribe @buffer, "path-changed", => @state.set('bufferPath', @buffer.getRelativePath())
|
||||
@subscribe @buffer, "path-changed", => @state.set('bufferPath', @buffer.getPath())
|
||||
|
||||
@reloadGrammar()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user