mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Merge branch 'master' into wl-electron-35
This commit is contained in:
@@ -896,8 +896,6 @@ class AtomEnvironment extends Model
|
||||
else
|
||||
@project.addPath(pathToOpen)
|
||||
|
||||
@applicationDelegate.addRecentDocument(pathToOpen)
|
||||
|
||||
unless fs.isDirectorySync(pathToOpen)
|
||||
@workspace?.open(pathToOpen, {initialLine, initialColumn})
|
||||
|
||||
|
||||
@@ -139,7 +139,7 @@ addCommandsToPath = (callback) ->
|
||||
|
||||
atomShCommandPath = path.join(binFolder, 'atom')
|
||||
relativeAtomShPath = path.relative(binFolder, path.join(appFolder, 'resources', 'cli', 'atom.sh'))
|
||||
atomShCommand = "#!/bin/sh\r\n\"$(dirname \"$0\")/#{relativeAtomShPath.replace(/\\/g, '/')}\" \"$@\""
|
||||
atomShCommand = "#!/bin/sh\r\n\"$(dirname \"$0\")/#{relativeAtomShPath.replace(/\\/g, '/')}\" \"$@\"\r\necho"
|
||||
|
||||
apmCommandPath = path.join(binFolder, 'apm.cmd')
|
||||
relativeApmPath = path.relative(binFolder, path.join(process.resourcesPath, 'app', 'apm', 'bin', 'apm.cmd'))
|
||||
|
||||
@@ -203,22 +203,6 @@ ScopeDescriptor = require './scope-descriptor'
|
||||
# maximum: 11.5
|
||||
# ```
|
||||
#
|
||||
# #### object
|
||||
#
|
||||
# Value must be an object. This allows you to nest config options. Sub options
|
||||
# must be under a `properties key`
|
||||
#
|
||||
# ```coffee
|
||||
# config:
|
||||
# someSetting:
|
||||
# type: 'object'
|
||||
# properties:
|
||||
# myChildIntOption:
|
||||
# type: 'integer'
|
||||
# minimum: 1.5
|
||||
# maximum: 11.5
|
||||
# ```
|
||||
#
|
||||
# #### color
|
||||
#
|
||||
# Values will be coerced into a {Color} with `red`, `green`, `blue`, and `alpha`
|
||||
@@ -234,6 +218,23 @@ ScopeDescriptor = require './scope-descriptor'
|
||||
# default: 'white'
|
||||
# ```
|
||||
#
|
||||
# #### object / Grouping other types
|
||||
#
|
||||
# A config setting with the type `object` allows grouping a set of config
|
||||
# settings. The group will be visualy separated and has its own group headline.
|
||||
# The sub options must be listed under a `properties` key.
|
||||
#
|
||||
# ```coffee
|
||||
# config:
|
||||
# someSetting:
|
||||
# type: 'object'
|
||||
# properties:
|
||||
# myChildIntOption:
|
||||
# type: 'integer'
|
||||
# minimum: 1.5
|
||||
# maximum: 11.5
|
||||
# ```
|
||||
#
|
||||
# ### Other Supported Keys
|
||||
#
|
||||
# #### enum
|
||||
@@ -292,6 +293,9 @@ ScopeDescriptor = require './scope-descriptor'
|
||||
#
|
||||
# Descriptions will be displayed below the title in the settings view.
|
||||
#
|
||||
# For a group of config settings the humanized key or the title and the
|
||||
# description are used for the group headline.
|
||||
#
|
||||
# ```coffee
|
||||
# config:
|
||||
# someSetting:
|
||||
|
||||
@@ -551,7 +551,7 @@ class Cursor extends Model
|
||||
|
||||
# Public: Retrieves the range for the current paragraph.
|
||||
#
|
||||
# A paragraph is defined as a block of text surrounded by empty lines.
|
||||
# A paragraph is defined as a block of text surrounded by empty lines or comments.
|
||||
#
|
||||
# Returns a {Range}.
|
||||
getCurrentParagraphBufferRange: ->
|
||||
|
||||
@@ -74,6 +74,8 @@ class WorkspaceElement extends HTMLElement
|
||||
left: @views.getView(@model.panelContainers.left)
|
||||
right: @views.getView(@model.panelContainers.right)
|
||||
bottom: @views.getView(@model.panelContainers.bottom)
|
||||
header: @views.getView(@model.panelContainers.header)
|
||||
footer: @views.getView(@model.panelContainers.footer)
|
||||
modal: @views.getView(@model.panelContainers.modal)
|
||||
|
||||
@horizontalAxis.insertBefore(@panelContainers.left, @verticalAxis)
|
||||
@@ -82,6 +84,9 @@ class WorkspaceElement extends HTMLElement
|
||||
@verticalAxis.insertBefore(@panelContainers.top, @paneContainer)
|
||||
@verticalAxis.appendChild(@panelContainers.bottom)
|
||||
|
||||
@insertBefore(@panelContainers.header, @horizontalAxis)
|
||||
@appendChild(@panelContainers.footer)
|
||||
|
||||
@appendChild(@panelContainers.modal)
|
||||
|
||||
this
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
_ = require 'underscore-plus'
|
||||
url = require 'url'
|
||||
path = require 'path'
|
||||
{join} = path
|
||||
{Emitter, Disposable, CompositeDisposable} = require 'event-kit'
|
||||
@@ -47,6 +48,8 @@ class Workspace extends Model
|
||||
left: new PanelContainer({location: 'left'})
|
||||
right: new PanelContainer({location: 'right'})
|
||||
bottom: new PanelContainer({location: 'bottom'})
|
||||
header: new PanelContainer({location: 'header'})
|
||||
footer: new PanelContainer({location: 'footer'})
|
||||
modal: new PanelContainer({location: 'modal'})
|
||||
|
||||
@subscribeToEvents()
|
||||
@@ -66,6 +69,8 @@ class Workspace extends Model
|
||||
left: new PanelContainer({location: 'left'})
|
||||
right: new PanelContainer({location: 'right'})
|
||||
bottom: new PanelContainer({location: 'bottom'})
|
||||
header: new PanelContainer({location: 'header'})
|
||||
footer: new PanelContainer({location: 'footer'})
|
||||
modal: new PanelContainer({location: 'modal'})
|
||||
|
||||
@originalFontSize = null
|
||||
@@ -409,6 +414,11 @@ class Workspace extends Model
|
||||
split = options.split
|
||||
uri = @project.resolvePath(uri)
|
||||
|
||||
# Avoid adding URLs as recent documents to work-around this Spotlight crash:
|
||||
# https://github.com/atom/atom/issues/10071
|
||||
if uri? and not url.parse(uri).protocol?
|
||||
@applicationDelegate.addRecentDocument(uri)
|
||||
|
||||
pane = @paneContainer.paneForURI(uri) if searchAllPanes
|
||||
pane ?= switch split
|
||||
when 'left'
|
||||
@@ -834,6 +844,44 @@ class Workspace extends Model
|
||||
addTopPanel: (options) ->
|
||||
@addPanel('top', options)
|
||||
|
||||
# Essential: Get an {Array} of all the panel items in the header.
|
||||
getHeaderPanels: ->
|
||||
@getPanels('header')
|
||||
|
||||
# Essential: Adds a panel item to the header.
|
||||
#
|
||||
# * `options` {Object}
|
||||
# * `item` Your panel content. It can be DOM element, a jQuery element, or
|
||||
# a model with a view registered via {ViewRegistry::addViewProvider}. We recommend the
|
||||
# latter. See {ViewRegistry::addViewProvider} for more information.
|
||||
# * `visible` (optional) {Boolean} false if you want the panel to initially be hidden
|
||||
# (default: true)
|
||||
# * `priority` (optional) {Number} Determines stacking order. Lower priority items are
|
||||
# forced closer to the edges of the window. (default: 100)
|
||||
#
|
||||
# Returns a {Panel}
|
||||
addHeaderPanel: (options) ->
|
||||
@addPanel('header', options)
|
||||
|
||||
# Essential: Get an {Array} of all the panel items in the footer.
|
||||
getFooterPanels: ->
|
||||
@getPanels('footer')
|
||||
|
||||
# Essential: Adds a panel item to the footer.
|
||||
#
|
||||
# * `options` {Object}
|
||||
# * `item` Your panel content. It can be DOM element, a jQuery element, or
|
||||
# a model with a view registered via {ViewRegistry::addViewProvider}. We recommend the
|
||||
# latter. See {ViewRegistry::addViewProvider} for more information.
|
||||
# * `visible` (optional) {Boolean} false if you want the panel to initially be hidden
|
||||
# (default: true)
|
||||
# * `priority` (optional) {Number} Determines stacking order. Lower priority items are
|
||||
# forced closer to the edges of the window. (default: 100)
|
||||
#
|
||||
# Returns a {Panel}
|
||||
addFooterPanel: (options) ->
|
||||
@addPanel('footer', options)
|
||||
|
||||
# Essential: Get an {Array} of all the modal panel items
|
||||
getModalPanels: ->
|
||||
@getPanels('modal')
|
||||
|
||||
Reference in New Issue
Block a user