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.

This commit is contained in:
Adam Sanderson 2010-12-11 13:37:59 -08:00
parent cca2e7d46a
commit b00d4f2a70
1 changed files with 5 additions and 1 deletions

View File

@ -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