Signed-off-by: Cthulhux <zeug@tuxproject.de>
This commit is contained in:
Cthulhux 2014-05-09 09:28:50 +02:00
commit d6a4c70929
14 changed files with 138 additions and 75 deletions

View File

@ -1,14 +1,8 @@
![Atom](https://cloud.githubusercontent.com/assets/72919/2874231/3af1db48-d3dd-11e3-98dc-6066f8bc766f.png)
Atom is a hackable text editor for the 21st century.
Atom is a hackable text editor for the 21st century, built on [atom-shell](http://github.com/atom/atom-shell), and based on everything we love about our favorite editors. We designed it to be deeply customizable, but still approachable using the default configuration.
Atom is open source and built on top of [atom-shell](http://github.com/atom/atom-shell).
Atom is designed to be customizable, but also usable without needing to edit a config file.
Atom is modern, approachable, and hackable to the core.
Visit [atom.io](http://atom.io) to learn more.
Visit [atom.io](https://atom.io) to learn more.
## Installing
@ -18,63 +12,10 @@ Atom will automatically update when a new release is available.
## Building
### OS X Requirements
* OS X 10.8 or later
* [node.js](http://nodejs.org/download/) v0.10.x
* Command Line Tools for [Xcode](https://developer.apple.com/xcode/downloads/) (run `xcode-select --install` to install)
```sh
git clone https://github.com/atom/atom
cd atom
script/build # Creates application at /Applications/Atom.app
```
### Linux Requirements
* OS with 64-bit architecture
* [node.js](http://nodejs.org/download/) v0.10.x
* [npm](http://www.npmjs.org/) v1.4.x
* `sudo apt-get install libgnome-keyring-dev` (on non-`apt`-based distributions the command may vary)
* `npm config set python /usr/bin/python2 -g` to ensure that gyp uses Python 2
```sh
git clone https://github.com/atom/atom
cd atom
script/build # Creates application at /tmp/atom-build/Atom
sudo script/grunt install # Installs command to /usr/local/bin/atom
script/grunt mkdeb # Generates a .deb package at /tmp/atom-build
```
### FreeBSD Requirements
* OS with 64-bit architecture
* `pkg install node`
* `pkg install npm`
* `pkg install libgnome-keyring`
* `npm config set python /usr/local/bin/python2 -g` to ensure that gyp uses Python 2
```sh
git clone https://github.com/atom/atom
cd atom
script/build # Creates application at /tmp/atom-build/Atom
sudo script/grunt install # Installs command to /usr/local/bin/atom
```
### Windows Requirements
* Windows 7 or later
* [Visual C++ 2010 SP1 Express](http://www.visualstudio.com/en-us/downloads/download-visual-studio-vs#DownloadFamilies_4)
* [node.js - 32bit](http://nodejs.org/download/) v0.10.x
* [Python 2.7.x](http://www.python.org/download/)
* [Git for Windows](http://git-scm.com/download/win)
* Select the option **Use Git from the Windows Command Prompt** when installing (Git needs to be in your `PATH`)
* Clone [atom/atom](https://github.com/atom/atom/) to `C:\Users\<user>\github\atom\`
* Add `C:\Python27;C:\Program Files\nodejs;C:\Users\<user>\github\atom\node_modules\`
to your PATH
* Open a git shell
```bat
cd C:\Users\<user>\github\atom
script\build
```
* [Linux](docs/build-instructions/linux.md)
* [OS X](docs/build-instructions/os-x.md)
* [FreeBSD](docs/build-instructions/freebsd.md)
* [Windows](docs/build-instructions/windows.md)
## Developing
Check out the [guides](https://atom.io/docs/latest) and the [API reference](https://atom.io/docs/api).

View File

@ -27,6 +27,8 @@
"json-front-matter": "~0.1.3",
"legal-eagle": "~0.4.0",
"minidump": "0.5.x",
"read-package-json": "1.1.8",
"normalize-package-data": "0.2.12",
"rcedit": "~0.1.2",
"request": "~2.27.0",
"rimraf": "~2.2.2",

View File

@ -0,0 +1,22 @@
# FreeBSD
FreeBSD -RELEASE 64-bit is the recommended platform.
## Requirements
* FreeBSD
* `pkg install node`
* `pkg install npm`
* `pkg install libgnome-keyring`
* `npm config set python /usr/local/bin/python2 -g` to ensure that gyp uses Python 2
## Instructions
```sh
git clone https://github.com/atom/atom
cd atom
script/build # Creates application at /tmp/atom-build/Atom
sudo script/grunt install # Installs command to /usr/local/bin/atom
```
## Troubleshooting

View File

@ -0,0 +1,23 @@
# Linux
Ubuntu LTS 12.04 64-bit is the recommended platform.
## Requirements
* OS with 64-bit architecture
* [node.js](http://nodejs.org/download/) v0.10.x
* [npm](http://www.npmjs.org/) v1.4.x
* libgnome-keyring-dev `sudo apt-get install libgnome-keyring-dev` (refer to your distribution's manual on how to install packages if you are not on Debian or Ubuntu-based systems)
* `npm config set python /usr/bin/python2 -g` to ensure that gyp uses Python 2
## Instructions
```sh
git clone https://github.com/atom/atom
cd atom
script/build # Creates application at /tmp/atom-build/Atom
sudo script/grunt install # Installs command to /usr/local/bin/atom
script/grunt mkdeb # Generates a .deb package at /tmp/atom-build
```
## Troubleshooting

View File

@ -0,0 +1,17 @@
# OS X
## Requirements
* OS X 10.8 or later
* [node.js](http://nodejs.org/download/) v0.10.x
* Command Line Tools for [Xcode](https://developer.apple.com/xcode/downloads/) (run `xcode-select --install` to install)
## Instructions
```sh
git clone https://github.com/atom/atom
cd atom
script/build # Creates application at /Applications/Atom.app
```
## Troubleshooting

View File

@ -0,0 +1,27 @@
# Windows
## Requirements
* Windows 7 or later
* [Visual C++ 2010 SP1 Express](http://www.visualstudio.com/en-us/downloads/download-visual-studio-vs#DownloadFamilies_4)
* [node.js - 32bit](http://nodejs.org/download/) v0.10.x
* [Python 2.7.x](http://www.python.org/download/)
* [GitHub for Windows](http://windows.github.com/)
to your PATH
* Open the Windows GitHub shell (NOT the Standard PowerShell, the shortcut labeled 'Git Shell' - make sure you have logged in at least once to the GitHub for Windows GUI App)
* `$env:Path = $env:Path + ";C:\path\to\atom\repo\node_modules"`
## Instructions
```bat
cd C:\Users\<user>\github
git clone https://github.com/atom/atom/
cd atom
script\build
```
## Why do I have to use GitHub for Windows? Can't I just use my existing Git?
You totally can! GitHub for Windows's Git Shell just takes less work to set up. You need to have Posix tools in your `%PATH%` (i.e. `grep`, `sed`, et al.), which isn't the default configuration when you install Git. To fix this, you probably need to fiddle with your system PATH.
## Troubleshooting

View File

@ -33,6 +33,7 @@
'pageup': 'core:page-up'
'pagedown': 'core:page-down'
'backspace': 'core:backspace'
'shift-backspace': 'core:backspace'
'ctrl-tab': 'pane:show-next-item'
'ctrl-shift-tab': 'pane:show-previous-item'
'ctrl-shift-up': 'core:move-up'

View File

@ -21,7 +21,7 @@
"dependencies": {
"async": "0.2.6",
"atom-keymap": "^0.19.0",
"bootstrap": "git://github.com/atom/bootstrap.git#6af81906189f1747fd6c93479e3d998ebe041372",
"bootstrap": "git+https://github.com/atom/bootstrap.git#6af81906189f1747fd6c93479e3d998ebe041372",
"clear-cut": "0.4.0",
"coffee-script": "1.7.0",
"coffeestack": "0.7.0",
@ -41,7 +41,7 @@
"nslog": "0.5.0",
"oniguruma": "^1.0.6",
"optimist": "0.4.0",
"pathwatcher": "^1.2.3",
"pathwatcher": "^1.2.4",
"property-accessors": "^1",
"q": "^1.0.1",
"random-words": "0.0.1",
@ -50,13 +50,13 @@
"runas": "^0.5",
"scandal": "0.15.2",
"scoped-property-store": "^0.9.0",
"scrollbar-style": "^0.3.0",
"scrollbar-style": "^0.4.0",
"season": "^1.0.2",
"semver": "1.1.4",
"serializable": "^1",
"space-pen": "3.1.1",
"temp": "0.5.0",
"text-buffer": "^2.2.0",
"text-buffer": "^2.2.2",
"theorist": "^1",
"underscore-plus": "^1.2.1",
"vm-compatibility-layer": "0.1.0"

View File

@ -2594,6 +2594,10 @@ describe "Editor", ->
atom.workspace.open('sample-with-tabs.coffee', softTabs: true).then (editor) ->
expect(editor.getSoftTabs()).toBeFalsy()
waitsForPromise ->
atom.workspace.open('sample-with-tabs-and-initial-comment.js', softTabs: true).then (editor) ->
expect(editor.getSoftTabs()).toBeFalsy()
waitsForPromise ->
atom.workspace.open(null, softTabs: false).then (editor) ->
expect(editor.getSoftTabs()).toBeFalsy()

View File

@ -0,0 +1,8 @@
/**
* Look, this is a comment. Don't go making assumtions that I want soft tabs
* because this block comment has leading spaces, Geez.
*/
if (beNice) {
console.log('Thank you for being nice.');
}

View File

@ -39,7 +39,7 @@ class Atom extends Model
# Public: Load or create the Atom environment in the given mode.
#
# - mode: Pass 'editor' or 'spec' depending on the kind of environment you
# want to build.
# want to build.
#
# Returns an Atom instance, fully initialized
@loadOrCreate: (mode) ->
@ -479,6 +479,8 @@ class Atom extends Model
@getCurrentWindow().isFullScreen()
# Public: Get the version of the Atom application.
#
# Returns the version text {String}.
getVersion: ->
@constructor.getVersion()
@ -488,7 +490,7 @@ class Atom extends Model
# Public: Get the directory path to Atom's configuration area.
#
# Returns the absolute path to ~/.atom
# Returns the absolute path to `~/.atom`.
getConfigDirPath: ->
@constructor.getConfigDirPath()

View File

@ -160,7 +160,7 @@ class Editor extends Model
@displayBuffer ?= new DisplayBuffer({buffer, tabLength, softWrap})
@buffer = @displayBuffer.buffer
@softTabs = @buffer.usesSoftTabs() ? @softTabs ? atom.config.get('editor.softTabs') ? true
@softTabs = @usesSoftTabs() ? @softTabs ? atom.config.get('editor.softTabs') ? true
for marker in @findMarkers(@getSelectionMarkerAttributes())
marker.setAttributes(preserveFolds: true)
@ -317,6 +317,19 @@ class Editor extends Model
# Public: Set the on-screen length of tab characters.
setTabLength: (tabLength) -> @displayBuffer.setTabLength(tabLength)
# Public: Determine if the buffer uses hard or soft tabs.
#
# Returns `true` if the first non-comment line with leading whitespace starts
# with a space character. Returns `false` if it starts with a hard tab (`\t`).
#
# Returns a {Boolean},
usesSoftTabs: ->
for bufferRow in [0..@buffer.getLastRow()]
continue if @displayBuffer.tokenizedBuffer.lineForScreenRow(bufferRow).isComment()
if match = @buffer.lineForRow(bufferRow).match(/^\s/)
return match[0][0] != '\t'
undefined
# Public: Clip the given {Point} to a valid position in the buffer.
#
# If the given {Point} describes a position that is actually reachable by the
@ -563,7 +576,7 @@ class Editor extends Model
bufferRowForScreenRow: (row) -> @displayBuffer.bufferRowForScreenRow(row)
# Public: Get the syntactic scopes for the most the given position in buffer
# Public: Get the syntactic scopes for the given position in buffer
# coordinates.
#
# For example, if called with a position inside the parameter list of an

View File

@ -43,7 +43,10 @@ class PackageManager
# Public: Get the path to the apm command
getApmPath: ->
@apmPath ?= path.resolve(__dirname, '..', 'apm', 'node_modules', 'atom-package-manager', 'bin', 'apm')
commandName = 'apm'
if process.platform == 'win32'
commandName += '.cmd'
@apmPath ?= path.resolve(__dirname, '..', 'apm', 'node_modules', 'atom-package-manager', 'bin', commandName)
# Public: Get the paths being used to look for packages.
#

View File

@ -64,7 +64,7 @@ class WorkspaceView extends View
@version: 4
@configDefaults:
ignoredNames: [".git", ".svn", ".DS_Store", "Thumbs.db"]
ignoredNames: [".git", ".hg", ".svn", ".DS_Store", "Thumbs.db"]
excludeVcsIgnoredPaths: true
disabledPackages: []
themes: ['atom-dark-ui', 'atom-dark-syntax']