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

ruby-changes:58870

From: aycabta <ko1@a...>
Date: Thu, 21 Nov 2019 07:03:00 +0900 (JST)
Subject: [ruby-changes:58870] 95f20f463a (master): Consider escape sequence to calculate prompt width

https://git.ruby-lang.org/ruby.git/commit/?id=95f20f463a

From 95f20f463aa07fbb2e5efbdb89a93d94861cdc49 Mon Sep 17 00:00:00 2001
From: aycabta <aycabta@g...>
Date: Thu, 21 Nov 2019 07:00:01 +0900
Subject: Consider escape sequence to calculate prompt width


diff --git a/lib/reline/line_editor.rb b/lib/reline/line_editor.rb
index aab20b8..ed1e730 100644
--- a/lib/reline/line_editor.rb
+++ b/lib/reline/line_editor.rb
@@ -192,7 +192,7 @@ class Reline::LineEditor https://github.com/ruby/ruby/blob/trunk/lib/reline/line_editor.rb#L192
     lines.each_with_index { |line, i|
       prompt = ''
       prompt = prompt_list[i] if prompt_list and prompt_list[i]
-      result += calculate_height_by_width(calculate_width(prompt + line))
+      result += calculate_height_by_width(calculate_width(prompt, true) + calculate_width(line))
     }
     result
   end
-- 
cgit v0.10.2


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

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