about summary refs log tree commit diff stats
path: root/src/utils/widthconv.nim
Commit message (Collapse)AuthorAgeFilesLines
* utils, types: merge some modulesbptato2024-11-031-1/+1
| | | | | * line, vector, matrix -> path * twtuni, charcategory -> twtstr
* utils: add twtunibptato2024-09-081-52/+50
| | | | | | | | | | | | | | | | | | | std/unicode has the following issues: * Rune is an int32, which implies overflow checking. Also, it is distinct, so you have to convert it manually to do arithmetic. * QJS libunicode and Chagashi work with uint32, interfacing with these required pointless type conversions. * fastRuneAt is a template, meaning it's pasted into every call site. Also, it decodes to UCS-4, so it generates two branches that aren't even used. Overall this lead to quite some code bloat. * fastRuneAt and lastRune have frustratingly different interfaces. Writing code to handle both cases is error prone. * On older Nim versions which we still support, std/unicode takes strings, not openArray[char]'s. Replace it with "twtuni", which includes some improved versions of the few procedures from std/unicode that we actually use.
* widthconv: bugfixesbptato2024-02-111-25/+11
| | | | | | | * fix failed assertion on non-ha-column half-width chars followed by handakuten with text-transform: full-width * fix dquot full-width conversion * fix lone half-width han/dakuten conversion
* twtstr: misc refactoringsbptato2024-02-091-0/+126
* move out half width <-> full width converters * snake_case -> camelCase * improve toScreamingSnakeCase slicing