diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2020-09-09 20:52:48 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2020-09-09 21:10:48 +0900 |
commit | b194973dcd5eda6c9e256029ea39dc532ae18962 (patch) | |
tree | 30ebee5b13e2c3511ab3a41fc6219a779d89ad8f /lib/reline | |
parent | 6997109fcaef0567f176e53dfc092aecc49f9ece (diff) |
Revert the related commits about `Tempfile.open` change.
Start with https://github.com/ruby/ruby/commit/fa21985a7a2f8f52a8bd82bd12a724e9dca74934
to https://github.com/ruby/ruby/commit/d7492a0be885ea9f2b9f71e3e95582f9a859c439
Diffstat (limited to 'lib/reline')
-rw-r--r-- | lib/reline/line_editor.rb | 10 |
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 |