Merge branch 'master' into jl-all-your-normalizes

This commit is contained in:
Jessica Lord
2015-05-11 17:21:29 -07:00
7 changed files with 89 additions and 29 deletions

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
if [ "$(uname)" == 'Darwin' ]; then
OS='Mac'

View File

@@ -83,15 +83,15 @@
"one-light-ui": "0.8.1",
"solarized-dark-syntax": "0.35.0",
"solarized-light-syntax": "0.21.0",
"archive-view": "0.56.0",
"autocomplete": "0.46.0",
"autoflow": "0.22.0",
"archive-view": "0.57.0",
"autocomplete": "0.47.0",
"autoflow": "0.23.0",
"autosave": "0.20.0",
"background-tips": "0.24.0",
"bookmarks": "0.35.0",
"bracket-matcher": "0.74.0",
"command-palette": "0.35.0",
"deprecation-cop": "0.43.0",
"deprecation-cop": "0.45.0",
"dev-live-reload": "0.46.0",
"encoding-selector": "0.20.0",
"exception-reporting": "0.24.0",
@@ -113,8 +113,8 @@
"release-notes": "0.52.0",
"settings-view": "0.198.0",
"snippets": "0.89.0",
"spell-check": "0.56.0",
"status-bar": "0.69.0",
"spell-check": "0.57.0",
"status-bar": "0.71.0",
"styleguide": "0.44.0",
"symbols-view": "0.96.0",
"tabs": "0.68.0",
@@ -123,15 +123,15 @@
"update-package-dependencies": "0.9.0",
"welcome": "0.27.0",
"whitespace": "0.29.0",
"wrap-guide": "0.32.0",
"wrap-guide": "0.33.0",
"language-c": "0.44.0",
"language-clojure": "0.14.0",
"language-coffee-script": "0.40.0",
"language-csharp": "0.5.0",
"language-css": "0.29.0",
"language-gfm": "0.72.0",
"language-gfm": "0.73.0",
"language-git": "0.10.0",
"language-go": "0.25.0",
"language-go": "0.26.0",
"language-html": "0.37.0",
"language-hyperlink": "0.13.0",
"language-java": "0.15.0",
@@ -141,19 +141,19 @@
"language-make": "0.14.0",
"language-mustache": "0.11.0",
"language-objective-c": "0.15.0",
"language-perl": "0.23.0",
"language-perl": "0.24.0",
"language-php": "0.22.0",
"language-property-list": "0.8.0",
"language-python": "0.34.0",
"language-ruby": "0.52.0",
"language-ruby-on-rails": "0.21.0",
"language-sass": "0.37.0",
"language-sass": "0.38.0",
"language-shellscript": "0.14.0",
"language-source": "0.9.0",
"language-sql": "0.15.0",
"language-text": "0.6.0",
"language-todo": "0.19.0",
"language-toml": "0.15.0",
"language-todo": "0.20.0",
"language-toml": "0.16.0",
"language-xml": "0.28.0",
"language-yaml": "0.22.0"
},

View File

@@ -1,5 +1,5 @@
{
"name": "package-with-incompatible-native-module",
"version": "1.0",
"version": "1.0.0",
"main": "./main.js"
}

View File

