mirror of
https://github.com/neovim/neovim.git
synced 2025-10-26 12:27:24 +00:00
eval: Move VimL functions list to a lua file
Removes all kinds of problems with sorting, provides a ready-to-use function list representation for genvimvim.lua, does not require specifying function name twice (VimL function name (string) + f_ function name).
This commit is contained in:
@@ -23,6 +23,7 @@ end
|
||||
local options = require('options')
|
||||
local auevents = require('auevents')
|
||||
local ex_cmds = require('ex_cmds')
|
||||
local eval = require('eval')
|
||||
|
||||
local cmd_kw = function(prev_cmd, cmd)
|
||||
if not prev_cmd then
|
||||
@@ -113,23 +114,12 @@ local vimfun_start = 'syn keyword vimFuncName contained '
|
||||
w('\n\n' .. vimfun_start)
|
||||
eval_fd = io.open(nvimsrcdir .. '/eval.c', 'r')
|
||||
local started = 0
|
||||
for line in eval_fd:lines() do
|
||||
if line == '} functions[] =' then
|
||||
started = 1
|
||||
elseif started == 1 then
|
||||
assert (line == '{')
|
||||
started = 2
|
||||
elseif started == 2 then
|
||||
if line == '};' then
|
||||
break
|
||||
end
|
||||
local func_name = line:match('^ { "([%w_]+)",')
|
||||
if func_name then
|
||||
if lld.line_length > 850 then
|
||||
w('\n' .. vimfun_start)
|
||||
end
|
||||
w(' ' .. func_name)
|
||||
for name, def in pairs(eval.funcs) do
|
||||
if name then
|
||||
if lld.line_length > 850 then
|
||||
w('\n' .. vimfun_start)
|
||||
end
|
||||
w(' ' .. name)
|
||||
end
|
||||
end
|
||||
eval_fd:close()
|
||||
|
||||
Reference in New Issue
Block a user