X-Git-Url: https://arthur.barton.de/gitweb/?a=blobdiff_plain;f=lib%2Fpipe.coffee;h=8db43da6be01e501a02c1809e6682f3a6f9f3b19;hb=7e645d70db173f5d30991bc2e998bd1eb832fce4;hp=ec25ab594b2d63b307ff4aa46424f9277c7c833d;hpb=d364e3bf38055fc6672bfac8ace5eb3051210ea0;p=atom-ax-pipe.git diff --git a/lib/pipe.coffee b/lib/pipe.coffee index ec25ab5..8db43da 100644 --- a/lib/pipe.coffee +++ b/lib/pipe.coffee @@ -2,6 +2,8 @@ {spawn} = require 'child_process' CommandView = require './command-view' +history = [] + module.exports = activate: -> atom.workspaceView.command 'pipe:run', => @run() @@ -11,11 +13,15 @@ module.exports = view = atom.workspaceView.getActiveView() return if not editor? - new CommandView (commandString) -> + new CommandView history, (commandString) -> if not commandString view.focus() return + history.push commandString + if history.length > 300 + history.shift() + range = editor.getSelectedBufferRange() stdout = '' stderr = ''