From eab26fb3a60b4422ffddf0ae30719915eb4191fc Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Tue, 7 Jan 2014 19:19:42 -0700 Subject: [PATCH 01/32] Properly exit when render process crashes if exitWhenDone option is true Previously, we were referring to an undefined `atom` global to exit when the render process crashed in specs. Now we only exit when exitWhenDone is true, which will only exit in headless specs. Also, we now call .exit on an object that's actually defined. --- src/browser/atom-application.coffee | 2 ++ src/browser/atom-window.coffee | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/browser/atom-application.coffee b/src/browser/atom-application.coffee index 3e9aacc18..fa18a59c1 100644 --- a/src/browser/atom-application.coffee +++ b/src/browser/atom-application.coffee @@ -52,6 +52,8 @@ class AtomApplication resourcePath: null version: null + exit: (status) -> app.exit(status) + constructor: (options) -> {@resourcePath, @version, @devMode} = options global.atomApplication = this diff --git a/src/browser/atom-window.coffee b/src/browser/atom-window.coffee index 9a15c251b..0f09bfaa4 100644 --- a/src/browser/atom-window.coffee +++ b/src/browser/atom-window.coffee @@ -18,7 +18,7 @@ class AtomWindow isSpec: null constructor: (settings={}) -> - {@resourcePath, pathToOpen, initialLine, @isSpec} = settings + {@resourcePath, pathToOpen, initialLine, @isSpec, @exitWhenDone} = settings global.atomApplication.addWindow(this) @setupNodePath(@resourcePath) @@ -82,7 +82,7 @@ class AtomWindow @browserWindow.destroy() if chosen is 0 @browserWindow.on 'crashed', => - atom.exit(100) if @isSpec + global.atomApplication.exit(100) if @exitWhenDone chosen = dialog.showMessageBox @browserWindow, type: 'warning' From 765c15829d2f5876690cf1be21751587b65cbe6e Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 8 Jan 2014 14:01:15 -0800 Subject: [PATCH 02/32] Upgrade to fuzzaldrin@0.4.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0683dbeff..92bf5da8e 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "first-mate": "0.11.0", "fs-plus": "0.14.0", "fstream": "0.1.24", - "fuzzaldrin": "0.1.0", + "fuzzaldrin": "0.4.0", "git-utils": "0.29.0", "guid": "0.0.10", "jasmine-focused": "~0.15.0", From cde5861cb8d03c787af91591037720d8fa0827bd Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 8 Jan 2014 14:17:40 -0800 Subject: [PATCH 03/32] Upgrade to fuzzaldrin@0.5.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 92bf5da8e..2cd2d4e7b 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "first-mate": "0.11.0", "fs-plus": "0.14.0", "fstream": "0.1.24", - "fuzzaldrin": "0.4.0", + "fuzzaldrin": "0.5.0", "git-utils": "0.29.0", "guid": "0.0.10", "jasmine-focused": "~0.15.0", From 1382bd3b3bcd104c154e5481f54e793b88067bc6 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 8 Jan 2014 14:37:41 -0800 Subject: [PATCH 04/32] Upgrade to settings-view@0.55.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2cd2d4e7b..79dad306a 100644 --- a/package.json +++ b/package.json @@ -86,7 +86,7 @@ "metrics": "0.20.0", "package-generator": "0.23.0", "release-notes": "0.15.0", - "settings-view": "0.54.0", + "settings-view": "0.55.0", "snippets": "0.17.0", "spell-check": "0.18.0", "status-bar": "0.30.0", From 750f4ee410db528fe3e630eee96490fae272bfa9 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 8 Jan 2014 15:14:34 -0800 Subject: [PATCH 05/32] Upgrade to to-the-hubs@0.17.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 79dad306a..4ef1ce70c 100644 --- a/package.json +++ b/package.json @@ -95,7 +95,7 @@ "tabs": "0.16.0", "terminal": "0.23.0", "timecop": "0.12.0", - "to-the-hubs": "0.16.0", + "to-the-hubs": "0.17.0", "tree-view": "0.58.0", "visual-bell": "0.6.0", "welcome": "0.4.0", From deb4365d65cbbf3537addfa312cbfc9a12eb6895 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 8 Jan 2014 15:16:37 -0800 Subject: [PATCH 06/32] Upgrade to fuzzy-finder@0.29.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4ef1ce70c..070984469 100644 --- a/package.json +++ b/package.json @@ -74,7 +74,7 @@ "exception-reporting": "0.9.0", "feedback": "0.22.0", "find-and-replace": "0.68.0", - "fuzzy-finder": "0.28.0", + "fuzzy-finder": "0.29.0", "gists": "0.13.0", "git-diff": "0.21.0", "github-sign-in": "0.15.0", From 0ef6757e655f1c09cd793d910fb13bcd58a2d72c Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 7 Jan 2014 18:17:34 -0800 Subject: [PATCH 07/32] Add Editor::splitSelectionIntoLines --- spec/editor-spec.coffee | 21 +++++++++++++++++++++ src/editor-view.coffee | 4 ++++ src/editor.coffee | 20 ++++++++++++++++++++ 3 files changed, 45 insertions(+) diff --git a/spec/editor-spec.coffee b/spec/editor-spec.coffee index 821c9becb..353b6ad66 100644 --- a/spec/editor-spec.coffee +++ b/spec/editor-spec.coffee @@ -1181,6 +1181,27 @@ describe "Editor", -> [[10, 0], [10, 0]] ] + describe ".splitSelectionIntoLines()", -> + it "splits all multi-line selections into one selection per line", -> + editor.setSelectedBufferRange([[0, 3], [2, 4]]) + editor.splitSelectionIntoLines() + expect(editor.getSelectedBufferRanges()).toEqual [ + [[0, 3], [0, 29]] + [[1, 0], [1, 30]] + [[2, 0], [2, 4]] + ] + + editor.setSelectedBufferRange([[0, 3], [1, 10]]) + editor.splitSelectionIntoLines() + expect(editor.getSelectedBufferRanges()).toEqual [ + [[0, 3], [0, 29]] + [[1, 0], [1, 10]] + ] + + editor.setSelectedBufferRange([[0, 0], [0, 3]]) + editor.splitSelectionIntoLines() + expect(editor.getSelectedBufferRanges()).toEqual [[[0, 0], [0, 3]]] + describe ".consolidateSelections()", -> it "destroys all selections but the most recent, returning true if any selections were destroyed", -> editor.setSelectedBufferRange([[3, 16], [3, 21]]) diff --git a/src/editor-view.coffee b/src/editor-view.coffee index 9c51a5554..f017967d8 100644 --- a/src/editor-view.coffee +++ b/src/editor-view.coffee @@ -183,6 +183,7 @@ class EditorView extends View 'editor:newline-above': @insertNewlineAbove 'editor:add-selection-below': @addSelectionBelow 'editor:add-selection-above': @addSelectionAbove + 'editor:split-selection-into-lines': @splitSelectionIntoLines 'editor:toggle-soft-tabs': @toggleSoftTabs 'editor:toggle-soft-wrap': @toggleSoftWrap 'editor:fold-all': @foldAll @@ -375,6 +376,9 @@ class EditorView extends View # {Delegates to: Editor.addSelectionAbove} addSelectionAbove: -> @editor.addSelectionAbove() + # {Delegates to: Editor.splitSelectionIntoLines} + splitSelectionIntoLines: -> @editor.splitSelectionIntoLines() + # {Delegates to: Editor.selectToBeginningOfWord} selectToBeginningOfWord: -> @editor.selectToBeginningOfWord() diff --git a/src/editor.coffee b/src/editor.coffee index cff06ddfc..f2efe5c37 100644 --- a/src/editor.coffee +++ b/src/editor.coffee @@ -1190,6 +1190,26 @@ class Editor extends Model addSelectionAbove: -> @expandSelectionsBackward (selection) => selection.addSelectionAbove() + # Public: Split any multi-line selections into one selection per line. + # + # This method breaks apart multi-line selections by adding new selections + # that select the entire line for all completely selected lines and leaves + # any partially selected lines at the start and end of the selection as-is. + # + # This method will not affect any single line selections. + splitSelectionIntoLines: -> + for selection in @getSelections() + range = selection.getBufferRange() + continue if range.isSingleLine() + + selection.destroy() + {start, end} = range + @addSelectionForBufferRange([start, [start.row, Infinity]]) + {row} = start + while ++row < end.row + @addSelectionForBufferRange([[row, 0], [row, Infinity]]) + @addSelectionForBufferRange([[end.row, 0], [end.row, end.column]]) + # Public: Transposes the current text selections. # # The text in each selection is reversed so `abcd` would become `dcba`. The From fe0184d0672bebb134ea44bb5bbaa11e5de31cc8 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 7 Jan 2014 18:20:03 -0800 Subject: [PATCH 08/32] Add Split into Lines menu item --- menus/darwin.cson | 1 + menus/win32.cson | 1 + 2 files changed, 2 insertions(+) diff --git a/menus/darwin.cson b/menus/darwin.cson index 8cd314c1e..c20379e54 100644 --- a/menus/darwin.cson +++ b/menus/darwin.cson @@ -99,6 +99,7 @@ submenu: [ { label: 'Add Selection Above', command: 'editor:add-selection-above' } { label: 'Add Selection Below', command: 'editor:add-selection-below' } + { label: 'Split into Lines', command: 'editor:split-selection-into-lines'} { type: 'separator' } { label: 'Select to Top', command: 'core:select-to-top' } { label: 'Select to Bottom', command: 'core:select-to-bottom' } diff --git a/menus/win32.cson b/menus/win32.cson index e4017fc42..8263f99a5 100644 --- a/menus/win32.cson +++ b/menus/win32.cson @@ -106,6 +106,7 @@ submenu: [ { label: 'Add Selection &Above', command: 'editor:add-selection-above' } { label: 'Add Selection &Below', command: 'editor:add-selection-below' } + { label: 'S&plit into Lines', command: 'editor:split-selection-into-lines'} { type: 'separator' } { label: 'Select to &Top', command: 'core:select-to-top' } { label: 'Select to Botto&m', command: 'core:select-to-bottom' } From 82c73c9911e44a4d9fdf7dd74d0374de9f061def Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 7 Jan 2014 18:24:41 -0800 Subject: [PATCH 09/32] :memo: Tweak comment for clarity --- src/editor.coffee | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/editor.coffee b/src/editor.coffee index f2efe5c37..4b9842e6d 100644 --- a/src/editor.coffee +++ b/src/editor.coffee @@ -1192,9 +1192,8 @@ class Editor extends Model # Public: Split any multi-line selections into one selection per line. # - # This method breaks apart multi-line selections by adding new selections - # that select the entire line for all completely selected lines and leaves - # any partially selected lines at the start and end of the selection as-is. + # This methods break apart all multi-line selections to create multiple + # single-line selections that cumulatively cover the same original area. # # This method will not affect any single line selections. splitSelectionIntoLines: -> From 32fdf0b681ab9a455e9601f85587d32f4532e187 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 7 Jan 2014 18:29:42 -0800 Subject: [PATCH 10/32] :memo: Drop line about single line selections --- src/editor.coffee | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/editor.coffee b/src/editor.coffee index 4b9842e6d..49ba87518 100644 --- a/src/editor.coffee +++ b/src/editor.coffee @@ -1194,8 +1194,6 @@ class Editor extends Model # # This methods break apart all multi-line selections to create multiple # single-line selections that cumulatively cover the same original area. - # - # This method will not affect any single line selections. splitSelectionIntoLines: -> for selection in @getSelections() range = selection.getBufferRange() From c8f3e056e93ec508cee1661b8c7fb655d5b0f3ee Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 8 Jan 2014 14:51:50 -0800 Subject: [PATCH 11/32] Pluralize selections in method name --- spec/editor-spec.coffee | 8 ++++---- src/editor-view.coffee | 5 +---- src/editor.coffee | 2 +- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/spec/editor-spec.coffee b/spec/editor-spec.coffee index 353b6ad66..93d19e815 100644 --- a/spec/editor-spec.coffee +++ b/spec/editor-spec.coffee @@ -1181,10 +1181,10 @@ describe "Editor", -> [[10, 0], [10, 0]] ] - describe ".splitSelectionIntoLines()", -> + describe ".splitSelectionsIntoLines()", -> it "splits all multi-line selections into one selection per line", -> editor.setSelectedBufferRange([[0, 3], [2, 4]]) - editor.splitSelectionIntoLines() + editor.splitSelectionsIntoLines() expect(editor.getSelectedBufferRanges()).toEqual [ [[0, 3], [0, 29]] [[1, 0], [1, 30]] @@ -1192,14 +1192,14 @@ describe "Editor", -> ] editor.setSelectedBufferRange([[0, 3], [1, 10]]) - editor.splitSelectionIntoLines() + editor.splitSelectionsIntoLines() expect(editor.getSelectedBufferRanges()).toEqual [ [[0, 3], [0, 29]] [[1, 0], [1, 10]] ] editor.setSelectedBufferRange([[0, 0], [0, 3]]) - editor.splitSelectionIntoLines() + editor.splitSelectionsIntoLines() expect(editor.getSelectedBufferRanges()).toEqual [[[0, 0], [0, 3]]] describe ".consolidateSelections()", -> diff --git a/src/editor-view.coffee b/src/editor-view.coffee index f017967d8..f198b2df4 100644 --- a/src/editor-view.coffee +++ b/src/editor-view.coffee @@ -183,7 +183,7 @@ class EditorView extends View 'editor:newline-above': @insertNewlineAbove 'editor:add-selection-below': @addSelectionBelow 'editor:add-selection-above': @addSelectionAbove - 'editor:split-selection-into-lines': @splitSelectionIntoLines + 'editor:split-selection-into-lines': => @editor.splitSelectionsIntoLines() 'editor:toggle-soft-tabs': @toggleSoftTabs 'editor:toggle-soft-wrap': @toggleSoftWrap 'editor:fold-all': @foldAll @@ -376,9 +376,6 @@ class EditorView extends View # {Delegates to: Editor.addSelectionAbove} addSelectionAbove: -> @editor.addSelectionAbove() - # {Delegates to: Editor.splitSelectionIntoLines} - splitSelectionIntoLines: -> @editor.splitSelectionIntoLines() - # {Delegates to: Editor.selectToBeginningOfWord} selectToBeginningOfWord: -> @editor.selectToBeginningOfWord() diff --git a/src/editor.coffee b/src/editor.coffee index 49ba87518..bbefa2f69 100644 --- a/src/editor.coffee +++ b/src/editor.coffee @@ -1194,7 +1194,7 @@ class Editor extends Model # # This methods break apart all multi-line selections to create multiple # single-line selections that cumulatively cover the same original area. - splitSelectionIntoLines: -> + splitSelectionsIntoLines: -> for selection in @getSelections() range = selection.getBufferRange() continue if range.isSingleLine() From bdb4cd5247a01138ad359dd28bc52d0f15752069 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 8 Jan 2014 15:41:32 -0800 Subject: [PATCH 12/32] Upgrade to grammar-selector@0.16.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 070984469..18d71f640 100644 --- a/package.json +++ b/package.json @@ -79,7 +79,7 @@ "git-diff": "0.21.0", "github-sign-in": "0.15.0", "go-to-line": "0.12.0", - "grammar-selector": "0.15.0", + "grammar-selector": "0.16.0", "image-view": "0.14.0", "keybinding-resolver": "0.8.0", "markdown-preview": "0.22.0", From 8e51a7f6d618134a9f554305b99313c7ee07a25b Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 8 Jan 2014 15:44:34 -0800 Subject: [PATCH 13/32] Bind cmd-shift-l to split selectin into lines --- keymaps/darwin.cson | 1 + 1 file changed, 1 insertion(+) diff --git a/keymaps/darwin.cson b/keymaps/darwin.cson index adf8bb64b..0147e846a 100644 --- a/keymaps/darwin.cson +++ b/keymaps/darwin.cson @@ -129,6 +129,7 @@ 'cmd-/': 'editor:toggle-line-comments' 'cmd-j': 'editor:join-line' 'cmd-D': 'editor:duplicate-line' + 'cmd-L': 'editor:split-selection-into-lines' 'cmd-alt-[': 'editor:fold-current-row' 'cmd-alt-]': 'editor:unfold-current-row' From 0fd8b6be8dd49cc9b24acc1a7f5d368b5c22cd81 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 8 Jan 2014 15:45:09 -0800 Subject: [PATCH 14/32] Pluralize selection in event name --- keymaps/darwin.cson | 2 +- menus/darwin.cson | 2 +- menus/win32.cson | 2 +- src/editor-view.coffee | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/keymaps/darwin.cson b/keymaps/darwin.cson index 0147e846a..ca8eaa0f7 100644 --- a/keymaps/darwin.cson +++ b/keymaps/darwin.cson @@ -129,7 +129,7 @@ 'cmd-/': 'editor:toggle-line-comments' 'cmd-j': 'editor:join-line' 'cmd-D': 'editor:duplicate-line' - 'cmd-L': 'editor:split-selection-into-lines' + 'cmd-L': 'editor:split-selections-into-lines' 'cmd-alt-[': 'editor:fold-current-row' 'cmd-alt-]': 'editor:unfold-current-row' diff --git a/menus/darwin.cson b/menus/darwin.cson index c20379e54..8d7c8b754 100644 --- a/menus/darwin.cson +++ b/menus/darwin.cson @@ -99,7 +99,7 @@ submenu: [ { label: 'Add Selection Above', command: 'editor:add-selection-above' } { label: 'Add Selection Below', command: 'editor:add-selection-below' } - { label: 'Split into Lines', command: 'editor:split-selection-into-lines'} + { label: 'Split into Lines', command: 'editor:split-selections-into-lines'} { type: 'separator' } { label: 'Select to Top', command: 'core:select-to-top' } { label: 'Select to Bottom', command: 'core:select-to-bottom' } diff --git a/menus/win32.cson b/menus/win32.cson index 8263f99a5..339da35a5 100644 --- a/menus/win32.cson +++ b/menus/win32.cson @@ -106,7 +106,7 @@ submenu: [ { label: 'Add Selection &Above', command: 'editor:add-selection-above' } { label: 'Add Selection &Below', command: 'editor:add-selection-below' } - { label: 'S&plit into Lines', command: 'editor:split-selection-into-lines'} + { label: 'S&plit into Lines', command: 'editor:split-selections-into-lines'} { type: 'separator' } { label: 'Select to &Top', command: 'core:select-to-top' } { label: 'Select to Botto&m', command: 'core:select-to-bottom' } diff --git a/src/editor-view.coffee b/src/editor-view.coffee index f198b2df4..eb8d2cfbc 100644 --- a/src/editor-view.coffee +++ b/src/editor-view.coffee @@ -183,7 +183,7 @@ class EditorView extends View 'editor:newline-above': @insertNewlineAbove 'editor:add-selection-below': @addSelectionBelow 'editor:add-selection-above': @addSelectionAbove - 'editor:split-selection-into-lines': => @editor.splitSelectionsIntoLines() + 'editor:split-selections-into-lines': => @editor.splitSelectionsIntoLines() 'editor:toggle-soft-tabs': @toggleSoftTabs 'editor:toggle-soft-wrap': @toggleSoftWrap 'editor:fold-all': @foldAll From a69e6136eaa0c8e02fdd34721188c7caa4092f1f Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 8 Jan 2014 15:47:29 -0800 Subject: [PATCH 15/32] Upgrade to go-to-line@0.13.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 18d71f640..673ee5357 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,7 @@ "gists": "0.13.0", "git-diff": "0.21.0", "github-sign-in": "0.15.0", - "go-to-line": "0.12.0", + "go-to-line": "0.13.0", "grammar-selector": "0.16.0", "image-view": "0.14.0", "keybinding-resolver": "0.8.0", From 27f0d11039b427665d1092a1be2c7014ee7a9def Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 8 Jan 2014 15:48:52 -0800 Subject: [PATCH 16/32] Map cmd-l to editor:select-line --- keymaps/darwin.cson | 1 + 1 file changed, 1 insertion(+) diff --git a/keymaps/darwin.cson b/keymaps/darwin.cson index ca8eaa0f7..facd6cc8e 100644 --- a/keymaps/darwin.cson +++ b/keymaps/darwin.cson @@ -111,6 +111,7 @@ 'cmd-alt-p': 'editor:log-cursor-scope' 'cmd-k cmd-u': 'editor:upper-case' 'cmd-k cmd-l': 'editor:lower-case' + 'cmd-l': 'editor:select-line' 'body.platform-darwin .editor:not(.mini)': # Atom specific From d95aa0aac121a7377262dfcdc4faefd1d38d456c Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 8 Jan 2014 16:22:52 -0800 Subject: [PATCH 17/32] Expand buffer range in Selection::selectLine --- spec/editor-spec.coffee | 5 +++++ src/selection.coffee | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/spec/editor-spec.coffee b/spec/editor-spec.coffee index 93d19e815..96bca8bf3 100644 --- a/spec/editor-spec.coffee +++ b/spec/editor-spec.coffee @@ -819,6 +819,11 @@ describe "Editor", -> editor.selectLine() expect(editor.getSelectedBufferRange()).toEqual [[12,0], [12,2]] + editor.setCursorBufferPosition([0, 2]) + editor.selectLine() + editor.selectLine() + expect(editor.getSelectedBufferRange()).toEqual [[0,0], [2,0]] + describe ".selectToBeginningOfWord()", -> it "selects text from cusor position to beginning of word", -> editor.setCursorScreenPosition [0,13] diff --git a/src/selection.coffee b/src/selection.coffee index fa5078b67..915f3fb0b 100644 --- a/src/selection.coffee +++ b/src/selection.coffee @@ -132,7 +132,7 @@ class Selection # The line Number to select (default: the row of the cursor) selectLine: (row=@cursor.getBufferPosition().row) -> range = @editor.bufferRangeForBufferRow(row, includeNewline: true) - @setBufferRange(range) + @setBufferRange(@getBufferRange().union(range)) @linewise = true @wordwise = false @initialScreenRange = @getScreenRange() From dce70b35b5bba4dc3a80f91a8ea985e3ef62adf9 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 8 Jan 2014 17:37:09 -0800 Subject: [PATCH 18/32] Upgrade to go-to-line@0.14.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 673ee5357..1bc49f1ea 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,7 @@ "gists": "0.13.0", "git-diff": "0.21.0", "github-sign-in": "0.15.0", - "go-to-line": "0.13.0", + "go-to-line": "0.14.0", "grammar-selector": "0.16.0", "image-view": "0.14.0", "keybinding-resolver": "0.8.0", From 371e31c78658c135cc32e9cb6194628b947fecbd Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 8 Jan 2014 17:55:08 -0800 Subject: [PATCH 19/32] :racehorse: Test for prefix without calling path.join Directory::relativize is called many times by the fuzzy finder and using path.join possibly multiple times per call was consuming much of the time take to show the fuzzy finder view. --- src/directory.coffee | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/directory.coffee b/src/directory.coffee index 8a17435b6..1719e93cb 100644 --- a/src/directory.coffee +++ b/src/directory.coffee @@ -73,11 +73,11 @@ class Directory if fullPath is @getPath() '' - else if fullPath.indexOf(path.join(@getPath(), path.sep)) is 0 + else if @isPathPrefixOf(@getPath(), fullPath) fullPath.substring(@getPath().length + 1) else if fullPath is @getRealPathSync() '' - else if fullPath.indexOf(path.join(@getRealPathSync(), path.sep)) is 0 + else if @isPathPrefixOf(@getRealPathSync(), fullPath) fullPath.substring(@getRealPathSync().length + 1) else fullPath @@ -139,3 +139,7 @@ class Directory if @watchSubscription? @watchSubscription.close() @watchSubscription = null + + # Private: Does given full path start with the given prefix? + isPathPrefixOf: (prefix, fullPath) -> + fullPath.indexOf(prefix) is 0 and fullPath[prefix.length] is path.sep From 6cb0f1ff7803b0e7002af2da93492100d0af6405 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 8 Jan 2014 18:12:36 -0800 Subject: [PATCH 20/32] Upgrade to fuzzy-finder@0.30.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1bc49f1ea..cdafe5e37 100644 --- a/package.json +++ b/package.json @@ -74,7 +74,7 @@ "exception-reporting": "0.9.0", "feedback": "0.22.0", "find-and-replace": "0.68.0", - "fuzzy-finder": "0.29.0", + "fuzzy-finder": "0.30.0", "gists": "0.13.0", "git-diff": "0.21.0", "github-sign-in": "0.15.0", From c397b3cc6081f74ddd708ce3a09c82c9b443d062 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 9 Jan 2014 08:53:29 -0800 Subject: [PATCH 21/32] Upgrade to first-mate@0.14.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index cdafe5e37..5b7e537ad 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "coffee-script": "1.6.3", "coffeestack": "0.6.0", "emissary": "0.19.0", - "first-mate": "0.11.0", + "first-mate": "0.14.0", "fs-plus": "0.14.0", "fstream": "0.1.24", "fuzzaldrin": "0.5.0", From ca6da5f9c1f0c76c996e9ba0efe0026c93ed3786 Mon Sep 17 00:00:00 2001 From: probablycorey Date: Thu, 9 Jan 2014 10:01:25 -0800 Subject: [PATCH 22/32] Update expcetion-reporting --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5b7e537ad..a87f4bfb2 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,7 @@ "command-palette": "0.14.0", "dev-live-reload": "0.22.0", "editor-stats": "0.12.0", - "exception-reporting": "0.9.0", + "exception-reporting": "0.10.0", "feedback": "0.22.0", "find-and-replace": "0.68.0", "fuzzy-finder": "0.30.0", From d3c6bd2f98a8a924619124556c7a8c03b4bff02f Mon Sep 17 00:00:00 2001 From: probablycorey Date: Thu, 9 Jan 2014 13:47:51 -0800 Subject: [PATCH 23/32] Use close instead of exit stdio might still be open when exit is called (http://nodejs.org/api/child_process.html#child_process_event_exit). With close you are guaranteed that there will be no more output. --- build/tasks/task-helpers.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/tasks/task-helpers.coffee b/build/tasks/task-helpers.coffee index 4362393d0..f83430884 100644 --- a/build/tasks/task-helpers.coffee +++ b/build/tasks/task-helpers.coffee @@ -39,7 +39,7 @@ module.exports = (grunt) -> proc = childProcess.spawn(options.cmd, options.args, options.opts) proc.stdout.on 'data', (data) -> stdout.push(data.toString()) proc.stderr.on 'data', (data) -> stderr.push(data.toString()) - proc.on 'exit', (exitCode, signal) -> + proc.on 'close', (exitCode, signal) -> error = new Error(signal) if exitCode != 0 results = {stderr: stderr.join(''), stdout: stdout.join(''), code: exitCode} grunt.log.error results.stderr if exitCode != 0 From 69f9f10c6b477ffec4f92504d384c93029040187 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 9 Jan 2014 13:56:15 -0800 Subject: [PATCH 24/32] Upgrade to find-and-replace@0.69.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a87f4bfb2..8c33aa824 100644 --- a/package.json +++ b/package.json @@ -73,7 +73,7 @@ "editor-stats": "0.12.0", "exception-reporting": "0.10.0", "feedback": "0.22.0", - "find-and-replace": "0.68.0", + "find-and-replace": "0.69.0", "fuzzy-finder": "0.30.0", "gists": "0.13.0", "git-diff": "0.21.0", From a1f8a21c7cf2df9e264b04cdc87fd99476ed8665 Mon Sep 17 00:00:00 2001 From: probablycorey Date: Thu, 9 Jan 2014 13:55:45 -0800 Subject: [PATCH 25/32] Output warning/error if diskspace on CI server is getting low. --- build/Gruntfile.coffee | 2 +- build/tasks/output-disk-space.coffee | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 build/tasks/output-disk-space.coffee diff --git a/build/Gruntfile.coffee b/build/Gruntfile.coffee index 831f18a15..7833ac0ac 100644 --- a/build/Gruntfile.coffee +++ b/build/Gruntfile.coffee @@ -210,7 +210,7 @@ module.exports = (grunt) -> grunt.registerTask('compile', ['coffee', 'prebuild-less', 'cson']) grunt.registerTask('lint', ['coffeelint', 'csslint', 'lesslint']) grunt.registerTask('test', ['shell:kill-atom', 'run-specs']) - grunt.registerTask('ci', ['download-atom-shell', 'build', 'set-development-version', 'lint', 'test', 'publish-build']) + grunt.registerTask('ci', ['output-disk-space', 'download-atom-shell', 'build', 'set-development-version', 'lint', 'test', 'publish-build']) grunt.registerTask('deploy', ['partial-clean', 'download-atom-shell', 'build', 'codesign']) grunt.registerTask('docs', ['markdown:guides', 'build-docs']) grunt.registerTask('default', ['download-atom-shell', 'build', 'set-development-version', 'install']) diff --git a/build/tasks/output-disk-space.coffee b/build/tasks/output-disk-space.coffee new file mode 100644 index 000000000..9767c7b8d --- /dev/null +++ b/build/tasks/output-disk-space.coffee @@ -0,0 +1,25 @@ +module.exports = (grunt) -> + {spawn} = require('./task-helpers')(grunt) + + grunt.registerTask 'output-disk-space', 'Print diskspace available', -> + return unless process.platform is 'darwin' + + done = @async() + + cmd = 'df' + args = ['-Hl'] + spawn {cmd, args}, (error, result, code) -> + return done(error) if error? + + lines = result.stdout.split("\n") + + for line in lines[1..] + [filesystem, size, used, avail, capacity, extra] = line.split(/\s+/) + capacity = parseInt(capacity) + + if capacity > 90 + grunt.log.error("#{filesystem} is at #{capacity}% capacity!") + else if capacity > 80 + grunt.log.error("#{filesystem} is at #{capacity}% capacity.") + + done() From e435b487508c89e404eb8b41fd6b07bb3f7f3888 Mon Sep 17 00:00:00 2001 From: probablycorey Date: Thu, 9 Jan 2014 13:58:24 -0800 Subject: [PATCH 26/32] Display warning if disk space is kind of full --- build/tasks/output-disk-space.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/tasks/output-disk-space.coffee b/build/tasks/output-disk-space.coffee index 9767c7b8d..372ead672 100644 --- a/build/tasks/output-disk-space.coffee +++ b/build/tasks/output-disk-space.coffee @@ -20,6 +20,6 @@ module.exports = (grunt) -> if capacity > 90 grunt.log.error("#{filesystem} is at #{capacity}% capacity!") else if capacity > 80 - grunt.log.error("#{filesystem} is at #{capacity}% capacity.") + grunt.log.ok("#{filesystem} is at #{capacity}% capacity.") done() From d96b63d791c28f315b70340fdbb022966cbfe0b7 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 9 Jan 2014 14:13:46 -0800 Subject: [PATCH 27/32] Move enable/disable to parent Package class This was previously unimplemented in TextMatePackage causing exceptions when trying to enable/disable a package of that type. --- src/atom-package.coffee | 6 ------ src/package.coffee | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/atom-package.coffee b/src/atom-package.coffee index aa62359e9..6546945bb 100644 --- a/src/atom-package.coffee +++ b/src/atom-package.coffee @@ -52,12 +52,6 @@ class AtomPackage extends Package console.warn "Failed to load package named '#{@name}'", e.stack ? e this - enable: -> - atom.config.removeAtKeyPath('core.disabledPackages', @metadata.name) - - disable: -> - atom.config.pushAtKeyPath('core.disabledPackages', @metadata.name) - reset: -> @stylesheets = [] @keymaps = [] diff --git a/src/package.coffee b/src/package.coffee index 4d8112466..f7dac9ffe 100644 --- a/src/package.coffee +++ b/src/package.coffee @@ -47,6 +47,12 @@ class Package isActive: -> atom.packages.isPackageActive(@name) + enable: -> + atom.config.removeAtKeyPath('core.disabledPackages', @metadata.name) + + disable: -> + atom.config.pushAtKeyPath('core.disabledPackages', @metadata.name) + isTheme: -> !!@metadata?.theme From 20ee7b432c85d3c5be69c78ef2e6f25746658f0d Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 9 Jan 2014 15:07:01 -0800 Subject: [PATCH 28/32] Wrap item in array since it is a trigger call --- src/pane-container.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pane-container.coffee b/src/pane-container.coffee index 4ecda8359..7f9bd44f7 100644 --- a/src/pane-container.coffee +++ b/src/pane-container.coffee @@ -66,7 +66,7 @@ class PaneContainer extends View panes[nextIndex].makeActive() itemDestroyed: (item) -> - @trigger 'item-destroyed', item + @trigger 'item-destroyed', [item] getRoot: -> @children().first().view() From a0346e95cf796486d450839613ea782690211f17 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 9 Jan 2014 15:37:08 -0800 Subject: [PATCH 29/32] Upgrade to markdow-preview@0.23.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8c33aa824..ffa887605 100644 --- a/package.json +++ b/package.json @@ -82,7 +82,7 @@ "grammar-selector": "0.16.0", "image-view": "0.14.0", "keybinding-resolver": "0.8.0", - "markdown-preview": "0.22.0", + "markdown-preview": "0.23.0", "metrics": "0.20.0", "package-generator": "0.23.0", "release-notes": "0.15.0", From fbcfad28c32d32a73b12ce46431f04c0b41f6b6a Mon Sep 17 00:00:00 2001 From: Ben Ogle Date: Thu, 9 Jan 2014 17:00:34 -0800 Subject: [PATCH 30/32] Reject is broken. Ugh. Just resolve it --- src/project.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/project.coffee b/src/project.coffee index 7a32a933e..333f5c7bc 100644 --- a/src/project.coffee +++ b/src/project.coffee @@ -300,7 +300,7 @@ class Project extends Model promise = deferred.promise promise.cancel = -> task.terminate() - deferred.reject('cancelled') + deferred.resolve('cancelled') promise # Public: Performs a replace across all the specified files in the project. From d33a962848517643bcd35d6e4d9fbb7b62afc2f2 Mon Sep 17 00:00:00 2001 From: Ben Ogle Date: Thu, 9 Jan 2014 17:12:33 -0800 Subject: [PATCH 31/32] Upgrade to find-and-replace@0.70.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ffa887605..aa7369c8f 100644 --- a/package.json +++ b/package.json @@ -73,7 +73,7 @@ "editor-stats": "0.12.0", "exception-reporting": "0.10.0", "feedback": "0.22.0", - "find-and-replace": "0.69.0", + "find-and-replace": "0.70.0", "fuzzy-finder": "0.30.0", "gists": "0.13.0", "git-diff": "0.21.0", From 6eacfa7077ec0b19b1b446cbd9fbb57dc6c62040 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Thu, 9 Jan 2014 19:04:52 -0700 Subject: [PATCH 32/32] Call Range::toString, not ::inspect in DisplayBufferMarker::inspect --- src/display-buffer-marker.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/display-buffer-marker.coffee b/src/display-buffer-marker.coffee index 1bbd6633e..8c08b3c9e 100644 --- a/src/display-buffer-marker.coffee +++ b/src/display-buffer-marker.coffee @@ -168,7 +168,7 @@ class DisplayBufferMarker # Returns a {String} representation of the marker inspect: -> - "DisplayBufferMarker(id: #{@id}, bufferRange: #{@getBufferRange().inspect()})" + "DisplayBufferMarker(id: #{@id}, bufferRange: #{@getBufferRange()})" ### Internal ###