File: reline_ext.rb

package info (click to toggle)
ruby-unicode-display-width 3.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 148 kB
  • sloc: ruby: 278; makefile: 3
file content (14 lines) | stat: -rw-r--r-- 291 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# Experimental
# Patches Reline's get_mbchar_width to use Unicode::DisplayWidth

require "reline"
require "reline/unicode"

require_relative "../display_width"

class Reline::Unicode
  def self.get_mbchar_width(mbchar)
    Unicode::DisplayWidth.of(mbchar, Reline.ambiguous_width)
  end
end