Get rid of the option to use the system wcwidth

The system wcwidth() is often wrong. Not to mention that if you SSH into
a different machine, then you have a potentially different wcwidth. The
only sane way to deal with this is to use the unicode standard.
This commit is contained in:
Kovid Goyal
2018-02-04 21:02:30 +05:30
parent 452ff02b15
commit fc7ec1d3f7
16 changed files with 48 additions and 82 deletions

11
kitty/wcwidth-std.h generated
View File

@@ -1,4 +1,4 @@
// unicode data, built from the unicode standard on: 2018-01-18
// unicode data, built from the unicode standard on: 2018-02-04
// see gen-wcwidth.py
#pragma once
#include "data-types.h"
@@ -8,8 +8,13 @@ START_ALLOW_CASE_RANGE
static int
wcwidth_std(int32_t code) {
switch(code) {
// Non-printing characters (2264 codepoints) {{{
case 0x0 ... 0x1f:
// Null (1 codepoints) {{{
case 0x0:
return 0;
// }}}
// Non-printing characters (2263 codepoints) {{{
case 0x1 ... 0x1f:
return -1;
case 0x7f ... 0x9f:
return -1;