Mercurial > vim
view src/libvterm/find-wide-chars.pl @ 31233:d80066065462 v9.0.0950
patch 9.0.0950: the pattern "_szs" matches at EOL
Commit: https://github.com/vim/vim/commit/c96311b5be307f5a1d1b20a0ec930d63964e7335
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Nov 25 21:13:47 2022 +0000
patch 9.0.0950: the pattern "\_s\zs" matches at EOL
Problem: The pattern "\_s\zs" matches at EOL.
Solution: Make the pattern "\_s\zs" match at the start of the next line.
(closes #11617)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 25 Nov 2022 22: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;