@@ -9,7 +9,7 @@ return if process.env.TRAVIS
fs = require "fs"
path = require "path"
temp = require("temp").track()
runAtom = require("./helpers/start-atom")
runAtom = require "./helpers/start-atom"
describe "Starting Atom", ->
[tempDirPath, otherTempDirPath, atomHome] = []
@@ -41,6 +41,69 @@ describe "Starting Atom", ->
.then ({value}) -> expect(value).toBe "Hello!"
.dispatchCommand("editor:delete-line")
it "opens the file to the specified line number", ->
filePath = path.join(fs.realpathSync(tempDirPath), "new-file")
fs.writeFileSync filePath, """
1
2
3
4
"""
runAtom ["#{filePath}:3"], {ATOM_HOME: atomHome}, (client) ->
client
.waitForWindowCount(1, 1000)
.waitForExist("atom-workspace", 5000)
.waitForPaneItemCount(1, 1000)
.waitForExist("atom-text-editor", 5000)
.then (exists) -> expect(exists).toBe true
.execute -> atom.workspace.getActiveTextEditor().getPath()
.then ({value}) -> expect(value).toBe filePath
.execute -> atom.workspace.getActiveTextEditor().getCursorBufferPosition()
.then ({value}) ->
expect(value.row).toBe 2
expect(value.column).toBe 0
it "opens the file to the specified line number and column number", ->
filePath = path.join(fs.realpathSync(tempDirPath), "new-file")
fs.writeFileSync filePath, """
1
2
3
4
"""
runAtom ["#{filePath}:2:2"], {ATOM_HOME: atomHome}, (client) ->
client
.waitForWindowCount(1, 1000)
.waitForExist("atom-workspace", 5000)
.waitForPaneItemCount(1, 1000)
.waitForExist("atom-text-editor", 5000)
.then (exists) -> expect(exists).toBe true
.execute -> atom.workspace.getActiveTextEditor().getPath()
.then ({value}) -> expect(value).toBe filePath
.execute -> atom.workspace.getActiveTextEditor().getCursorBufferPosition()
.then ({value}) ->
expect(value.row).toBe 1
expect(value.column).toBe 1
it "removes all trailing whitespace and colons from the specified path", ->
filePath = path.join(tempDirPath, "new-file")
runAtom ["#{filePath}: "], {ATOM_HOME: atomHome}, (client) ->
client
.waitForWindowCount(1, 1000)
.waitForExist("atom-workspace", 5000)
.waitForPaneItemCount(1, 1000)
.waitForExist("atom-text-editor", 5000)
.then (exists) -> expect(exists).toBe true
.execute -> atom.workspace.getActiveTextEditor().getPath()
.then ({value}) -> expect(value).toBe filePath
describe "when there is already a window open", ->
it "reuses that window when opening files, but not when opening directories", ->
tempFilePath = path.join(temp.mkdirSync("a-third-dir"), "a-file")

View File

@@ -162,8 +162,8 @@ class ApplicationMenu
firstKeystroke = keystrokesByCommand[command]?[0]
return null unless firstKeystroke
modifiers = firstKeystroke.split('-')
key = modifiers.pop()
modifiers = firstKeystroke.split(/-(?=.)/)
key = modifiers.pop().toUpperCase().replace('+', 'Plus')
modifiers = modifiers.map (modifier) ->
modifier.replace(/shift/ig, "Shift")
@@ -171,5 +171,5 @@ class ApplicationMenu
.replace(/ctrl/ig, "Ctrl")
.replace(/alt/ig, "Alt")
keys = modifiers.concat([key.toUpperCase()])
keys = modifiers.concat([key])
keys.join("+")

View File

@@ -424,12 +424,7 @@ class AtomApplication
for window in @windows
if loadSettings = window.getLoadSettings()
unless loadSettings.isSpec
states.push(_.pick(loadSettings,
'initialPaths'
'devMode'
'safeMode'
'apiPreviewMode'
))
states.push(initialPaths: loadSettings.initialPaths)
@storageFolder.store('application.json', states)
loadState: ->
@@ -438,9 +433,9 @@ class AtomApplication
@openWithOptions({
pathsToOpen: state.initialPaths
urlsToOpen: []
devMode: state.devMode
safeMode: state.safeMode
apiPreviewMode: state.apiPreviewMode
devMode: @devMode
safeMode: @safeMode
apiPreviewMode: @apiPreviewMode
})
true
else
@@ -517,6 +512,8 @@ class AtomApplication
return {pathToOpen} unless pathToOpen
return {pathToOpen} if fs.existsSync(pathToOpen)
pathToOpen = pathToOpen.replace(/[:\s]+$/, '')
[fileToOpen, initialLine, initialColumn] = path.basename(pathToOpen).split(':')
return {pathToOpen} unless initialLine
return {pathToOpen} unless parseInt(initialLine) >= 0

View File

@@ -1120,7 +1120,7 @@ class DisplayBuffer extends Model
{screenLines, regions} = @buildScreenLines(startBufferRow, endBufferRow + bufferDelta)
screenDelta = screenLines.length - (endScreenRow - startScreenRow)
@screenLines[startScreenRow...endScreenRow] = screenLines
_.spliceWithArray(@screenLines, startScreenRow, endScreenRow - startScreenRow, screenLines, 10000)
@rowMap.spliceRegions(startBufferRow, endBufferRow - startBufferRow, regions)
@findMaxLineLength(startScreenRow, endScreenRow, screenLines, screenDelta)