Skip to content

Commit 2d32604

Browse files
committed
Use str.encoding by default for split_by_width
1 parent 4fd5578 commit 2d32604

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/reline/unicode.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def self.calculate_width(str, allow_escape_code = false)
117117
end
118118
end
119119

120-
def self.split_by_width(str, max_width, encoding)
120+
def self.split_by_width(str, max_width, encoding = str.encoding)
121121
lines = [String.new(encoding: encoding)]
122122
height = 1
123123
width = 0

0 commit comments

Comments
 (0)