comparison src/libvterm/find-wide-chars.pl @ 20443:e02d45e302a2 v8.2.0776

patch 8.2.0776: libvterm code lags behind the upstream version Commit: https://github.com/vim/vim/commit/e178ba36546ec7805020280910306331f1ef4ed0 Author: Bram Moolenaar <Bram@vim.org> Date: Sun May 17 14:59:47 2020 +0200 patch 8.2.0776: libvterm code lags behind the upstream version Problem: Libvterm code lags behind the upstream version. Solution: Include revision 719.
author Bram Moolenaar <Bram@vim.org>
date Sun, 17 May 2020 15:00:04 +0200
parents
children 55a373a243c0
comparison
equal deleted inserted replaced
20442:18447aca68fc 20443:e02d45e302a2
1 #!/usr/bin/perl
2
3 use strict;
4 use warnings;
5
6 use Unicode::UCD qw( charprop );
7
8 STDOUT->autoflush(1);
9
10 sub iswide
11 {
12 my ( $cp ) = @_;
13
14 my $width = charprop( $cp, "East_Asian_Width" ) or return;
15 return $width eq "Wide" || $width eq "Fullwidth";
16 }
17
18 my ( $start, $end );
19 foreach my $cp ( 0 .. 0x1FFFF ) {
20 iswide($cp) or next;
21
22 if( defined $end and $end == $cp-1 ) {
23 # extend the range
24 $end = $cp;
25 next;
26 }
27
28 # start a new range
29 printf " { %#04x, %#04x },\n", $start, $end if defined $start;
30
31 $start = $end = $cp;
32 }
33
34 printf " { %#04x, %#04x },\n", $start, $end if defined $start;