Skip to content

Commit 008e88b

Browse files
committed
Parse stacktraces from all selections.
1 parent 6f9ace1 commit 008e88b

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

lib/main.coffee

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ module.exports =
88
atom.workspaceView.command 'stacktrace:paste', ->
99
atom.workspaceView.appendToTop new EnterDialog()
1010

11+
atom.workspaceView.command 'stacktrace:from-selection', ->
12+
selections = atom.workspace.getActiveEditor()?.getSelections()
13+
text = (s.getText() for s in (selections or [])).join ''
14+
atom.emit 'stacktrace:accept-trace', trace: text
15+
1116
StacktraceView.registerIn(atom.workspace)
1217

1318
atom.on 'stacktrace:accept-trace', ({trace}) =>

spec/main-spec.coffee

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ describe "Main", ->
2525
describe 'when the stacktrace:from-selection event is triggered', ->
2626

2727
beforeEach ->
28-
path = path.join __dirname, 'fixtures', 'withtrace.txt'
29-
editorPromise = atom.workspace.open(path)
28+
p = path.join __dirname, 'fixtures', 'withtrace.txt'
29+
editorPromise = atom.workspace.open(p)
3030

3131
waitsForPromise -> editorPromise
3232

3333
runs ->
3434
editorPromise.then (editor) ->
3535
editor.setSelectedBufferRange [[1, 0], [7, 0]]
36-
atom.workspaceView.trigger 'stacktrace:from-selection'
36+
atom.workspaceView.trigger 'stacktrace:from-selection'
3737

3838
waitsForPromise -> activationPromise
3939

0 commit comments

Comments
 (0)