summaryrefslogtreecommitdiff
path: root/lib/reline/line_editor.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/reline/line_editor.rb')
-rw-r--r--lib/reline/line_editor.rb10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/reline/line_editor.rb b/lib/reline/line_editor.rb
index 6826d58d9a..b4d2b457c7 100644
--- a/lib/reline/line_editor.rb
+++ b/lib/reline/line_editor.rb
@@ -2079,14 +2079,12 @@ class Reline::LineEditor
end
private def vi_histedit(key)
- Tempfile.open { |fp|
+ path = Tempfile.open { |fp|
fp.write @line
- path = fp.path
- fp.close
-
- system("#{ENV['EDITOR']} #{path}")
- @line = File.read(path)
+ fp.path
}
+ system("#{ENV['EDITOR']} #{path}")
+ @line = File.read(path)
finish
end