From 155051940a5fde6e763f00a9d03d790383b389ce Mon Sep 17 00:00:00 2001 From: HASUMI Hitoshi Date: Sun, 15 Oct 2023 00:35:44 +0900 Subject: [PATCH] ref https://github.com/ruby/reline/pull/552#pullrequestreview-1677282576 --- lib/reline/face.rb | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/reline/face.rb b/lib/reline/face.rb index af98d5fb82..3857f33d64 100644 --- a/lib/reline/face.rb +++ b/lib/reline/face.rb @@ -109,17 +109,16 @@ def rgb_expression?(color) end end - CONFIGS = {} - - private_constant :SGR_PARAMETERS, :Config, :CONFIGS + private_constant :SGR_PARAMETERS, :Config def self.[](name) - CONFIGS[name] + @configs[name] end def self.config(name, override = true, &block) - return if CONFIGS[name] && !override - CONFIGS[name] = Config.new(name, &block) + @configs ||= {} + return if @configs[name] && !override + @configs[name] = Config.new(name, &block) end end