Merge branch 'master' into chrome35

This commit is contained in:
Kevin Sawicki 2014-07-22 17:56:24 -07:00
commit 5f7f5b5367
13 changed files with 46 additions and 25 deletions

View File

@ -40,7 +40,10 @@ module.exports = (grunt) ->
appName = if process.platform is 'darwin' then 'Atom.app' else 'Atom'
buildDir = grunt.option('build-dir') ? path.join(tmpDir, 'atom-build')
installDir = grunt.option('install-dir')
atomShellDownloadDir = path.join(os.tmpdir(), 'atom-cached-atom-shells')
home = if process.env is 'win32' then process.env.USERPROFILE else process.env.HOME
atomShellDownloadDir = path.join(home, '.atom', 'atom-shell')
symbolsDir = path.join(buildDir, 'Atom.breakpad.syms')
shellAppDir = path.join(buildDir, appName)
if process.platform is 'win32'

View File

@ -9,10 +9,12 @@ module.exports = (grunt) ->
['atom-dark-ui', 'atom-light-syntax']
['atom-dark-ui', 'solarized-dark-syntax']
['atom-dark-ui', 'base16-tomorrow-dark-theme']
['atom-dark-ui', 'base16-tomorrow-light-theme']
['atom-light-ui', 'atom-light-syntax']
['atom-light-ui', 'atom-dark-syntax']
['atom-light-ui', 'solarized-dark-syntax']
['atom-light-ui', 'base16-tomorrow-dark-theme']
['atom-light-ui', 'base16-tomorrow-light-theme']
]
directory = path.join(grunt.config.get('atom.appDir'), 'less-compile-cache')

View File

@ -27,6 +27,10 @@ All requests that take parameters require `application/json`.
#### GET /api/packages
Parameters:
- **page** (optional)
Returns a list of all packages in the following format:
```json
[
@ -44,6 +48,15 @@ Returns a list of all packages in the following format:
]
```
Results are paginated 30 at a time, and links to the next and last pages are
provided in the `Link` header:
```
Link: <https://www.atom.io/api/packages?page=1>; rel="self",
<https://www.atom.io/api/packages?page=41>; rel="last",
<https://www.atom.io/api/packages?page=2>; rel="next"
```
### Showing package details
#### GET /api/packages/:package_name

View File

@ -26,6 +26,7 @@
'ctrl-w': 'core:close'
'ctrl-z': 'core:undo'
'ctrl-y': 'core:redo'
'ctrl-shift-z': 'core:redo'
'ctrl-x': 'core:cut'
'ctrl-c': 'core:copy'
'ctrl-v': 'core:paste'

View File

