view src/libvterm/find-wide-chars.pl @ 30699:f60315945f4a v9.0.0684

patch 9.0.0684: skipped :exe command fails compilation on MS-Windows Commit: https://github.com/vim/vim/commit/2eae3d24d7fe8beed64652bc5c1cbddd09dafc9a Author: Bram Moolenaar <Bram@vim.org> Date: Fri Oct 7 15:09:27 2022 +0100 patch 9.0.0684: skipped :exe command fails compilation on MS-Windows Problem: Skipped :exe command fails compilation on MS-Windows. Solution: Adjust return value when skipping.
author Bram Moolenaar <Bram@vim.org>
date Fri, 07 Oct 2022 16:15:03 +0200
parents 55a373a243c0
children
line wrap: on
line source

#!/usr/bin/perl

use strict;
use warnings;

STDOUT->autoflush(1);

sub iswide
{
   my ( $cp ) = @_;
   return chr($cp) =~ m/\p{East_Asian_Width=Wide}|\p{East_Asian_Width=Fullwidth}/;
}

my ( $start, $end );
foreach my $cp ( 0 .. 0x1FFFF ) {
   iswide($cp) or next;

   if( defined $end and $end == $cp-1 ) {
      # extend the range
      $end = $cp;
      next;
   }

   # start a new range
   printf "  { %#04x, %#04x },\n", $start, $end if defined $start;

   $start = $end = $cp;
}

printf "  { %#04x, %#04x },\n", $start, $end if defined $start;