From de234dc875f1e59dae9ea6ce3413fbe96cfb5550 Mon Sep 17 00:00:00 2001 From: aycabta Date: Thu, 24 Jun 2021 18:04:02 +0900 Subject: [PATCH] Define StringWithTiparm instead of singular method --- lib/reline/terminfo.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/reline/terminfo.rb b/lib/reline/terminfo.rb index 01e8df410f..00d2549d92 100644 --- a/lib/reline/terminfo.rb +++ b/lib/reline/terminfo.rb @@ -65,12 +65,14 @@ def self.setupterm(term, fildes) end end - def self.tigetstr(capname) - result = @tigetstr.(capname).to_s - def result.tiparm(*args) # for method chain + class StringWithTiparm < String + def tiparm(*args) # for method chain Reline::Terminfo.tiparm(self, *args) end - result + end + + def self.tigetstr(capname) + StringWithTiparm.new(@tigetstr.(capname).to_s) end def self.tiparm(str, *args)