Skip to content

Commit

Permalink
Merge branch 'master' into ns-licenses
Browse files Browse the repository at this point in the history
Conflicts:
	package.json
  • Loading branch information
Nathan Sobo committed Feb 21, 2014
2 parents 878831b + bc22130 commit d7d2a6f
Show file tree
Hide file tree
Showing 27 changed files with 212 additions and 136 deletions.
5 changes: 3 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,9 @@ in the proper package's repository.

* Use [TomDoc](http://tomdoc.org).
* Use [Markdown](https://daringfireball.net/projects/markdown).
* Reference classes with `{ClassName}` style notation.
* Reference methods with `{ClassName.methodName}` style notation.
* Reference classes with `{ClassName}`.
* Reference instance methods with `{ClassName::methodName}`.
* Reference class methods with `{ClassName.methodName}`.
* Delegate to comments elsewhere with `{Delegates to: ClassName.methodName}`
style notation.

Expand Down
2 changes: 1 addition & 1 deletion build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"dependencies": {
"async": "~0.2.9",
"biscotto": "0.6.0",
"biscotto": "1.x",
"formidable": "~1.0.14",
"fs-plus": "2.x",
"github-releases": "~0.2.0",
Expand Down
6 changes: 4 additions & 2 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,10 @@ dependencies up to date by running `apm update` after pulling upstream changes.

* Use [TomDoc](http://tomdoc.org).
* Use [Markdown](https://daringfireball.net/projects/markdown).
* Reference classes with the custom `{ClassName}` notation.
* Reference methods with the custom `{ClassName.methodName}` notation.
* Reference methods and classes in markdown with the custom `{}` notation:
* Reference classes with `{ClassName}`
* Reference instance methods with `{ClassName::methodName}`
* Reference class methods with `{ClassName.methodName}`

### Example

Expand Down
1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* [Customizing Atom](customizing-atom.md)
* [Creating a Package](creating-a-package.md)
* [Creating a Theme](creating-a-theme.md)
* [Publishing a Package](publishing-a-package.md)

### Advanced Topics

Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "atom",
"productName": "Atom",
"version": "0.51.0",
"version": "0.52.0",
"main": "./src/browser/main.js",
"repository": {
"type": "git",
Expand Down Expand Up @@ -74,7 +74,7 @@
"command-palette": "0.17.0",
"dev-live-reload": "0.26.0",
"exception-reporting": "0.13.0",
"feedback": "0.23.0",
"feedback": "0.24.0",
"find-and-replace": "0.83.0",
"fuzzy-finder": "0.35.0",
"gists": "0.17.0",
Expand All @@ -85,12 +85,12 @@
"image-view": "0.24.0",
"keybinding-resolver": "0.10.0",
"link": "0.17.0",
"markdown-preview": "0.32.0",
"markdown-preview": "0.33.0",
"metrics": "0.26.0",
"open-on-github": "0.20.0",
"package-generator": "0.26.0",
"release-notes": "0.21.0",
"settings-view": "0.76.0",
"settings-view": "0.77.0",
"snippets": "0.30.0",
"spell-check": "0.25.0",
"status-bar": "0.32.0",
Expand All @@ -105,7 +105,7 @@
"wrap-guide": "0.14.0",
"language-c": "0.10.0",
"language-clojure": "0.2.0",
"language-coffee-script": "0.9.0",
"language-coffee-script": "0.10.0",
"language-css": "0.8.0",
"language-gfm": "0.17.0",
"language-git": "0.8.0",
Expand Down
29 changes: 29 additions & 0 deletions spec/keymap-spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -399,3 +399,32 @@ describe "Keymap", ->
runs ->
keyBinding = keymap.keyBindingsForKeystroke('ctrl-l')[0]
expect(keyBinding).toBeUndefined()

it "logs a warning when it can't be parsed", ->
keymapFilePath = path.join(configDirPath, "keymap.json")
fs.writeFileSync(keymapFilePath, '')
keymap.loadUserKeymap()

spyOn(keymap, 'loadUserKeymap').andCallThrough()
fs.writeFileSync(keymapFilePath, '}{')
spyOn(console, 'warn')

waitsFor ->
keymap.loadUserKeymap.callCount > 0

runs ->
expect(console.warn.callCount).toBe 1
expect(console.warn.argsForCall[0][0].length).toBeGreaterThan 0

describe "when adding a binding with an invalid selector", ->
it "logs a warning and does not add it", ->
spyOn(console, 'warn')
keybinding =
'##selector':
'cmd-a': 'invalid-command'
keymap.add('test', keybinding)

expect(console.warn.callCount).toBe 1
expect(console.warn.argsForCall[0][0].length).toBeGreaterThan 0
expect(-> keymap.keyBindingsMatchingElement(document.body)).not.toThrow()
expect(keymap.keyBindingsForCommand('invalid:command')).toEqual []
52 changes: 26 additions & 26 deletions spec/pane-container-view-spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ describe "PaneContainerView", ->
expect(container.getFocusedPane()).toBe pane3
expect(container.getActivePane()).toBe pane3

describe ".eachPane(callback)", ->
describe ".eachPaneView(callback)", ->
it "runs the callback with all current and future panes until the subscription is cancelled", ->
panes = []
subscription = container.eachPane (pane) -> panes.push(pane)
subscription = container.eachPaneView (pane) -> panes.push(pane)
expect(panes).toEqual [pane1, pane2, pane3]

panes = []
Expand All @@ -66,7 +66,7 @@ describe "PaneContainerView", ->

container.saveAll()

for pane in container.getPanes()
for pane in container.getPaneViews()
for item in pane.getItems()
expect(item.saved).toBeTruthy()

Expand Down Expand Up @@ -240,30 +240,30 @@ describe "PaneContainerView", ->
pane2.remove()
expect(activeItemChangedHandler).not.toHaveBeenCalled()

describe ".focusNextPane()", ->
describe ".focusNextPaneView()", ->
it "focuses the pane following the focused pane or the first pane if no pane has focus", ->
container.attachToDom()
container.focusNextPane()
container.focusNextPaneView()
expect(pane1.activeItem).toMatchSelector ':focus'
container.focusNextPane()
container.focusNextPaneView()
expect(pane2.activeItem).toMatchSelector ':focus'
container.focusNextPane()
container.focusNextPaneView()
expect(pane3.activeItem).toMatchSelector ':focus'
container.focusNextPane()
container.focusNextPaneView()
expect(pane1.activeItem).toMatchSelector ':focus'

describe ".focusPreviousPane()", ->
describe ".focusPreviousPaneView()", ->
it "focuses the pane preceding the focused pane or the last pane if no pane has focus", ->
container.attachToDom()
container.getPanes()[0].focus() # activate first pane
container.getPaneViews()[0].focus() # activate first pane

container.focusPreviousPane()
container.focusPreviousPaneView()
expect(pane3.activeItem).toMatchSelector ':focus'
container.focusPreviousPane()
container.focusPreviousPaneView()
expect(pane2.activeItem).toMatchSelector ':focus'
container.focusPreviousPane()
container.focusPreviousPaneView()
expect(pane1.activeItem).toMatchSelector ':focus'
container.focusPreviousPane()
container.focusPreviousPaneView()
expect(pane3.activeItem).toMatchSelector ':focus'

describe "changing focus directionally between panes", ->
Expand Down Expand Up @@ -300,54 +300,54 @@ describe "PaneContainerView", ->
container.width(400)
container.attachToDom()

describe ".focusPaneAbove()", ->
describe ".focusPaneViewAbove()", ->
describe "when there are multiple rows above the focused pane", ->
it "focuses up to the adjacent row", ->
pane8.focus()
container.focusPaneAbove()
container.focusPaneViewAbove()
expect(pane5.activeItem).toMatchSelector ':focus'

describe "when there are no rows above the focused pane", ->
it "keeps the current pane focused", ->
pane2.focus()
container.focusPaneAbove()
container.focusPaneViewAbove()
expect(pane2.activeItem).toMatchSelector ':focus'

describe ".focusPaneBelow()", ->
describe ".focusPaneViewBelow()", ->
describe "when there are multiple rows below the focused pane", ->
it "focuses down to the adjacent row", ->
pane2.focus()
container.focusPaneBelow()
container.focusPaneViewBelow()
expect(pane5.activeItem).toMatchSelector ':focus'

describe "when there are no rows below the focused pane", ->
it "keeps the current pane focused", ->
pane8.focus()
container.focusPaneBelow()
container.focusPaneViewBelow()
expect(pane8.activeItem).toMatchSelector ':focus'

describe ".focusPaneOnLeft()", ->
describe ".focusPaneViewOnLeft()", ->
describe "when there are multiple columns to the left of the focused pane", ->
it "focuses left to the adjacent column", ->
pane6.focus()
container.focusPaneOnLeft()
container.focusPaneViewOnLeft()
expect(pane5.activeItem).toMatchSelector ':focus'

describe "when there are no columns to the left of the focused pane", ->
it "keeps the current pane focused", ->
pane4.focus()
container.focusPaneOnLeft()
container.focusPaneViewOnLeft()
expect(pane4.activeItem).toMatchSelector ':focus'

describe ".focusPaneOnRight()", ->
describe ".focusPaneViewOnRight()", ->
describe "when there are multiple columns to the right of the focused pane", ->
it "focuses right to the adjacent column", ->
pane4.focus()
container.focusPaneOnRight()
container.focusPaneViewOnRight()
expect(pane5.activeItem).toMatchSelector ':focus'

describe "when there are no columns to the right of the focused pane", ->
it "keeps the current pane focused", ->
pane6.focus()
container.focusPaneOnRight()
container.focusPaneViewOnRight()
expect(pane6.activeItem).toMatchSelector ':focus'
11 changes: 11 additions & 0 deletions spec/theme-manager-spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -224,3 +224,14 @@ describe "ThemeManager", ->

runs ->
expect($(document.body).css('border-style')).toBe 'none'

describe "when a non-existent theme is present in the config", ->
it "logs a warning but does not throw an exception (regression)", ->
waitsForPromise ->
themeManager.activateThemes()

runs ->
spyOn(console, 'warn')
expect(-> atom.config.set('core.themes', ['atom-light-ui', 'theme-really-does-not-exist'])).not.toThrow()
expect(console.warn.callCount).toBe 1
expect(console.warn.argsForCall[0][0].length).toBeGreaterThan 0
4 changes: 2 additions & 2 deletions spec/workspace-view-spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ describe "WorkspaceView", ->
editorView1 = atom.workspaceView.getActiveView()
buffer = editorView1.getEditor().getBuffer()
editorView1.splitRight()
expect(atom.workspaceView.getActivePane()).toBe atom.workspaceView.getPanes()[1]
expect(atom.workspaceView.getActivePane()).toBe atom.workspaceView.getPaneViews()[1]

simulateReload()

expect(atom.workspaceView.getEditorViews().length).toBe 2
expect(atom.workspaceView.getActivePane()).toBe atom.workspaceView.getPanes()[1]
expect(atom.workspaceView.getActivePane()).toBe atom.workspaceView.getPaneViews()[1]
expect(atom.workspaceView.title).toBe "untitled - #{atom.project.getPath()}"

describe "when there are open editors", ->
Expand Down
4 changes: 2 additions & 2 deletions src/clipboard.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Clipboard
# Public: Write the given text to the clipboard.
#
# The metadata associated with the text is available by calling
# {.readWithMetadata}.
# {::readWithMetadata}.
#
# text - The {String} to store.
# metadata - The additional info to associate with the text.
Expand All @@ -40,7 +40,7 @@ class Clipboard
#
# Returns an {Object} with the following keys:
# :text - The {String} clipboard text.
# :metadata - The metadata stored by an earlier call to {.write}.
# :metadata - The metadata stored by an earlier call to {::write}.
readWithMetadata: ->
text = @read()
if @signatureForMetadata is @md5(text)
Expand Down
8 changes: 4 additions & 4 deletions src/cursor.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ class Cursor
#
# options - An {Object} with the following keys:
# :wordRegex - A {RegExp} indicating what constitutes a "word"
# (default: {.wordRegExp}).
# (default: {::wordRegExp}).
# :includeNonWordCharacters - A {Boolean} indicating whether to include
# non-word characters in the default word regex.
# Has no effect if wordRegex is set.
Expand Down Expand Up @@ -379,7 +379,7 @@ class Cursor
#
# options - An {Object} with the following keys:
# :wordRegex - A {RegExp} indicating what constitutes a "word"
# (default: {.wordRegExp})
# (default: {::wordRegExp})
# :includeNonWordCharacters - A Boolean indicating whether to include
# non-word characters in the default word regex.
# Has no effect if wordRegex is set.
Expand All @@ -403,7 +403,7 @@ class Cursor
#
# options -
# :wordRegex - A {RegExp} indicating what constitutes a "word"
# (default: {.wordRegExp}).
# (default: {::wordRegExp}).
#
# Returns a {Range}.
getBeginningOfNextWordBufferPosition: (options = {}) ->
Expand All @@ -422,7 +422,7 @@ class Cursor
#
# options -
# :wordRegex - A {RegExp} indicating what constitutes a "word"
# (default: {.wordRegExp}).
# (default: {::wordRegExp}).
getCurrentWordBufferRange: (options={}) ->
startOptions = _.extend(_.clone(options), allowPrevious: false)
endOptions = _.extend(_.clone(options), allowNext: false)
Expand Down
14 changes: 7 additions & 7 deletions src/display-buffer-marker.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class DisplayBufferMarker
# Modifies the screen range of the display marker.
#
# screenRange - The new {Range} to use
# options - A hash of options matching those found in {Marker.setRange}
# options - A hash of options matching those found in {Marker::setRange}
setScreenRange: (screenRange, options) ->
@setBufferRange(@displayBuffer.bufferRangeForScreenRange(screenRange), options)

Expand All @@ -50,7 +50,7 @@ class DisplayBufferMarker
# Modifies the buffer range of the display marker.
#
# screenRange - The new {Range} to use
# options - A hash of options matching those found in {Marker.setRange}
# options - A hash of options matching those found in {Marker::setRange}
setBufferRange: (bufferRange, options) ->
@bufferMarker.setRange(bufferRange, options)

Expand All @@ -63,7 +63,7 @@ class DisplayBufferMarker
# Sets the screen position of the marker's head.
#
# screenRange - The new {Point} to use
# options - A hash of options matching those found in {DisplayBuffer.bufferPositionForScreenPosition}
# options - A hash of options matching those found in {DisplayBuffer::bufferPositionForScreenPosition}
setHeadScreenPosition: (screenPosition, options) ->
screenPosition = @displayBuffer.clipScreenPosition(screenPosition, options)
@setHeadBufferPosition(@displayBuffer.bufferPositionForScreenPosition(screenPosition, options))
Expand All @@ -77,7 +77,7 @@ class DisplayBufferMarker
# Sets the buffer position of the marker's head.
#
# screenRange - The new {Point} to use
# options - A hash of options matching those found in {DisplayBuffer.bufferPositionForScreenPosition}
# options - A hash of options matching those found in {DisplayBuffer::bufferPositionForScreenPosition}
setHeadBufferPosition: (bufferPosition) ->
@bufferMarker.setHeadPosition(bufferPosition)

Expand All @@ -90,7 +90,7 @@ class DisplayBufferMarker
# Sets the screen position of the marker's tail.
#
# screenRange - The new {Point} to use
# options - A hash of options matching those found in {DisplayBuffer.bufferPositionForScreenPosition}
# options - A hash of options matching those found in {DisplayBuffer::bufferPositionForScreenPosition}
setTailScreenPosition: (screenPosition, options) ->
screenPosition = @displayBuffer.clipScreenPosition(screenPosition, options)
@setTailBufferPosition(@displayBuffer.bufferPositionForScreenPosition(screenPosition, options))
Expand All @@ -104,7 +104,7 @@ class DisplayBufferMarker
# Sets the buffer position of the marker's tail.
#
# screenRange - The new {Point} to use
# options - A hash of options matching those found in {DisplayBuffer.bufferPositionForScreenPosition}
# options - A hash of options matching those found in {DisplayBuffer::bufferPositionForScreenPosition}
setTailBufferPosition: (bufferPosition) ->
@bufferMarker.setTailPosition(bufferPosition)

Expand Down Expand Up @@ -135,7 +135,7 @@ class DisplayBufferMarker
# Returns a {Boolean} indicating whether the marker has been destroyed. A marker
# can be invalid without being destroyed, in which case undoing the invalidating
# operation would restore the marker. Once a marker is destroyed by calling
# {Marker.destroy}, no undo/redo operation can ever bring it back.
# {Marker::destroy}, no undo/redo operation can ever bring it back.
isDestroyed: ->
@bufferMarker.isDestroyed()

Expand Down
Loading

0 comments on commit d7d2a6f

Please sign in to comment.