Skip to content

Commit

Permalink
GeneralIO.reset should reset class variable existence
Browse files Browse the repository at this point in the history
  • Loading branch information
tompng committed Sep 27, 2023
1 parent 307c551 commit 89bc139
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/reline/general_io.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
class Reline::GeneralIO
def self.reset(encoding: nil)
@@pasting = false
@@encoding = encoding
if encoding
@@encoding = encoding
elsif defined?(@@encoding)
remove_class_variable(:@@encoding)
end
end

def self.encoding
Expand Down

0 comments on commit 89bc139

Please sign in to comment.