@ -1,7 +1,7 @@
{
"name": "atom",
"productName": "Atom",
"version": "0.116.0",
"version": "0.118.0",
"description": "A hackable text editor for the 21st Century.",
"main": "./src/browser/main.js",
"repository": {
@ -66,7 +66,8 @@
"atom-dark-ui": "0.32.0",
"atom-light-syntax": "0.20.0",
"atom-light-ui": "0.28.0",
"base16-tomorrow-dark-theme": "0.19.0",
"base16-tomorrow-dark-theme": "0.20.0",
"base16-tomorrow-light-theme": "0.3.0",
"solarized-dark-syntax": "0.21.0",
"solarized-light-syntax": "0.11.0",
"archive-view": "1.0.0",
@ -113,7 +114,7 @@
"language-css": "0.17.0",
"language-gfm": "0.43.0",
"language-git": "0.9.0",
"language-go": "0.13.0",
"language-go": "0.14.0",
"language-html": "0.22.0",
"language-hyperlink": "0.10.0",
"language-java": "0.11.0",

View File

@ -24,6 +24,7 @@ var commands = [
[home, '.atom', 'storage'],
[home, '.atom', '.npm'],
[home, '.atom', 'compile-cache'],
[home, '.atom', 'atom-shell'],
[tmpdir, 'atom-build'],
[tmpdir, 'atom-cached-atom-shells'],
];

View File

@ -531,7 +531,7 @@ describe "the `atom` global", ->
describe ".isReleasedVersion()", ->
it "returns false if the version is a SHA and true otherwise", ->
version = '0.1.0'
spyOn(atom.constructor, 'getVersion').andCallFake -> version
spyOn(atom, 'getVersion').andCallFake -> version
expect(atom.isReleasedVersion()).toBe true
version = '36b5518'
expect(atom.isReleasedVersion()).toBe false

View File

@ -258,7 +258,7 @@ describe "EditorComponent", ->
editor.setText "a line that wraps "
editor.setSoftWrap(true)
runSetImmediateCallbacks()
componentNode.style.width = 16 * charWidth + 'px'
componentNode.style.width = 16 * charWidth + editor.getVerticalScrollbarWidth() + 'px'
component.measureHeightAndWidth()
runSetImmediateCallbacks()
@ -1697,32 +1697,38 @@ describe "EditorComponent", ->
component.measureHeightAndWidth()
runSetImmediateCallbacks()
# try to scroll past the top, which is impossible
componentNode.dispatchEvent(new WheelEvent('mousewheel', wheelDeltaX: 0, wheelDeltaY: 50))
expect(editor.getScrollTop()).toBe 0
expect(WheelEvent::preventDefault).not.toHaveBeenCalled()
# scroll to the bottom in one huge event
componentNode.dispatchEvent(new WheelEvent('mousewheel', wheelDeltaX: 0, wheelDeltaY: -3000))
runSetImmediateCallbacks()
expect(editor.getScrollTop()).toBe editor.getScrollHeight() - editor.getHeight() + 15
maxScrollTop = editor.getScrollTop()
expect(WheelEvent::preventDefault).toHaveBeenCalled()
WheelEvent::preventDefault.reset()
# try to scroll past the bottom, which is impossible
componentNode.dispatchEvent(new WheelEvent('mousewheel', wheelDeltaX: 0, wheelDeltaY: -30))
expect(editor.getScrollTop()).toBe editor.getScrollHeight() - editor.getHeight() + 15
expect(editor.getScrollTop()).toBe maxScrollTop
expect(WheelEvent::preventDefault).not.toHaveBeenCalled()
# try to scroll past the left side, which is impossible
componentNode.dispatchEvent(new WheelEvent('mousewheel', wheelDeltaX: 50, wheelDeltaY: 0))
expect(editor.getScrollLeft()).toBe 0
expect(WheelEvent::preventDefault).not.toHaveBeenCalled()
# scroll all the way right
componentNode.dispatchEvent(new WheelEvent('mousewheel', wheelDeltaX: -3000, wheelDeltaY: 0))
runSetImmediateCallbacks()
expect(editor.getScrollLeft()).toBe editor.getScrollWidth() - editor.getWidth() + 15
maxScrollLeft = editor.getScrollLeft()
expect(WheelEvent::preventDefault).toHaveBeenCalled()
WheelEvent::preventDefault.reset()
# try to scroll past the right side, which is impossible
componentNode.dispatchEvent(new WheelEvent('mousewheel', wheelDeltaX: -30, wheelDeltaY: 0))
expect(editor.getScrollLeft()).toBe editor.getScrollWidth() - editor.getWidth() + 15
expect(editor.getScrollLeft()).toBe maxScrollLeft
expect(WheelEvent::preventDefault).not.toHaveBeenCalled()
describe "input events", ->
@ -1997,7 +2003,7 @@ describe "EditorComponent", ->
expect(componentNode.querySelectorAll('.line')).toHaveLength(4 + lineOverdrawMargin + 1)
gutterWidth = componentNode.querySelector('.gutter').offsetWidth
componentNode.style.width = gutterWidth + 14 * charWidth + 'px'
componentNode.style.width = gutterWidth + 14 * charWidth + editor.getVerticalScrollbarWidth() + 'px'
advanceClock(component.domPollingInterval)
runSetImmediateCallbacks()
expect(componentNode.querySelector('.line').textContent).toBe "var quicksort "

View File

@ -110,14 +110,6 @@ class Atom extends Model
@getCurrentWindow: ->
remote.getCurrentWindow()
# Get the version of the Atom application.
@getVersion: ->
@appVersion ?= @getLoadSettings().appVersion
# Determine whether the current version is an official release.
@isReleasedVersion: ->
not /\w{7}/.test(@getVersion()) # Check if the release is a 7-character SHA prefix
workspaceViewParentSelector: 'body'
# Call .loadOrCreate instead
@ -503,11 +495,11 @@ class Atom extends Model
#
# Returns the version text {String}.
getVersion: ->
@constructor.getVersion()
@appVersion ?= @getLoadSettings().appVersion
# Public: Determine whether the current version is an official release.
isReleasedVersion: ->
@constructor.isReleasedVersion()
not /\w{7}/.test(@getVersion()) # Check if the release is a 7-character SHA prefix
# Public: Get the directory path to Atom's configuration area.
#

View File

@ -356,8 +356,10 @@ class DisplayBuffer extends Model
if editorWidthInChars isnt previousWidthInChars and @softWrap
@updateWrappedScreenLines()
# Returns the editor width in characters for soft wrap.
getEditorWidthInChars: ->
width = @getWidth()
width = @width ? @getScrollWidth()
width -= @getVerticalScrollbarWidth()
if width? and @defaultCharWidth > 0
Math.floor(width / @defaultCharWidth)
else

View File

@ -117,7 +117,7 @@ EditorComponent = React.createClass
editor, lineHeightInPixels, defaultCharWidth, lineDecorations, highlightDecorations,
showIndentGuide, renderedRowRange, @pendingChanges, scrollTop, scrollLeft,
@scrollingVertically, scrollHeight, scrollWidth, mouseWheelScreenRow, invisibles,
visible, scrollViewHeight, @scopedCharacterWidthsChangeCount, lineWidth, @useHardwareAcceleration,
@visible, scrollViewHeight, @scopedCharacterWidthsChangeCount, lineWidth, @useHardwareAcceleration,
placeholderText, @performedInitialMeasurement
}

View File

@ -38,7 +38,7 @@ class ReactEditorView extends View
Object.defineProperty @::, 'charWidth', get: -> @editor.getDefaultCharWidth()
Object.defineProperty @::, 'firstRenderedScreenRow', get: -> @component.getRenderedRowRange()[0]
Object.defineProperty @::, 'lastRenderedScreenRow', get: -> @component.getRenderedRowRange()[1]
Object.defineProperty @::, 'active', get: -> @is(@getPane().activeView)
Object.defineProperty @::, 'active', get: -> @is(@getPane()?.activeView)
Object.defineProperty @::, 'isFocused', get: -> @component?.state.focused
afterAttach: (onDom) ->

View File

@ -71,7 +71,7 @@ class WorkspaceView extends View
projectHome: path.join(fs.getHomeDirectory(), 'github')
audioBeep: true
destroyEmptyPanes: true
useReactEditor: false
useReactEditor: true
@content: ->
@div class: 'workspace', tabindex: -1, =>