Skip to content

Commit f2fbd0f

Browse files
Fix the complete method for Ruby 2.x
Without this fix, the following error occurs: ``` `reopen': <STDOUT> can't change access mode from "w" to "r" (ArgumentError) ```
1 parent 90d74c8 commit f2fbd0f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Support/shared/lib/ui.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ def tool_tip(content, options={}) # Possible options = {:format => :html|:text,
121121
# and the result of the block inserted as a snippet
122122
def complete(choices, options = {}, &block) # :yields: choice
123123
fork do
124-
STDOUT.reopen(open('/dev/null'))
125-
STDERR.reopen(open('/dev/null'))
124+
STDOUT.reopen(open('/dev/null', 'w'))
125+
STDERR.reopen(open('/dev/null', 'w'))
126126

127127
unless options.has_key? :initial_filter
128128
require "#{ENV['TM_SUPPORT_PATH']}/lib/current_word.rb"

0 commit comments

Comments
 (0)