mirror of
				https://github.com/neovim/neovim.git
				synced 2025-11-03 17:24:29 +00:00 
			
		
		
		
	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.
This commit is contained in:
		
							
								
								
									
										2
									
								
								runtime/doc/builtin.txt
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										2
									
								
								runtime/doc/builtin.txt
									
									
									
										generated
									
									
									
								
							@@ -6627,7 +6627,7 @@ setcellwidths({list})                                          *setcellwidths()*
 | 
			
		||||
		To clear the overrides pass an empty {list}: >vim
 | 
			
		||||
		   call setcellwidths([])
 | 
			
		||||
 | 
			
		||||
<		You can use the script $VIMRUNTIME/tools/emoji_list.vim to see
 | 
			
		||||
<		You can use the script $VIMRUNTIME/tools/emoji_list.lua to see
 | 
			
		||||
		the effect for known emoji characters.  Move the cursor
 | 
			
		||||
		through the text to check if the cell widths of your terminal
 | 
			
		||||
		match with what Vim knows about each emoji.  If it doesn't
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								runtime/lua/vim/_meta/vimfn.lua
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										2
									
								
								runtime/lua/vim/_meta/vimfn.lua
									
									
									
										generated
									
									
									
								
							@@ -7904,7 +7904,7 @@ function vim.fn.setbufvar(buf, varname, val) end
 | 
			
		||||
--- To clear the overrides pass an empty {list}: >vim
 | 
			
		||||
---    call setcellwidths([])
 | 
			
		||||
---
 | 
			
		||||
--- <You can use the script $VIMRUNTIME/tools/emoji_list.vim to see
 | 
			
		||||
--- <You can use the script $VIMRUNTIME/tools/emoji_list.lua to see
 | 
			
		||||
--- the effect for known emoji characters.  Move the cursor
 | 
			
		||||
--- through the text to check if the cell widths of your terminal
 | 
			
		||||
--- match with what Vim knows about each emoji.  If it doesn't
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										19
									
								
								runtime/tools/emoji_list.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								runtime/tools/emoji_list.lua
									
									
									
									
									
										Normal file
									
								
							@@ -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
 | 
			
		||||
@@ -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
 | 
			
		||||
@@ -9464,7 +9464,7 @@ M.funcs = {
 | 
			
		||||
      To clear the overrides pass an empty {list}: >vim
 | 
			
		||||
         call setcellwidths([])
 | 
			
		||||
 | 
			
		||||
      <You can use the script $VIMRUNTIME/tools/emoji_list.vim to see
 | 
			
		||||
      <You can use the script $VIMRUNTIME/tools/emoji_list.lua to see
 | 
			
		||||
      the effect for known emoji characters.  Move the cursor
 | 
			
		||||
      through the text to check if the cell widths of your terminal
 | 
			
		||||
      match with what Vim knows about each emoji.  If it doesn't
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user