From b00d4f2a70f2f67c35b024a88c9a703c54cdd7b7 Mon Sep 17 00:00:00 2001 From: Adam Sanderson Date: Sat, 11 Dec 2010 13:37:59 -0800 Subject: [PATCH] Fix for issues gh:6 and gh:7. Split up any parameters the EDITOR has and merge those with the paths. Now EDITOR can be mate -w if you want. --- lib/qwandry/launcher.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/qwandry/launcher.rb b/lib/qwandry/launcher.rb index 8c8f818..e2f36e5 100644 --- a/lib/qwandry/launcher.rb +++ b/lib/qwandry/launcher.rb @@ -70,7 +70,11 @@ module Qwandry end paths = package.is_a?(String) ? [package] : package.paths - system editor, *paths + # Editors may have options, 'mate -w' for instance + editor_and_options = editor.strip.split(/\s+/) + + # Launch the editor with its options and any paths that we have been passed + system(*(editor_and_options + paths)) end private