Mercurial > vim
annotate runtime/tools/emoji_list.vim @ 22545:47596deedfb5 v8.2.1821
patch 8.2.1821: Vim9: concatenating to a NULL list doesn't work
Commit: https://github.com/vim/vim/commit/1a73923705744ab8297dd856d194e20297563456
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Oct 10 15:37:58 2020 +0200
patch 8.2.1821: Vim9: concatenating to a NULL list doesn't work
Problem: Vim9: concatenating to a NULL list doesn't work.
Solution: Handle a NULL list like an empty list. (closes https://github.com/vim/vim/issues/7064)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 10 Oct 2020 15:45:03 +0200 |
parents | 48e914e637c5 |
children | 99ef85ff1af4 |
rev | line source |
---|---|
21973
85add08e6a2d
patch 8.2.1536: cannot get the class of a character; emoji widths are wrong
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1 " Script to fill the window with emoji characters, one per line. |
21981
48e914e637c5
patch 8.2.1540: the user cannot try out emoji character widths
Bram Moolenaar <Bram@vim.org>
parents:
21973
diff
changeset
|
2 " Source this script: :source % |
21973
85add08e6a2d
patch 8.2.1536: cannot get the class of a character; emoji widths are wrong
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3 |
85add08e6a2d
patch 8.2.1536: cannot get the class of a character; emoji widths are wrong
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4 if &modified |
85add08e6a2d
patch 8.2.1536: cannot get the class of a character; emoji widths are wrong
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
5 new |
85add08e6a2d
patch 8.2.1536: cannot get the class of a character; emoji widths are wrong
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
6 else |
85add08e6a2d
patch 8.2.1536: cannot get the class of a character; emoji widths are wrong
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
7 enew |
85add08e6a2d
patch 8.2.1536: cannot get the class of a character; emoji widths are wrong
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
8 endif |
85add08e6a2d
patch 8.2.1536: cannot get the class of a character; emoji widths are wrong
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
9 |
85add08e6a2d
patch 8.2.1536: cannot get the class of a character; emoji widths are wrong
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
10 " Use a compiled Vim9 function for speed |
85add08e6a2d
patch 8.2.1536: cannot get the class of a character; emoji widths are wrong
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
11 def DoIt() |
85add08e6a2d
patch 8.2.1536: cannot get the class of a character; emoji widths are wrong
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
12 let lnum = 1 |
85add08e6a2d
patch 8.2.1536: cannot get the class of a character; emoji widths are wrong
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
13 for c in range(0x100, 0x1ffff) |
85add08e6a2d
patch 8.2.1536: cannot get the class of a character; emoji widths are wrong
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
14 let cs = nr2char(c) |
85add08e6a2d
patch 8.2.1536: cannot get the class of a character; emoji widths are wrong
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
15 if charclass(cs) == 3 |
85add08e6a2d
patch 8.2.1536: cannot get the class of a character; emoji widths are wrong
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
16 setline(lnum, '|' .. cs .. '| ' .. strwidth(cs)) |
85add08e6a2d
patch 8.2.1536: cannot get the class of a character; emoji widths are wrong
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
17 lnum += 1 |
85add08e6a2d
patch 8.2.1536: cannot get the class of a character; emoji widths are wrong
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
18 endif |
85add08e6a2d
patch 8.2.1536: cannot get the class of a character; emoji widths are wrong
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
19 endfor |
85add08e6a2d
patch 8.2.1536: cannot get the class of a character; emoji widths are wrong
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
20 enddef |
85add08e6a2d
patch 8.2.1536: cannot get the class of a character; emoji widths are wrong
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
21 |
85add08e6a2d
patch 8.2.1536: cannot get the class of a character; emoji widths are wrong
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
22 call DoIt() |
85add08e6a2d
patch 8.2.1536: cannot get the class of a character; emoji widths are wrong
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
23 set nomodified |