[前][次][番号順一覧][スレッド一覧]

ruby-changes:67384

From: aycabta <ko1@a...>
Date: Tue, 31 Aug 2021 15:19:56 +0900 (JST)
Subject: [ruby-changes:67384] 7afb5b8b95 (master): [ruby/reline] Use Reline::Unicode.take_range to devide exactly by width

https://git.ruby-lang.org/ruby.git/commit/?id=7afb5b8b95

From 7afb5b8b95c7eadb5e776590566d0430d62e62f9 Mon Sep 17 00:00:00 2001
From: aycabta <aycabta@g...>
Date: Tue, 31 Aug 2021 15:11:30 +0900
Subject: [ruby/reline] Use Reline::Unicode.take_range to devide exactly by
 width

https://github.com/ruby/reline/commit/de1ad93f44
---
 lib/reline/line_editor.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/reline/line_editor.rb b/lib/reline/line_editor.rb
index b42b382..382f638 100644
--- a/lib/reline/line_editor.rb
+++ b/lib/reline/line_editor.rb
@@ -652,7 +652,7 @@ class Reline::LineEditor https://github.com/ruby/ruby/blob/trunk/lib/reline/line_editor.rb#L652
           bg_color = '46'
         end
       end
-      @output.write "\e[#{bg_color}m%-#{dialog.width}s\e[49m" % item.slice(0, dialog.width)
+      @output.write "\e[#{bg_color}m%-#{dialog.width}s\e[49m" % Reline::Unicode.take_range(item, 0, dialog.width)
       Reline::IOGate.move_cursor_column(dialog.column)
       move_cursor_down(1) if i < (dialog.contents.size - 1)
     end
-- 
cgit v1.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]