From 9788b81d7e53e7ad1ca9db249d86e43426ce56c2 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sat, 5 Oct 2024 13:11:16 +0200 Subject: fix(runtime): fully port emoji_list to Lua Problem: `runtime/tools/emoji_list.vim` is a Lua script masquerading as Vimscript, which is unnecessary now that `:source` works for Lua files. Solution: Remove Vimscript wrapper. --- runtime/tools/emoji_list.lua | 19 +++++++++++++++++++ runtime/tools/emoji_list.vim | 21 --------------------- 2 files changed, 19 insertions(+), 21 deletions(-) create mode 100644 runtime/tools/emoji_list.lua delete mode 100644 runtime/tools/emoji_list.vim (limited to 'runtime/tools') diff --git a/runtime/tools/emoji_list.lua b/runtime/tools/emoji_list.lua new file mode 100644 index 0000000000..63bbbe4371 --- /dev/null +++ b/runtime/tools/emoji_list.lua @@ -0,0 +1,19 @@ +-- Script to fill the window with emoji characters, one per line. +-- Source this script: :source % + +if vim.bo.modified then + vim.cmd.new() +else + vim.cmd.enew() +end + +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, string.format('|%s| %d', cs, vim.fn.strwidth(cs))) + lnum = lnum + 1 + end +end + +vim.bo.modified = false diff --git a/runtime/tools/emoji_list.vim b/runtime/tools/emoji_list.vim deleted file mode 100644 index c335b8c88f..0000000000 --- a/runtime/tools/emoji_list.vim +++ /dev/null @@ -1,21 +0,0 @@ -" 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 -- cgit