Mercurial > vim
comparison src/testdir/emoji_list.vim @ 21973:85add08e6a2d v8.2.1536
patch 8.2.1536: cannot get the class of a character; emoji widths are wrong
Commit: https://github.com/vim/vim/commit/4e4473c927167fd24e5c8df90e0e8035080cf2da
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Aug 28 22:24:57 2020 +0200
patch 8.2.1536: cannot get the class of a character; emoji widths are wrong
Problem: Cannot get the class of a character; emoji widths are wrong in
some environments.
Solution: Add charclass(). Update some emoji widths. Add script to check
emoji widths.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 28 Aug 2020 22:30:04 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
21972:10438c4900d1 | 21973:85add08e6a2d |
---|---|
1 " Script to fill the window with emoji characters, one per line. | |
2 | |
3 if &modified | |
4 new | |
5 else | |
6 enew | |
7 endif | |
8 | |
9 " Use a compiled Vim9 function for speed | |
10 def DoIt() | |
11 let lnum = 1 | |
12 for c in range(0x100, 0x1ffff) | |
13 let cs = nr2char(c) | |
14 if charclass(cs) == 3 | |
15 setline(lnum, '|' .. cs .. '| ' .. strwidth(cs)) | |
16 lnum += 1 | |
17 endif | |
18 endfor | |
19 enddef | |
20 | |
21 call DoIt() | |
22 set nomodified |