mirror of
https://github.com/atom/atom.git
synced 2026-01-24 14:28:14 -05:00
Merge remote-tracking branch 'origin/master' into mkt-updoot-github-0.3.5
This commit is contained in:
@@ -22,7 +22,7 @@ install:
|
||||
- source /tmp/.nvm/nvm.sh
|
||||
- nvm install $NODE_VERSION
|
||||
- nvm use --delete-prefix $NODE_VERSION
|
||||
- npm install -g npm
|
||||
- npm install -g npm@5.1.0
|
||||
- script/build --create-debian-package --create-rpm-package --compress-artifacts
|
||||
|
||||
script:
|
||||
|
||||
@@ -20,7 +20,7 @@ environment:
|
||||
ATOM_DEV_RESOURCE_PATH: c:\projects\atom
|
||||
|
||||
matrix:
|
||||
- NODE_VERSION: 6.8.0
|
||||
- NODE_VERSION: 6.9.4
|
||||
|
||||
matrix:
|
||||
fast_finish: true
|
||||
@@ -28,7 +28,7 @@ matrix:
|
||||
install:
|
||||
- SET PATH=C:\Program Files\Atom\resources\cli;%PATH%
|
||||
- ps: Install-Product node $env:NODE_VERSION $env:PLATFORM
|
||||
- npm install -g npm
|
||||
- npm install -g npm@5.1.0
|
||||
|
||||
build_script:
|
||||
- IF NOT EXIST C:\sqtemp MKDIR C:\sqtemp
|
||||
|
||||
@@ -18,7 +18,7 @@ dependencies:
|
||||
- curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.3/install.sh | bash
|
||||
- nvm install 6.9.4
|
||||
- nvm use 6.9.4
|
||||
- npm install -g npm
|
||||
- npm install -g npm@5.1.0
|
||||
|
||||
override:
|
||||
- script/build --code-sign --compress-artifacts
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
"about": "1.7.6",
|
||||
"archive-view": "0.63.3",
|
||||
"autocomplete-atom-api": "0.10.2",
|
||||
"autocomplete-css": "0.16.2",
|
||||
"autocomplete-css": "0.16.3",
|
||||
"autocomplete-html": "0.8.0",
|
||||
"autocomplete-plus": "2.35.7",
|
||||
"autocomplete-snippets": "1.11.0",
|
||||
@@ -102,7 +102,7 @@
|
||||
"dev-live-reload": "0.47.1",
|
||||
"encoding-selector": "0.23.4",
|
||||
"exception-reporting": "0.41.4",
|
||||
"find-and-replace": "0.209.1",
|
||||
"find-and-replace": "0.209.2",
|
||||
"fuzzy-finder": "1.5.8",
|
||||
"github": "0.3.7",
|
||||
"git-diff": "1.3.6",
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
"minidump": "0.9.0",
|
||||
"mkdirp": "0.5.1",
|
||||
"normalize-package-data": "2.3.5",
|
||||
"npm": "3.10.5",
|
||||
"npm": "5.1.0",
|
||||
"passwd-user": "2.1.0",
|
||||
"pegjs": "0.9.0",
|
||||
"runas": "3.1.1",
|
||||
|
||||
@@ -9,6 +9,10 @@ describe('TextEditorElement', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
jasmineContent = document.body.querySelector('#jasmine-content')
|
||||
// Force scrollbars to be visible regardless of local system configuration
|
||||
const scrollbarStyle = document.createElement('style')
|
||||
scrollbarStyle.textContent = '::-webkit-scrollbar { -webkit-appearance: none }'
|
||||
jasmine.attachToDOM(scrollbarStyle)
|
||||
})
|
||||
|
||||
function buildTextEditorElement (options = {}) {
|
||||
@@ -201,6 +205,33 @@ describe('TextEditorElement', () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe('::setModel', () => {
|
||||
describe('when the element does not have an editor yet', () => {
|
||||
it('uses the supplied one', () => {
|
||||
const element = buildTextEditorElement({attach: false})
|
||||
const editor = new TextEditor()
|
||||
element.setModel(editor)
|
||||
jasmine.attachToDOM(element)
|
||||
expect(editor.element).toBe(element)
|
||||
expect(element.getModel()).toBe(editor)
|
||||
})
|
||||
})
|
||||
|
||||
describe('when the element already has an editor', () => {
|
||||
it('unbinds it and then swaps it with the supplied one', async () => {
|
||||
const element = buildTextEditorElement({attach: true})
|
||||
const previousEditor = element.getModel()
|
||||
expect(previousEditor.element).toBe(element)
|
||||
|
||||
const newEditor = new TextEditor()
|
||||
element.setModel(newEditor)
|
||||
expect(previousEditor.element).not.toBe(element)
|
||||
expect(newEditor.element).toBe(element)
|
||||
expect(element.getModel()).toBe(newEditor)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('::onDidAttach and ::onDidDetach', () =>
|
||||
it('invokes callbacks when the element is attached and detached', () => {
|
||||
const element = buildTextEditorElement({attach: false})
|
||||
|
||||
@@ -938,8 +938,8 @@ class AtomEnvironment extends Model
|
||||
"Would you like to add the #{nouns} to this window, permanently discarding the saved state, " +
|
||||
"or open the #{nouns} in a new window, restoring the saved state?"
|
||||
buttons: [
|
||||
'Open in new window and recover state'
|
||||
'Add to this window and discard state'
|
||||
'&Open in new window and recover state'
|
||||
'&Add to this window and discard state'
|
||||
]
|
||||
if btn is 0
|
||||
@open
|
||||
|
||||
@@ -54,14 +54,14 @@ class AtomWindow
|
||||
@browserWindow = new BrowserWindow(options)
|
||||
@handleEvents()
|
||||
|
||||
loadSettings = Object.assign({}, settings)
|
||||
loadSettings.appVersion = app.getVersion()
|
||||
loadSettings.resourcePath = @resourcePath
|
||||
loadSettings.devMode ?= false
|
||||
loadSettings.safeMode ?= false
|
||||
loadSettings.atomHome = process.env.ATOM_HOME
|
||||
loadSettings.clearWindowState ?= false
|
||||
loadSettings.initialPaths ?=
|
||||
@loadSettings = Object.assign({}, settings)
|
||||
@loadSettings.appVersion = app.getVersion()
|
||||
@loadSettings.resourcePath = @resourcePath
|
||||
@loadSettings.devMode ?= false
|
||||
@loadSettings.safeMode ?= false
|
||||
@loadSettings.atomHome = process.env.ATOM_HOME
|
||||
@loadSettings.clearWindowState ?= false
|
||||
@loadSettings.initialPaths ?=
|
||||
for {pathToOpen} in locationsToOpen when pathToOpen
|
||||
stat = fs.statSyncNoException(pathToOpen) or null
|
||||
if stat?.isDirectory()
|
||||
@@ -72,17 +72,17 @@ class AtomWindow
|
||||
parentDirectory
|
||||
else
|
||||
pathToOpen
|
||||
loadSettings.initialPaths.sort()
|
||||
@loadSettings.initialPaths.sort()
|
||||
|
||||
# Only send to the first non-spec window created
|
||||
if @constructor.includeShellLoadTime and not @isSpec
|
||||
@constructor.includeShellLoadTime = false
|
||||
loadSettings.shellLoadTime ?= Date.now() - global.shellStartTime
|
||||
@loadSettings.shellLoadTime ?= Date.now() - global.shellStartTime
|
||||
|
||||
@representedDirectoryPaths = loadSettings.initialPaths
|
||||
@env = loadSettings.env if loadSettings.env?
|
||||
@representedDirectoryPaths = @loadSettings.initialPaths
|
||||
@env = @loadSettings.env if @loadSettings.env?
|
||||
|
||||
@browserWindow.loadSettingsJSON = JSON.stringify(loadSettings)
|
||||
@browserWindow.loadSettingsJSON = JSON.stringify(@loadSettings)
|
||||
|
||||
@browserWindow.on 'window:loaded', =>
|
||||
@disableZoom()
|
||||
@@ -309,6 +309,8 @@ class AtomWindow
|
||||
|
||||
setRepresentedDirectoryPaths: (@representedDirectoryPaths) ->
|
||||
@representedDirectoryPaths.sort()
|
||||
@loadSettings.initialPaths = @representedDirectoryPaths
|
||||
@browserWindow.loadSettingsJSON = JSON.stringify(@loadSettings)
|
||||
@atomApplication.saveState()
|
||||
|
||||
copy: -> @browserWindow.copy()
|
||||
|
||||
@@ -662,7 +662,7 @@ class Pane
|
||||
chosen = @applicationDelegate.confirm
|
||||
message: message
|
||||
detailedMessage: "Your changes will be lost if you close this item without saving."
|
||||
buttons: [saveButtonText, "Cancel", "Don't Save"]
|
||||
buttons: [saveButtonText, "Cancel", "&Don't Save"]
|
||||
switch chosen
|
||||
when 0
|
||||
new Promise (resolve) ->
|
||||
|
||||
@@ -174,6 +174,10 @@ class TextEditorComponent {
|
||||
}
|
||||
|
||||
update (props) {
|
||||
if (props.model !== this.props.model) {
|
||||
this.props.model.component = null
|
||||
props.model.component = this
|
||||
}
|
||||
this.props = props
|
||||
this.scheduleUpdate()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user