mirror of
https://github.com/atom/atom.git
synced 2026-01-22 21:38:10 -05:00
Remove empty Private: comments
This commit is contained in:
@@ -105,7 +105,6 @@ class Atom extends Model
|
||||
@getCurrentWindow().loadSettings.windowState = value
|
||||
cloned
|
||||
|
||||
# Private:
|
||||
@getCurrentWindow: ->
|
||||
remote.getCurrentWindow()
|
||||
|
||||
@@ -175,7 +174,6 @@ class Atom extends Model
|
||||
# Deprecated: Callers should be converted to use atom.deserializers
|
||||
registerRepresentationClasses: ->
|
||||
|
||||
# Private:
|
||||
setBodyPlatformClass: ->
|
||||
document.body.classList.add("platform-#{process.platform}")
|
||||
|
||||
@@ -211,7 +209,6 @@ class Atom extends Model
|
||||
else
|
||||
@center()
|
||||
|
||||
# Private:
|
||||
restoreWindowDimensions: ->
|
||||
workAreaSize = screen.getPrimaryDisplay().workAreaSize
|
||||
windowDimensions = @state.windowDimensions ? {}
|
||||
@@ -220,7 +217,6 @@ class Atom extends Model
|
||||
windowDimensions.width ?= initialSize?.width ? Math.min(workAreaSize.width, 1024)
|
||||
@setWindowDimensions(windowDimensions)
|
||||
|
||||
# Private:
|
||||
storeWindowDimensions: ->
|
||||
@state.windowDimensions = @getWindowDimensions()
|
||||
|
||||
@@ -230,12 +226,10 @@ class Atom extends Model
|
||||
getLoadSettings: ->
|
||||
@constructor.getLoadSettings()
|
||||
|
||||
# Private:
|
||||
deserializeProject: ->
|
||||
Project = require './project'
|
||||
@project ?= @deserializers.deserialize(@project) ? new Project(path: @getLoadSettings().initialPath)
|
||||
|
||||
# Private:
|
||||
deserializeWorkspaceView: ->
|
||||
Workspace = require './workspace'
|
||||
WorkspaceView = require './workspace-view'
|
||||
@@ -243,12 +237,10 @@ class Atom extends Model
|
||||
@workspaceView = new WorkspaceView(@workspace)
|
||||
$(@workspaceViewParentSelector).append(@workspaceView)
|
||||
|
||||
# Private:
|
||||
deserializePackageStates: ->
|
||||
@packages.packageStates = @state.packageStates ? {}
|
||||
delete @state.packageStates
|
||||
|
||||
# Private:
|
||||
deserializeEditorWindow: ->
|
||||
@deserializePackageStates()
|
||||
@deserializeProject()
|
||||
@@ -283,7 +275,6 @@ class Atom extends Model
|
||||
|
||||
@displayWindow()
|
||||
|
||||
# Private:
|
||||
unloadEditorWindow: ->
|
||||
return if not @project and not @workspaceView
|
||||
|
||||
@@ -299,11 +290,9 @@ class Atom extends Model
|
||||
@keymap.destroy()
|
||||
@windowState = null
|
||||
|
||||
# Private:
|
||||
loadThemes: ->
|
||||
@themes.load()
|
||||
|
||||
# Private:
|
||||
watchThemes: ->
|
||||
@themes.on 'reloaded', =>
|
||||
# Only reload stylesheets from non-theme packages
|
||||
@@ -361,11 +350,9 @@ class Atom extends Model
|
||||
callback = buttons[buttonLabels[chosen]]
|
||||
callback?()
|
||||
|
||||
# Private:
|
||||
showSaveDialog: (callback) ->
|
||||
callback(showSaveDialogSync())
|
||||
|
||||
# Private:
|
||||
showSaveDialogSync: (defaultPath) ->
|
||||
defaultPath ?= @project?.getPath()
|
||||
currentWindow = @getCurrentWindow()
|
||||
@@ -423,7 +410,6 @@ class Atom extends Model
|
||||
close: ->
|
||||
@getCurrentWindow().close()
|
||||
|
||||
# Private:
|
||||
exit: (status) ->
|
||||
app = remote.require('app')
|
||||
app.exit(status)
|
||||
@@ -473,7 +459,6 @@ class Atom extends Model
|
||||
getConfigDirPath: ->
|
||||
@constructor.getConfigDirPath()
|
||||
|
||||
# Private:
|
||||
saveSync: ->
|
||||
stateString = JSON.stringify(@state)
|
||||
if statePath = @constructor.getStatePath(@mode)
|
||||
@@ -491,11 +476,9 @@ class Atom extends Model
|
||||
getWindowLoadTime: ->
|
||||
@loadTime
|
||||
|
||||
# Private:
|
||||
crashMainProcess: ->
|
||||
remote.process.crash()
|
||||
|
||||
# Private:
|
||||
crashRenderProcess: ->
|
||||
process.crash()
|
||||
|
||||
@@ -504,7 +487,6 @@ class Atom extends Model
|
||||
shell.beep() if @config.get('core.audioBeep')
|
||||
@workspaceView.trigger 'beep'
|
||||
|
||||
# Private:
|
||||
requireUserInitScript: ->
|
||||
if userInitScriptPath = fs.resolve(@getConfigDirPath(), 'user', ['js', 'coffee'])
|
||||
try
|
||||
|
||||
@@ -37,7 +37,6 @@ class Config
|
||||
@configFilePath = fs.resolve(@configDirPath, 'config', ['json', 'cson'])
|
||||
@configFilePath ?= path.join(@configDirPath, 'config.cson')
|
||||
|
||||
# Private:
|
||||
initializeConfigDirectory: (done) ->
|
||||
return if fs.existsSync(@configDirPath)
|
||||
|
||||
@@ -54,13 +53,11 @@ class Config
|
||||
queue.push({sourcePath, destinationPath})
|
||||
fs.traverseTree(templateConfigDirPath, onConfigDirFile, (path) -> true)
|
||||
|
||||
# Private:
|
||||
load: ->
|
||||
@initializeConfigDirectory()
|
||||
@loadUserConfig()
|
||||
@observeUserConfig()
|
||||
|
||||
# Private:
|
||||
loadUserConfig: ->
|
||||
unless fs.existsSync(@configFilePath)
|
||||
fs.makeTreeSync(path.dirname(@configFilePath))
|
||||
@@ -76,17 +73,14 @@ class Config
|
||||
console.error "Failed to load user config '#{@configFilePath}'", e.message
|
||||
console.error e.stack
|
||||
|
||||
# Private:
|
||||
observeUserConfig: ->
|
||||
@watchSubscription ?= pathWatcher.watch @configFilePath, (eventType) =>
|
||||
@loadUserConfig() if eventType is 'change' and @watchSubscription?
|
||||
|
||||
# Private:
|
||||
unobserveUserConfig: ->
|
||||
@watchSubscription?.close()
|
||||
@watchSubscription = null
|
||||
|
||||
# Private:
|
||||
setDefaults: (keyPath, defaults) ->
|
||||
keys = keyPath.split('.')
|
||||
hash = @defaultSettings
|
||||
@@ -229,12 +223,10 @@ class Config
|
||||
unobserve: (keyPath) ->
|
||||
@off("updated.#{keyPath.replace(/\./, '-')}")
|
||||
|
||||
# Private:
|
||||
update: ->
|
||||
return if @configFileHasErrors
|
||||
@save()
|
||||
@emit 'updated'
|
||||
|
||||
# Private:
|
||||
save: ->
|
||||
CSON.writeFileSync(@configFilePath, @settings)
|
||||
|
||||
@@ -9,7 +9,6 @@ remote = require 'remote'
|
||||
# global.
|
||||
module.exports =
|
||||
class ContextMenuManager
|
||||
# Private:
|
||||
constructor: (@devMode=false) ->
|
||||
@definitions = {}
|
||||
@devModeDefinitions = {}
|
||||
|
||||
@@ -45,11 +45,9 @@ class Cursor
|
||||
@emit 'destroyed'
|
||||
@needsAutoscroll = true
|
||||
|
||||
# Private:
|
||||
destroy: ->
|
||||
@marker.destroy()
|
||||
|
||||
# Private:
|
||||
changePosition: (options, fn) ->
|
||||
@clearSelection()
|
||||
@needsAutoscroll = options.autoscroll ? @isLastCursor()
|
||||
|
||||
@@ -134,13 +134,11 @@ class Directory
|
||||
async.eachLimit entries, 1, statEntry, ->
|
||||
callback(null, directories.concat(files))
|
||||
|
||||
# Private:
|
||||
subscribeToNativeChangeEvents: ->
|
||||
unless @watchSubscription?
|
||||
@watchSubscription = pathWatcher.watch @path, (eventType) =>
|
||||
@emit "contents-changed" if eventType is "change"
|
||||
|
||||
# Private:
|
||||
unsubscribeFromNativeChangeEvents: ->
|
||||
if @watchSubscription?
|
||||
@watchSubscription.close()
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
_ = require 'underscore-plus'
|
||||
{Emitter, Subscriber} = require 'emissary'
|
||||
|
||||
# Private:
|
||||
module.exports =
|
||||
class DisplayBufferMarker
|
||||
Emitter.includeInto(this)
|
||||
|
||||
@@ -11,7 +11,6 @@ Token = require './token'
|
||||
DisplayBufferMarker = require './display-buffer-marker'
|
||||
ConfigObserver = require './config-observer'
|
||||
|
||||
# Private:
|
||||
module.exports =
|
||||
class DisplayBuffer extends Model
|
||||
Serializable.includeInto(this)
|
||||
|
||||
@@ -97,7 +97,6 @@ class Editor extends Model
|
||||
params.registerEditor = true
|
||||
params
|
||||
|
||||
# Private:
|
||||
subscribeToBuffer: ->
|
||||
@buffer.retain()
|
||||
@subscribe @buffer, "path-changed", =>
|
||||
@@ -111,7 +110,6 @@ class Editor extends Model
|
||||
@subscribe @buffer, "destroyed", => @destroy()
|
||||
@preserveCursorPositionOnBufferReload()
|
||||
|
||||
# Private:
|
||||
subscribeToDisplayBuffer: ->
|
||||
@subscribe @displayBuffer, 'marker-created', @handleMarkerCreated
|
||||
@subscribe @displayBuffer, "changed", (e) => @emit 'screen-lines-changed', e
|
||||
@@ -119,11 +117,9 @@ class Editor extends Model
|
||||
@subscribe @displayBuffer, 'grammar-changed', => @handleGrammarChange()
|
||||
@subscribe @displayBuffer, 'soft-wrap-changed', (args...) => @emit 'soft-wrap-changed', args...
|
||||
|
||||
# Private:
|
||||
getViewClass: ->
|
||||
require './editor-view'
|
||||
|
||||
# Private:
|
||||
destroyed: ->
|
||||
@unsubscribe()
|
||||
selection.destroy() for selection in @getSelections()
|
||||
@@ -737,11 +733,9 @@ class Editor extends Model
|
||||
@setCursorScreenPosition(@getCursorScreenPosition().translate([1]))
|
||||
@foldCurrentRow() if cursorRowFolded
|
||||
|
||||
# Private:
|
||||
mutateSelectedText: (fn) ->
|
||||
@transact => fn(selection) for selection in @getSelections()
|
||||
|
||||
# Private:
|
||||
replaceSelectedText: (options={}, fn) ->
|
||||
{selectWordIfEmpty} = options
|
||||
@mutateSelectedText (selection) ->
|
||||
@@ -1315,7 +1309,6 @@ class Editor extends Model
|
||||
|
||||
_.reduce(@getSelections(), reducer, [])
|
||||
|
||||
# Private:
|
||||
preserveCursorPositionOnBufferReload: ->
|
||||
cursorPosition = null
|
||||
@subscribe @buffer, "will-reload", =>
|
||||
@@ -1336,7 +1329,6 @@ class Editor extends Model
|
||||
reloadGrammar: ->
|
||||
@displayBuffer.reloadGrammar()
|
||||
|
||||
# Private:
|
||||
shouldAutoIndent: ->
|
||||
atom.config.get("editor.autoIndent")
|
||||
|
||||
@@ -1347,32 +1339,24 @@ class Editor extends Model
|
||||
# undo stack remains relevant.
|
||||
transact: (fn) -> @buffer.transact(fn)
|
||||
|
||||
# Private:
|
||||
beginTransaction: -> @buffer.beginTransaction()
|
||||
|
||||
# Private:
|
||||
commitTransaction: -> @buffer.commitTransaction()
|
||||
|
||||
# Private:
|
||||
abortTransaction: -> @buffer.abortTransaction()
|
||||
|
||||
# Private:
|
||||
inspect: ->
|
||||
"<Editor #{@id}>"
|
||||
|
||||
# Private:
|
||||
logScreenLines: (start, end) -> @displayBuffer.logLines(start, end)
|
||||
|
||||
# Private:
|
||||
handleGrammarChange: ->
|
||||
@unfoldAll()
|
||||
@emit 'grammar-changed'
|
||||
|
||||
# Private:
|
||||
handleMarkerCreated: (marker) =>
|
||||
if marker.matchesAttributes(@getSelectionMarkerAttributes())
|
||||
@addSelection(marker)
|
||||
|
||||
# Private:
|
||||
getSelectionMarkerAttributes: ->
|
||||
type: 'selection', editorId: @id, invalidate: 'never'
|
||||
|
||||
Reference in New Issue
Block a user