1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[ruby/reline] Add that Reline::Unicode.take_range is cutting based on width

18405d9594
This commit is contained in:
aycabta 2021-09-06 05:22:28 +09:00 committed by git
parent 1fe604a675
commit e68a586263

View file

@ -185,7 +185,7 @@ class Reline::Unicode
[lines, height]
end
# Take a chunk of a String with escape sequences.
# Take a chunk of a String cut by width with escape sequences.
def self.take_range(str, start_col, max_width, encoding = str.encoding)
chunk = String.new(encoding: encoding)
total_width = 0