Sha256: 191b5f3a5058b7d760a06eb62df5d42eb0fec0a3a5cdbff24a11ea084014757c
Contents?: true
Size: 277 Bytes
Versions: 8
Compression:
Stored size: 277 Bytes
Contents
#! /usr/bin/env ruby # coding: utf-8 class String # Return character width in rxvt-unicode. def width chars = ' -~' + '’”' # width of one alphabetic char. num_ascii = count(chars) num_wide = size - num_ascii return 2 * num_wide + num_ascii end end
Version data entries
8 entries across 8 versions & 1 rubygems