docs: function width (val) {
    var cr = val.indexOf(EOL);
    if (cr !== -1) {
      val = val.substring(0, cr);
    }
    if (typeof val !== 'string') {
      val = val + '';
    }
    var h = val.match(/[ -~]/g);
    return val.length * 2 - (h ? h.length : 0);
  }