Skip to content

Commit

Permalink
Define StringWithTiparm instead of singular method
Browse files Browse the repository at this point in the history
  • Loading branch information
aycabta committed Jun 24, 2021
1 parent bb6f408 commit de234dc
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/reline/terminfo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit de234dc

Please sign in to comment.