diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-08-13 11:29:38 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-13 11:29:38 +0800 |
commit | 754892e59dc3ab65a92d22f315e88b716bc26d1d (patch) | |
tree | 7defed25672c3fa12fac8ad4f1a263efb679d8c5 /runtime/tools | |
parent | 6f14c5d2ddbefea51920762769eec217d19a9ed9 (diff) | |
download | rneovim-754892e59dc3ab65a92d22f315e88b716bc26d1d.tar.gz rneovim-754892e59dc3ab65a92d22f315e88b716bc26d1d.tar.bz2 rneovim-754892e59dc3ab65a92d22f315e88b716bc26d1d.zip |
vim-patch:8.2.{1536,1540}: charclass() (#19748)
vim-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.
https://github.com/vim/vim/commit/4e4473c927167fd24e5c8df90e0e8035080cf2da
Use latest charclass() docs from Vim.
Rewrite DoIt() in emoji_list.vim in Lua.
Omit emoji table updates:
- emoji_width update looks wrong as these added ranges are only double-width when followed by 0xFE0F.
- Other updates are too old.
vim-patch:8.2.1540: the user cannot try out emoji character widths
Problem: The user cannot try out emoji character widths.
Solution: Move the emoji script to the runtime/tools directory.
https://github.com/vim/vim/commit/98945560c1ae6e2ddee820a7de718a36e3f4b6e5
Diffstat (limited to 'runtime/tools')
-rw-r--r-- | runtime/tools/emoji_list.vim | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/runtime/tools/emoji_list.vim b/runtime/tools/emoji_list.vim new file mode 100644 index 0000000000..c335b8c88f --- /dev/null +++ b/runtime/tools/emoji_list.vim @@ -0,0 +1,21 @@ +" Script to fill the window with emoji characters, one per line. +" Source this script: :source % + +if &modified + new +else + enew +endif + +lua << EOF + local lnum = 1 + for c = 0x100, 0x1ffff do + local cs = vim.fn.nr2char(c) + if vim.fn.charclass(cs) == 3 then + vim.fn.setline(lnum, '|' .. cs .. '| ' .. vim.fn.strwidth(cs)) + lnum = lnum + 1 + end + end +EOF + +set nomodified |