mirror of
https://github.com/atom/atom.git
synced 2026-01-24 06:18:03 -05:00
Merge remote-tracking branch 'origin/master' into vim-core-changes
This commit is contained in:
2
Rakefile
2
Rakefile
@@ -28,7 +28,7 @@ end
|
||||
|
||||
desc "Download node binary"
|
||||
task "update-node" do
|
||||
`script/update-node v0.10.1`
|
||||
`script/update-node v0.10.3`
|
||||
end
|
||||
|
||||
desc "Download debug symbols for CEF"
|
||||
|
||||
2
atom.gyp
2
atom.gyp
@@ -175,7 +175,7 @@
|
||||
# is marked for no PIE (ASLR).
|
||||
'postbuild_name': 'Make More Helpers',
|
||||
'action': [
|
||||
'tools/mac/make_more_helpers.sh',
|
||||
'script/make_more_helpers.sh',
|
||||
'Frameworks',
|
||||
'Atom',
|
||||
],
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
Buffers
|
||||
modify
|
||||
- if dirty alert user (immediately if focused, or on next focus)
|
||||
- if clean update contents
|
||||
|
||||
remove
|
||||
- mark file as unsaved (but maintains previous path)
|
||||
- only unsubscribe from KQueue
|
||||
- attempt to resubscribe after timeout (because of git weirdness)
|
||||
|
||||
move file
|
||||
- update path
|
||||
|
||||
move ancestor directory
|
||||
- update path on focus and save
|
||||
|
||||
recreated after remove (at same path)
|
||||
- resubscribe on focus or save
|
||||
@@ -1,6 +0,0 @@
|
||||
## The Little Things™
|
||||
I recently switched over to Sublime Text 2 and for the most part it's been pretty awesome. But I've been noticing a lot of little things that I really appreciate in an editor, so I thought I'd note them down.
|
||||
|
||||
1. Indenting soft-wrapped lines http://share.kyleneath.com/captures/_upsell.html.erb-20120127-231402.png
|
||||
2. Respecting Chrome-like tab behavior (drag between windows/panes, `⌘+Shift+T` to get last closed tab back, `⌘+N` for a new tab in your current pane)
|
||||
3. Indent markers http://share.kyleneath.com/captures/billing_dependency.rb-20120127-232754.png
|
||||
@@ -13,7 +13,7 @@
|
||||
"coffee-cache": "0.1.0",
|
||||
"pegjs": "0.7.0",
|
||||
"async": "0.2.6",
|
||||
"nak": "git://github.com/kevinsawicki/nak.git",
|
||||
"nak": "0.2.12",
|
||||
"spellchecker": "0.2.0",
|
||||
"plist": "git://github.com/nathansobo/node-plist.git",
|
||||
"space-pen": "git://github.com/nathansobo/space-pen.git"
|
||||
|
||||
@@ -21,7 +21,7 @@ exit_unless_npm_exists
|
||||
npm install npm --silent
|
||||
|
||||
NODE_DIR="$HOME/.cefode-gyp"
|
||||
NODE_VERSION="0.10.1"
|
||||
NODE_VERSION="0.10.3"
|
||||
NODE_URL="https://gh-contractor-zcbenz.s3.amazonaws.com/cefode2/dist"
|
||||
if [ ! -d "node_modules/node-gyp" ]; then
|
||||
./node_modules/.bin/npm install node-gyp --silent
|
||||
|
||||
@@ -1283,9 +1283,11 @@ describe "EditSession", ->
|
||||
expect(cursor1.getBufferPosition()).toEqual [1, 0]
|
||||
expect(cursor2.getBufferPosition()).toEqual [2, 0]
|
||||
|
||||
editSession.backspaceToBeginningOfLine()
|
||||
expect(buffer.lineForRow(1)).toBe 'ems) {'
|
||||
expect(cursor1.getBufferPosition()).toEqual [1, 0]
|
||||
describe "when at the beginning of the line", ->
|
||||
it "deletes the newline", ->
|
||||
editSession.setCursorBufferPosition([2])
|
||||
editSession.backspaceToBeginningOfLine()
|
||||
expect(buffer.lineForRow(1)).toBe ' var sort = function(items) { if (items.length <= 1) return items;'
|
||||
|
||||
describe "when text is selected", ->
|
||||
it "still deletes all text to begginning of the line", ->
|
||||
@@ -2157,3 +2159,40 @@ describe "EditSession", ->
|
||||
expect(buffer.getMarkerCount()).toBeGreaterThan 0
|
||||
editSession.destroy()
|
||||
expect(buffer.getMarkerCount()).toBe 0
|
||||
|
||||
describe ".joinLine()", ->
|
||||
describe "when no text is selected", ->
|
||||
describe "when the line below isn't empty", ->
|
||||
it "joins the line below with the current line separated by a space and moves the cursor to the start of line that was moved up", ->
|
||||
editSession.joinLine()
|
||||
expect(editSession.lineForBufferRow(0)).toBe 'var quicksort = function () { var sort = function(items) {'
|
||||
expect(editSession.getCursorBufferPosition()).toEqual [0, 30]
|
||||
|
||||
describe "when the line below is empty", ->
|
||||
it "deletes the line below and moves the cursor to the end of the line", ->
|
||||
editSession.setCursorBufferPosition([9])
|
||||
editSession.joinLine()
|
||||
expect(editSession.lineForBufferRow(9)).toBe ' };'
|
||||
expect(editSession.lineForBufferRow(10)).toBe ' return sort(Array.apply(this, arguments));'
|
||||
expect(editSession.getCursorBufferPosition()).toEqual [9, 4]
|
||||
|
||||
describe "when the cursor is on the last row", ->
|
||||
it "does nothing", ->
|
||||
editSession.setCursorBufferPosition([Infinity, Infinity])
|
||||
editSession.joinLine()
|
||||
expect(editSession.lineForBufferRow(12)).toBe '};'
|
||||
|
||||
describe "when text is selected", ->
|
||||
describe "when the selection does not span multiple lines", ->
|
||||
it "joins the line below with the current line separated by a space and retains the selected text", ->
|
||||
editSession.setSelectedBufferRange([[0, 1], [0, 3]])
|
||||
editSession.joinLine()
|
||||
expect(editSession.lineForBufferRow(0)).toBe 'var quicksort = function () { var sort = function(items) {'
|
||||
expect(editSession.getSelectedBufferRange()).toEqual [[0, 1], [0, 3]]
|
||||
|
||||
describe "when the selection spans multiple lines", ->
|
||||
it "joins all selected lines separated by a space and retains the selected text", ->
|
||||
editSession.setSelectedBufferRange([[9, 3], [12, 1]])
|
||||
editSession.joinLine()
|
||||
expect(editSession.lineForBufferRow(9)).toBe ' }; return sort(Array.apply(this, arguments)); };'
|
||||
expect(editSession.getSelectedBufferRange()).toEqual [[9, 3], [9, 49]]
|
||||
|
||||
@@ -778,6 +778,9 @@ class EditSession
|
||||
lowerCase: ->
|
||||
@replaceSelectedText selectWordIfEmpty:true, (text) => text.toLowerCase()
|
||||
|
||||
joinLine: ->
|
||||
@mutateSelectedText (selection) -> selection.joinLine()
|
||||
|
||||
expandLastSelectionOverLine: ->
|
||||
@getLastSelection().expandOverLine()
|
||||
|
||||
|
||||
@@ -157,6 +157,7 @@ class Editor extends View
|
||||
'editor:move-line-up': @moveLineUp
|
||||
'editor:move-line-down': @moveLineDown
|
||||
'editor:duplicate-line': @duplicateLine
|
||||
'editor:join-line': @joinLine
|
||||
'editor:toggle-indent-guide': => config.set('editor.showIndentGuide', !config.get('editor.showIndentGuide'))
|
||||
'editor:save-debug-snapshot': @saveDebugSnapshot
|
||||
'editor:toggle-line-numbers': => config.set('editor.showLineNumbers', !config.get('editor.showLineNumbers'))
|
||||
@@ -186,6 +187,7 @@ class Editor extends View
|
||||
moveLineDown: -> @activeEditSession.moveLineDown()
|
||||
setCursorScreenPosition: (position, options) -> @activeEditSession.setCursorScreenPosition(position, options)
|
||||
duplicateLine: -> @activeEditSession.duplicateLine()
|
||||
joinLine: -> @activeEditSession.joinLine()
|
||||
getCursorScreenPosition: -> @activeEditSession.getCursorScreenPosition()
|
||||
getCursorScreenRow: -> @activeEditSession.getCursorScreenRow()
|
||||
setCursorBufferPosition: (position, options) -> @activeEditSession.setCursorBufferPosition(position, options)
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
'ctrl-meta-up': 'editor:move-line-up'
|
||||
'ctrl-meta-down': 'editor:move-line-down'
|
||||
'meta-D': 'editor:duplicate-line'
|
||||
'ctrl-J': 'editor:join-line'
|
||||
|
||||
'.editor.mini':
|
||||
'enter': 'core:confirm',
|
||||
|
||||
@@ -243,7 +243,10 @@ class Selection
|
||||
@deleteSelectedText()
|
||||
|
||||
backspaceToBeginningOfLine: ->
|
||||
@selectToBeginningOfLine()
|
||||
if @isEmpty() and @cursor.isAtBeginningOfLine()
|
||||
@selectLeft()
|
||||
else
|
||||
@selectToBeginningOfLine()
|
||||
@deleteSelectedText()
|
||||
|
||||
delete: ->
|
||||
@@ -283,6 +286,31 @@ class Selection
|
||||
end--
|
||||
@editSession.buffer.deleteRows(start, end)
|
||||
|
||||
joinLine: ->
|
||||
selectedRange = @getBufferRange()
|
||||
if selectedRange.isEmpty()
|
||||
return if selectedRange.start.row is @editSession.buffer.getLastRow()
|
||||
else
|
||||
joinMarker = @editSession.markBufferRange(selectedRange, invalidationStrategy: 'never')
|
||||
|
||||
rowCount = Math.max(1, selectedRange.getRowCount() - 1)
|
||||
for row in [0...rowCount]
|
||||
@cursor.setBufferPosition([selectedRange.start.row])
|
||||
@cursor.moveToEndOfLine()
|
||||
nextRow = selectedRange.start.row + 1
|
||||
if nextRow <= @editSession.buffer.getLastRow() and @editSession.buffer.lineLengthForRow(nextRow) > 0
|
||||
@insertText(' ')
|
||||
@cursor.moveToEndOfLine()
|
||||
@modifySelection =>
|
||||
@cursor.moveRight()
|
||||
@cursor.moveToFirstCharacterOfLine()
|
||||
@deleteSelectedText()
|
||||
|
||||
if joinMarker?
|
||||
newSelectedRange = @editSession.getMarkerBufferRange(joinMarker)
|
||||
@setBufferRange(newSelectedRange)
|
||||
@editSession.destroyMarker(joinMarker)
|
||||
|
||||
outdentSelectedRows: ->
|
||||
[start, end] = @getBufferRowRange()
|
||||
buffer = @editSession.buffer
|
||||
|
||||
@@ -31,12 +31,12 @@
|
||||
min-width: 1em;
|
||||
box-sizing: border-box;
|
||||
text-align: right;
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
.editor .gutter .line-number {
|
||||
padding-right: .5em;
|
||||
padding-left: .5em;
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
.editor .gutter .line-numbers {
|
||||
|
||||
Reference in New Issue
Block a user