Merge remote-tracking branch 'remotes/origin/master' into dh-async-repo

This commit is contained in:
Daniel Hengeveld
2015-10-28 11:58:42 +01:00
16 changed files with 290 additions and 133 deletions

View File

@@ -2,26 +2,78 @@
:+1::tada: First off, thanks for taking the time to contribute! :tada::+1:
The following is a set of guidelines for contributing to Atom and its packages,
which are hosted in the [Atom Organization](https://github.com/atom) on GitHub.
These are just guidelines, not rules, use your best judgment and feel free to
propose changes to this document in a pull request.
This project adheres to the [Contributor Covenant 1.2](http://contributor-covenant.org/version/1/2/0).
By participating, you are expected to uphold this code. Please report unacceptable behavior to [atom@github.com](mailto:atom@github.com).
The following is a set of guidelines for contributing to Atom and its packages, which are hosted in the [Atom Organization](https://github.com/atom) on GitHub.
These are just guidelines, not rules, use your best judgment and feel free to propose changes to this document in a pull request.
#### Table Of Contents
* [Submitting Issues](#submitting-issues)
* [Your First Contribution](#your-first-contribution)
* [Pull Requests](#pull-requests)
* [Git Commit Messages](#git-commit-messages)
* [CoffeeScript Styleguide](#coffeescript-styleguide)
* [Specs Styleguide](#specs-styleguide)
* [Documentation Styleguide](#documentation-styleguide)
* [Issue and Pull Request Labels](#issue-and-pull-request-labels)
[What should I know before I get started?](#what-should-i-know-before-i-get-started)
* [Code of Conduct](#code-of-conduct)
* [Atom and Packages](#atom-and-packages)
## Submitting Issues
[How Can I Contribute?](#how-can-i-contribute)
* [Submitting Issues](#submitting-issues)
* [Your First Code Contribution](#your-first-code-contribution)
* [Pull Requests](#pull-requests)
[Styleguides](#styleguides)
* [Git Commit Messages](#git-commit-messages)
* [CoffeeScript Styleguide](#coffeescript-styleguide)
* [Specs Styleguide](#specs-styleguide)
* [Documentation Styleguide](#documentation-styleguide)
[Additional Notes](#additional-notes)
* [Issue and Pull Request Labels](#issue-and-pull-request-labels)
## What should I know before I get started?
### Code of Conduct
This project adheres to the [Contributor Covenant 1.2](http://contributor-covenant.org/version/1/2/0).
By participating, you are expected to uphold this code.
Please report unacceptable behavior to [atom@github.com](mailto:atom@github.com).
### Atom and Packages
Atom is a large open source project—it's made up of over [200 repositories](https://github.com/atom).
When you initially consider contributing to Atom, you might be unsure about which of those 200 repositories implements the functionality you want to change or report a bug for.
This section should help you with that.
Atom is intentionally very modular.
Nearly every non-editor UI element you interact with comes from a package, even fundamental things like tabs and the status-bar.
These packages are packages in the same way that packages in the [package store](https://atom.io/packages) are packages, with one difference: they are bundled into the [default distribution](https://github.com/atom/atom/blob/10b8de6fc499a7def9b072739486e68530d67ab4/package.json#L58).
![atom-packages](https://cloud.githubusercontent.com/assets/69169/10472281/84fc9792-71d3-11e5-9fd1-19da717df079.png)
To get a sense for the packages that are bundled with Atom, you can go to Settings > Packages within Atom and take a look at the Core Packages section.
Here's a list of the big ones:
* [atom/atom](https://github.com/atom/atom) - Atom Core! The core editor component is responsible for basic text editing (e.g. cursors, selections, scrolling), text indentation, wrapping, and folding, text rendering, editor rendering, file system operations (e.g. saving), and installation and auto-updating. You should also use this repository for feedback related to the [core API](https://atom.io/docs/api/latest/Notification) and for large, overarching design proposals.
* [tree-view](https://github.com/atom/tree-view) - file and directory listing on the left of the UI.
* [fuzzy-finder](https://github.com/atom/fuzzy-finder) - the quick file opener.
* [find-and-replace](https://github.com/atom/find-and-replace) - all search and replace functionality.
* [tabs](https://github.com/atom/tabs) - the tabs for open editors at the top of the UI.
* [status-bar](https://github.com/atom/status-bar) - the status bar at the bottom of the UI.
* [markdown-preview](https://github.com/atom/markdown-preview) - the rendered markdown pane item.
* [settings-view](https://github.com/atom/settings-view) - the settings UI pane item.
* [autocomplete-plus](https://github.com/atom/autocomplete-plus) - autocompletions shown while typing. Some languages have additional packages for autocompletion functionality, such as [autocomplete-html](https://github.com/atom/autocomplete-html).
* [git-diff](https://github.com/atom/git-diff) - Git change indicators shown in the editor's gutter.
* [language-javascript](https://github.com/atom/language-javascript) - all bundled languages are packages too, and each one has a separate package `language-[name]`. Use these for feedback on syntax highlighting issues that only appear for a specific language.
* [one-dark-ui](https://github.com/atom/one-dark-ui) - the default UI styling for anything but the text editor. UI theme packages (i.e. packages with a `-ui` suffix) provide only styling and it's possible that a bundled package is responsible for a UI issue. There are other other bundled UI themes, such as [one-light-ui](https://github.com/atom/one-light-ui).
* [one-dark-syntax](https://github.com/atom/one-dark-syntax) - the default syntax highlighting styles applied for all languages. There are other other bundled syntax themes, such as [solarized-dark](https://github.com/atom/solarized-dark). You should use these packages for reporting issues that appear in many languages, but disappear if you change to another syntax theme.
* [apm](https://github.com/atom/apm) - the `apm` command line tool (Atom Package Manager). You should use this repository for any contributions related to the `apm` tool and to publishing packages.
* [atom.io](https://github.com/atom/atom.io) - the repository for feedback on the [Atom.io website](https://atom.io) and the [Atom.io package API](https://github.com/atom/atom/blob/master/docs/apm-rest-api.md) used by [apm](https://github.com/atom/apm).
There are many more, but this list should be a good starting point.
For more information on how to work with Atom's official packages, see [Contributing to Atom Packages](https://github.com/atom/atom/blob/master/docs/contributing-to-packages.md).
Also, because Atom is so extensible, it's possible that a feature you've become accustomed to in Atom or an issue you're encountering aren't coming from a bundled package at all, but rather a [community package](https://atom.io/packages) you've installed.
Each community package has its own repository too, and you should be able to find it in Settings > Packages for the packages you installed and contribute there.
## How can I contribute?
### Submitting Issues
* You can create an issue [here](https://github.com/atom/atom/issues/new), but
before doing that please read the notes below on debugging and submitting issues,
@@ -44,31 +96,16 @@ By participating, you are expected to uphold this code. Please report unacceptab
* Please setup a [profile picture](https://help.github.com/articles/how-do-i-set-up-my-profile-picture)
to make yourself recognizable and so we can all get to know each other better.
### Package Repositories
This is the repository for the core Atom editor only. Atom comes bundled with
many packages and themes that are stored in other repos under the
[Atom organization](https://github.com/atom) such as
[tabs](https://github.com/atom/tabs),
[find-and-replace](https://github.com/atom/find-and-replace),
[language-javascript](https://github.com/atom/language-javascript), and
[atom-light-ui](https://github.com/atom/atom-light-ui).
If your issue is related to a specific package, open an issue on that package's
issue tracker. If you're unsure which package is causing your problem or if
you're having an issue with Atom core, open an issue on this repository.
For more information on how to work with Atom's official packages, see
[Contributing to Atom Packages](https://github.com/atom/atom/blob/master/docs/contributing-to-packages.md)
## Your First Contribution
### Your First Code Contribution
Unsure where to begin contributing to Atom? You can start by looking through these `beginner` and `help-wanted` issues:
* [Beginner issues][beginner]
* [Help wanted issues][help-wanted]
* [Beginner issues][beginner] - issues which should only require a few lines of code, and a test or two.
* [Help wanted issues][help-wanted] - issues which should be a bit more involved than `beginner` issues.
## Pull Requests
Both issue lists are sorted by total number of comments. While not perfect, number of comments is a reasonable proxy for impact a given change will have.
### Pull Requests
* Include screenshots and animated GIFs in your pull request whenever possible.
* Follow the [CoffeeScript](#coffeescript-styleguide),
@@ -94,7 +131,9 @@ Unsure where to begin contributing to Atom? You can start by looking through the
* Using a plain `return` when returning explicitly at the end of a function.
* Not `return null`, `return undefined`, `null`, or `undefined`
## Git Commit Messages
## Styleguides
### Git Commit Messages
* Use the present tense ("Add feature" not "Added feature")
* Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
@@ -117,7 +156,7 @@ Unsure where to begin contributing to Atom? You can start by looking through the
* :arrow_down: `:arrow_down:` when downgrading dependencies
* :shirt: `:shirt:` when removing linter warnings
## CoffeeScript Styleguide
### CoffeeScript Styleguide
* Set parameter defaults without spaces around the equal sign
* `clear = (count=1) ->` instead of `clear = (count = 1) ->`
@@ -140,14 +179,14 @@ Unsure where to begin contributing to Atom? You can start by looking through the
* Use `this` instead of a standalone `@`
* `return this` instead of `return @`
## Specs Styleguide
### Specs Styleguide
- Include thoughtfully-worded, well-structured
[Jasmine](http://jasmine.github.io/) specs in the `./spec` folder.
- treat `describe` as a noun or situation.
- treat `it` as a statement about state or how an operation changes state.
### Example
#### Example
```coffee
describe 'a dog', ->
@@ -158,7 +197,7 @@ describe 'a dog', ->
# spec here
```
## Documentation Styleguide
### Documentation Styleguide
* Use [AtomDoc](https://github.com/atom/atomdoc).
* Use [Markdown](https://daringfireball.net/projects/markdown).
@@ -167,7 +206,7 @@ describe 'a dog', ->
* Reference instance methods with `{ClassName::methodName}`
* Reference class methods with `{ClassName.methodName}`
### Example
#### Example
```coffee
# Public: Disable the package with the given name.
@@ -182,7 +221,9 @@ describe 'a dog', ->
disablePackage: (name, options, callback) ->
```
## Issue and Pull Request Labels
## Additional Notes
### Issue and Pull Request Labels
This section lists the labels we use to help us track and manage issues and pull requests. Most labels are used across all Atom repositories, but some are specific to `atom/atom`.

View File

@@ -22,7 +22,7 @@
"grunt-contrib-less": "~0.8.0",
"grunt-cson": "0.16.0",
"grunt-download-electron": "^2.1.1",
"grunt-electron-installer": "1.0.5",
"grunt-electron-installer": "1.0.6",
"grunt-lesslint": "0.17.0",
"grunt-peg": "~1.1.0",
"grunt-shell": "~0.3.1",

View File

@@ -6,7 +6,6 @@ async = require 'async'
fs = require 'fs-plus'
GitHub = require 'github-releases'
request = require 'request'
{convertVersion} = require 'grunt-electron-installer'
grunt = null
@@ -79,9 +78,8 @@ getAssets = ->
{assetName: 'atom-api.json', sourcePath: 'atom-api.json'}
]
when 'win32'
nupkgVersion = convertVersion(version)
assets = [{assetName: 'atom-windows.zip', sourcePath: appName}]
for squirrelAsset in ['AtomSetup.exe', 'RELEASES', "atom-#{nupkgVersion}-full.nupkg", "atom-#{nupkgVersion}-delta.nupkg"]
for squirrelAsset in ['AtomSetup.exe', 'RELEASES', "atom-#{version}-full.nupkg", "atom-#{version}-delta.nupkg"]
cp path.join(buildDir, 'installer', squirrelAsset), path.join(buildDir, squirrelAsset)
assets.push({assetName: squirrelAsset, sourcePath: assetName})
assets

View File

@@ -2,40 +2,33 @@
## Requirements
### On Windows 7
* [Visual C++ 2010 Express](http://www.visualstudio.com/en-us/downloads/download-visual-studio-vs#DownloadFamilies_4)
* [Visual Studio 2010 Service Pack 1](http://www.microsoft.com/en-us/download/details.aspx?id=23691)
* [Node.js](http://nodejs.org/download/) (0.10.x or above)
* For 64-bit builds of node and native modules you **must** have the
[Windows 7 64-bit SDK](http://www.microsoft.com/en-us/download/details.aspx?id=8279).
You may also need the [compiler update for the Windows SDK 7.1](http://www.microsoft.com/en-us/download/details.aspx?id=4422)
* [Python](https://www.python.org/downloads/) v2.7.
### General
* [Node.js](http://nodejs.org/en/download/) v4.x
* [Python](https://www.python.org/downloads/) v2.7.x
* The python.exe must be available at `%SystemDrive%\Python27\python.exe`.
If it is installed elsewhere, you can create a symbolic link to the
directory containing the python.exe using:
`mklink /d %SystemDrive%\Python27 D:\elsewhere\Python27`
* [GitHub Desktop](http://desktop.github.com/)
### On Windows 7
* [Visual Studio 2013 Update 5](http://www.visualstudio.com/en-us/downloads/download-visual-studio-vs#DownloadFamilies_4)
### On Windows 8 or 10
* [Visual Studio Express 2013 or 2015 for Windows Desktop](http://www.visualstudio.com/en-us/downloads/download-visual-studio-vs#DownloadFamilies_2)
* For VS 2015, be sure to customize the installation to include Visual C++. It's not installed by default.
* Some have experienced issues with Node locating C++ on VS 2015. If so, try VS 2013.
* [Node.js](http://nodejs.org/download/) (0.10.x or above)
* [Python](https://www.python.org/downloads/) v2.7.x (required by [node-gyp](https://github.com/TooTallNate/node-gyp))
* [GitHub Desktop](http://desktop.github.com/)
* To ensure that node-gyp knows what version of Visual Studio is installed, set the `GYP_MSVS_VERSION` environment variable to the Visual Studio version (e.g. `2013` or `2015`)
## Instructions
```bash
# Use the `Git Shell` program which was installed by GitHub Desktop.
# Also make sure that you are logged into GitHub Desktop.
# Use the Git Shell program which was installed by GitHub Desktop
cd C:\
git clone https://github.com/atom/atom/
cd atom
script/build # Creates application in the `Program Files` directory
```
Note: If you use cmd or Powershell instead of the Git shell, use a backslash instead: i.e. `script\build`.
We will assume the git shell for these instructions.
Note: If you use cmd or Powershell instead of Git Shell, use a backslash instead: i.e. `script\build`.
These instructions will assume the use of Git Shell.
### `script/build` Options
* `--install-dir` - Creates the final built application in this directory.
@@ -51,7 +44,6 @@ Note that you may have to open your command window as administrator. For powersh
If none of this works, do install Github Desktop and use its Git shell. Makes life easier.
## Troubleshooting
### Common Errors
@@ -67,31 +59,29 @@ If none of this works, do install Github Desktop and use its Git shell. Makes li
* `error MSB4025: The project file could not be loaded. Invalid character in the given encoding.`
* These can occur because your home directory (`%USERPROFILE%`) has non-ASCII
* This can occur because your home directory (`%USERPROFILE%`) has non-ASCII
characters in it. This is a bug in [gyp](https://code.google.com/p/gyp/)
which is used to build native node modules and there is no known workaround.
* https://github.com/TooTallNate/node-gyp/issues/297
* https://code.google.com/p/gyp/issues/detail?id=393
* `script/build` stops at installing runas with 'Failed at the runas@x.y.z install script.'
* `script/build` stops at installing runas with `Failed at the runas@x.y.z install script.`
See the next item.
* See the next item.
* `error MSB8020: The build tools for Visual Studio 2010 (Platform Toolset = 'v100') cannot be found.`
* If you're building atom with Visual Studio 2013 try executing the following
command in your Git shell and then re-run `script/build`:
* If you're building Atom with Visual Studio 2013 or above make sure the `GYP_MSVS_VERSION` environment variable is set, and then re-run `script/build`:
```bash
$env:GYP_MSVS_VERSION='2013' # '2015' if using Visual Studio 2015, and so on
script/build
```
$env:GYP_MSVS_VERSION=2013
```
* If you are using Visual Studio 2013 and the build fails with some other error message this environment variable might still be required.
* If you are using Visual Studio 2013 or above and the build fails with some other error message this environment variable might still be required.
* Other `node-gyp` errors on first build attempt, even though the right node and python versions are installed.
* Do try the build command one more time, as experience shows it often works on second try in many of these cases.
### Windows build error reports in atom/atom
* If all fails, use [this search](https://github.com/atom/atom/search?q=label%3Abuild-error+label%3Awindows&type=Issues) to get a list of reports about build errors on Windows, and see if yours has already been reported.
* If it hasn't, please open a new issue with your Windows version 32/64bit and a print/screenshot of your build output, incl. the node and python versions.
* If it hasn't, please open a new issue with your Windows version, architecture (x86 or amd64), and a screenshot of your build output, including the Node and Python versions.

View File

@@ -12,7 +12,7 @@
"url": "https://github.com/atom/atom/issues"
},
"license": "MIT",
"electronVersion": "0.33.6",
"electronVersion": "0.34.0",
"dependencies": {
"async": "0.2.6",
"atom-keymap": "^6.1.0",
@@ -23,7 +23,7 @@
"color": "^0.7.3",
"event-kit": "^1.3.0",
"find-parent-dir": "^0.3.0",
"first-mate": "^5.1.0",
"first-mate": "^5.1.1",
"fs-plus": "^2.8.0",
"fstream": "0.1.24",
"fuzzaldrin": "^2.1",
@@ -51,7 +51,6 @@
"semver": "^4.3.3",
"service-hub": "^0.7.0",
"source-map-support": "^0.3.2",
"stacktrace-parser": "0.1.1",
"temp": "0.8.1",
"text-buffer": "7.1.3",
"typescript-simple": "1.0.0",
@@ -86,51 +85,51 @@
"autosave": "0.23.0",
"background-tips": "0.26.0",
"bookmarks": "0.38.0",
"bracket-matcher": "0.78.0",
"bracket-matcher": "0.79.0",
"command-palette": "0.36.0",
"deprecation-cop": "0.54.0",
"dev-live-reload": "0.47.0",
"encoding-selector": "0.21.0",
"exception-reporting": "0.37.0",
"find-and-replace": "0.187.1",
"fuzzy-finder": "0.91.0",
"git-diff": "0.56.0",
"find-and-replace": "0.189.0",
"fuzzy-finder": "0.93.0",
"git-diff": "0.57.0",
"go-to-line": "0.30.0",
"grammar-selector": "0.47.0",
"grammar-selector": "0.48.0",
"image-view": "0.55.0",
"incompatible-packages": "0.25.0",
"keybinding-resolver": "0.33.0",
"line-ending-selector": "0.3.0",
"link": "0.31.0",
"markdown-preview": "0.155.0",
"markdown-preview": "0.156.0",
"metrics": "0.53.0",
"notifications": "0.60.0",
"open-on-github": "0.38.0",
"package-generator": "0.40.0",
"notifications": "0.61.0",
"open-on-github": "0.39.0",
"package-generator": "0.41.0",
"release-notes": "0.53.0",
"settings-view": "0.230.1",
"settings-view": "0.231.0",
"snippets": "0.101.0",
"spell-check": "0.61.1",
"spell-check": "0.62.0",
"status-bar": "0.80.0",
"styleguide": "0.44.0",
"symbols-view": "0.109.0",
"tabs": "0.85.0",
"styleguide": "0.45.0",
"symbols-view": "0.110.0",
"tabs": "0.87.0",
"timecop": "0.33.0",
"tree-view": "0.192.2",
"tree-view": "0.194.0",
"update-package-dependencies": "0.10.0",
"welcome": "0.31.0",
"whitespace": "0.31.0",
"welcome": "0.32.0",
"whitespace": "0.32.0",
"wrap-guide": "0.38.1",
"language-c": "0.49.0",
"language-clojure": "0.18.0",
"language-coffee-script": "0.42.0",
"language-coffee-script": "0.43.0",
"language-csharp": "0.11.0",
"language-css": "0.34.0",
"language-gfm": "0.81.0",
"language-git": "0.10.0",
"language-go": "0.39.0",
"language-html": "0.42.0",
"language-hyperlink": "0.14.0",
"language-hyperlink": "0.15.0",
"language-java": "0.16.0",
"language-javascript": "0.97.0",
"language-json": "0.17.1",

View File

@@ -292,17 +292,36 @@ describe "PaneContainer", ->
]
describe "::saveAll()", ->
it "saves all open pane items", ->
it "saves all modified pane items", ->
container = new PaneContainer(params)
pane1 = container.getRoot()
pane2 = pane1.splitRight()
pane1.addItem(item1 = {getURI: (-> ''), save: -> @saved = true})
pane1.addItem(item2 = {getURI: (-> ''), save: -> @saved = true})
pane2.addItem(item3 = {getURI: (-> ''), save: -> @saved = true})
item1 = {
saved: false
getURI: -> ''
isModified: -> true,
save: -> @saved = true
}
item2 = {
saved: false
getURI: -> ''
isModified: -> false,
save: -> @saved = true
}
item3 = {
saved: false
getURI: -> ''
isModified: -> true,
save: -> @saved = true
}
pane1.addItem(item1)
pane1.addItem(item2)
pane1.addItem(item3)
container.saveAll()
expect(item1.saved).toBe true
expect(item2.saved).toBe true
expect(item2.saved).toBe false
expect(item3.saved).toBe true

View File

@@ -4,7 +4,7 @@ describe "PaneElement", ->
[paneElement, container, pane] = []
beforeEach ->
spyOn(atom, "open")
spyOn(atom.applicationDelegate, "open")
container = new PaneContainer(config: atom.config, confirm: atom.confirm.bind(atom))
pane = container.getActivePane()
@@ -187,11 +187,11 @@ describe "PaneElement", ->
it "opens it", ->
event = buildDragEvent("drop", [{path: "/fake1"}, {path: "/fake2"}])
paneElement.dispatchEvent(event)
expect(atom.open.callCount).toBe 1
expect(atom.open.argsForCall[0][0]).toEqual pathsToOpen: ['/fake1', '/fake2']
expect(atom.applicationDelegate.open.callCount).toBe 1
expect(atom.applicationDelegate.open.argsForCall[0][0]).toEqual pathsToOpen: ['/fake1', '/fake2']
describe "when a non-file is dragged to the pane", ->
it "does nothing", ->
event = buildDragEvent("drop", [])
paneElement.dispatchEvent(event)
expect(atom.open).not.toHaveBeenCalled()
expect(atom.applicationDelegate.open).not.toHaveBeenCalled()

View File

@@ -293,6 +293,90 @@ describe "Workspace", ->
expect(workspace.paneContainer.root.children[0]).toBe pane1
expect(workspace.paneContainer.root.children[1]).toBe pane4
describe "when the 'split' option is 'up'", ->
it "opens the editor in the topmost pane of the current pane axis", ->
pane1 = workspace.getActivePane()
pane2 = pane1.splitDown()
expect(workspace.getActivePane()).toBe pane2
editor = null
waitsForPromise ->
workspace.open('a', split: 'up').then (o) -> editor = o
runs ->
expect(workspace.getActivePane()).toBe pane1
expect(pane1.items).toEqual [editor]
expect(pane2.items).toEqual []
# Focus bottom pane and reopen the file on the top
waitsForPromise ->
pane2.focus()
workspace.open('a', split: 'up').then (o) -> editor = o
runs ->
expect(workspace.getActivePane()).toBe pane1
expect(pane1.items).toEqual [editor]
expect(pane2.items).toEqual []
describe "when a pane axis is the topmost sibling of the current pane", ->
it "opens the new item in the current pane", ->
editor = null
pane1 = workspace.getActivePane()
pane2 = pane1.splitUp()
pane3 = pane2.splitRight()
pane1.activate()
expect(workspace.getActivePane()).toBe pane1
waitsForPromise ->
workspace.open('a', split: 'up').then (o) -> editor = o
runs ->
expect(workspace.getActivePane()).toBe pane1
expect(pane1.items).toEqual [editor]
describe "when the 'split' option is 'down'", ->
it "opens the editor in the bottommost pane of the current pane axis", ->
editor = null
pane1 = workspace.getActivePane()
pane2 = null
waitsForPromise ->
workspace.open('a', split: 'down').then (o) -> editor = o
runs ->
pane2 = workspace.getPanes().filter((p) -> p isnt pane1)[0]
expect(workspace.getActivePane()).toBe pane2
expect(pane1.items).toEqual []
expect(pane2.items).toEqual [editor]
# Focus bottom pane and reopen the file on the right
waitsForPromise ->
pane1.focus()
workspace.open('a', split: 'down').then (o) -> editor = o
runs ->
expect(workspace.getActivePane()).toBe pane2
expect(pane1.items).toEqual []
expect(pane2.items).toEqual [editor]
describe "when a pane axis is the bottommost sibling of the current pane", ->
it "opens the new item in a new pane split to the bottom of the current pane", ->
editor = null
pane1 = workspace.getActivePane()
pane2 = pane1.splitDown()
pane1.activate()
expect(workspace.getActivePane()).toBe pane1
pane4 = null
waitsForPromise ->
workspace.open('a', split: 'down').then (o) -> editor = o
runs ->
pane4 = workspace.getPanes().filter((p) -> p isnt pane1)[0]
expect(workspace.getActivePane()).toBe pane4
expect(pane4.items).toEqual [editor]
expect(workspace.paneContainer.root.children[0]).toBe pane1
expect(workspace.paneContainer.root.children[1]).toBe pane2
describe "when an initialLine and initialColumn are specified", ->
it "moves the cursor to the indicated location", ->
waitsForPromise ->

View File

@@ -378,14 +378,16 @@ class AtomApplication
unless pidToKillWhenClosed or newWindow
existingWindow = @windowForPaths(pathsToOpen, devMode)
# Default to using the specified window or the last focused window
currentWindow = window ? @lastFocusedWindow
stats = (fs.statSyncNoException(pathToOpen) for pathToOpen in pathsToOpen)
existingWindow ?= currentWindow if (
stats.every((stat) -> stat.isFile?()) or
stats.some((stat) -> stat.isDirectory?()) and not currentWindow?.hasProjectPath()
)
unless existingWindow?
if currentWindow = window ? @lastFocusedWindow
existingWindow = currentWindow if (
currentWindow.devMode is devMode and
(
stats.every((stat) -> stat.isFile?()) or
stats.some((stat) -> stat.isDirectory?() and not currentWindow.hasProjectPath())
)
)
if existingWindow?
openedWindow = existingWindow

View File

@@ -17,14 +17,8 @@ class AutoUpdateManager
constructor: (@version, @testMode, @disabled) ->
@state = IdleState
if process.platform is 'win32'
# Squirrel for Windows can't handle query params
# https://github.com/Squirrel/Squirrel.Windows/issues/132
@feedUrl = 'https://atom.io/api/updates'
else
@iconPath = path.resolve(__dirname, '..', '..', 'resources', 'atom.png')
@feedUrl = "https://atom.io/api/updates?version=#{@version}"
@iconPath = path.resolve(__dirname, '..', '..', 'resources', 'atom.png')
@feedUrl = "https://atom.io/api/updates?version=#{@version}"
process.nextTick => @setupAutoUpdater()
setupAutoUpdater: ->

View File

@@ -422,7 +422,6 @@ class Config
# * `event` {Object}
# * `newValue` the new value of the key
# * `oldValue` the prior value of the key.
# * `keyPath` the keyPath of the changed key
#
# Returns a {Disposable} with the following keys on which you can call
# `.dispose()` to unsubscribe.

View File

@@ -75,7 +75,7 @@ class Cursor extends Model
@changePosition options, =>
@marker.setHeadScreenPosition(screenPosition, options)
# Public: Returns the screen position of the cursor as an Array.
# Public: Returns the screen position of the cursor as a {Point}.
getScreenPosition: ->
@marker.getHeadScreenPosition()

View File

@@ -44,16 +44,16 @@ class PaneElement extends HTMLElement
event.stopPropagation()
@getModel().activate()
pathsToOpen = Array::map.call event.dataTransfer.files, (file) -> file.path
@open({pathsToOpen}) if pathsToOpen.length > 0
@applicationDelegate.open({pathsToOpen}) if pathsToOpen.length > 0
@addEventListener 'focus', handleFocus, true
@addEventListener 'blur', handleBlur, true
@addEventListener 'dragover', handleDragOver
@addEventListener 'drop', handleDrop
initialize: (@model, {@views, @open}) ->
initialize: (@model, {@views, @applicationDelegate}) ->
throw new Error("Must pass a views parameter when initializing PaneElements") unless @views?
throw new Error("Must pass a open parameter when initializing PaneElements") unless @open?
throw new Error("Must pass an applicationDelegate parameter when initializing PaneElements") unless @applicationDelegate?
@subscriptions.add @model.onDidActivate(@activated.bind(this))
@subscriptions.add @model.observeActive(@activeStatusChanged.bind(this))

View File

@@ -525,7 +525,8 @@ class Pane extends Model
# Public: Save all items.
saveItems: ->
@saveItem(item) for item in @getItems()
for item in @getItems()
@saveItem(item) if item.isModified?()
return
# Public: Return the first item that matches the given URI or undefined if
@@ -679,6 +680,30 @@ class Pane extends Model
else
@splitRight()
# If the parent is a vertical axis, returns its first child if it is a pane;
# otherwise returns this pane.
findTopmostSibling: ->
if @parent.orientation is 'vertical'
[topmostSibling] = @parent.children
if topmostSibling instanceof PaneAxis
this
else
topmostSibling
else
this
# If the parent is a vertical axis, returns its last child if it is a pane;
# otherwise returns a new pane created by splitting this pane bottomward.
findOrCreateBottommostSibling: ->
if @parent.orientation is 'vertical'
bottommostSibling = last(@parent.children)
if bottommostSibling instanceof PaneAxis
@splitRight()
else
bottommostSibling
else
@splitDown()
close: ->
@destroy() if @confirmClose()

View File

@@ -382,9 +382,11 @@ class Workspace extends Model
# initially. Defaults to `0`.
# * `initialColumn` A {Number} indicating which column to move the cursor to
# initially. Defaults to `0`.
# * `split` Either 'left' or 'right'. If 'left', the item will be opened in
# leftmost pane of the current active pane's row. If 'right', the
# item will be opened in the rightmost pane of the current active pane's row.
# * `split` Either 'left', 'right', 'top' or 'bottom'.
# If 'left', the item will be opened in leftmost pane of the current active pane's row.
# If 'right', the item will be opened in the rightmost pane of the current active pane's row.
# If 'up', the item will be opened in topmost pane of the current active pane's row.
# If 'down', the item will be opened in the bottommost pane of the current active pane's row.
# * `activatePane` A {Boolean} indicating whether to call {Pane::activate} on
# containing pane. Defaults to `true`.
# * `activateItem` A {Boolean} indicating whether to call {Pane::activateItem}
@@ -406,6 +408,10 @@ class Workspace extends Model
@getActivePane().findLeftmostSibling()
when 'right'
@getActivePane().findOrCreateRightmostSibling()
when 'up'
@getActivePane().findTopmostSibling()
when 'down'
@getActivePane().findOrCreateBottommostSibling()
else
@getActivePane()

View File

@@ -141,7 +141,7 @@
} else {
currentWindow.openDevTools()
currentWindow.once('devtools-opened', function () {
setTimeout(profile, 100)
setTimeout(profile, 1000)
})
}
}