view src/libvterm/find-wide-chars.pl @ 34051:f96f16107d61

runtime(sh): Update sh syntax and add local keyword for bash (#13806) Commit: https://github.com/vim/vim/commit/b16fc9805535dc6eb084142da0c87210fc102494 Author: Lucien Grondin <grondilu@yahoo.fr> Date: Mon Jan 1 19:00:41 2024 +0100 runtime(sh): Update sh syntax and add local keyword for bash (https://github.com/vim/vim/issues/13806) add `local` in shStatement Signed-off-by: Lucien Grondin <grondilu@yahoo.fr> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Mon, 01 Jan 2024 19:15:03 +0100
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;