From 8199dd058166ebe2bdcb6d7509d484917a83185e Mon Sep 17 00:00:00 2001 From: Romain Bignon Date: Sun, 17 Oct 2010 15:10:21 +0200 Subject: [PATCH] add -p only if $EDITOR is vim --- weboob/applications/webcontentedit/webcontentedit.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/weboob/applications/webcontentedit/webcontentedit.py b/weboob/applications/webcontentedit/webcontentedit.py index f5839fba..083f5f5d 100644 --- a/weboob/applications/webcontentedit/webcontentedit.py +++ b/weboob/applications/webcontentedit/webcontentedit.py @@ -62,7 +62,11 @@ class WebContentEdit(ReplApplication): data = data.encode('utf-8') f.write(data) paths[path] = content - os.system("$EDITOR -p %s" % ' '.join(paths.iterkeys())) + + params = '' + if os.environ['EDITOR'] == 'vim': + params = '-p' + os.system("$EDITOR %s %s" % (params, ' '.join(paths.iterkeys()))) for path, content in paths.iteritems(): with open(path, 'r') as f: