refactor(excmd): pass fargs to Lua for builtin cmds #39528

Problem:
The fallback that tokenizes `eap->arg` by unescaped whitespace (when the
parser doesn't pre-split via `EX_EXPAND` etc.) lives in `nlua_do_ucmd`,
so only user-command callbacks got `eap.fargs`. Builtin commands routed
through `nlua_call_excmd` have to re-parse the args themselves
(e.g. `M.ex_lsp`).

Solution:
- Move the tokenization into `nlua_push_eap` so every Lua handler sees
  `eap.fargs`. Keep only the `EX_NOSPC` override in `nlua_do_ucmd` (the
  `nargs=1`/`?` case which is genuinely user-command-specific).
- Drop the re-parse in `M.ex_lsp`.
This commit is contained in:
Justin M. Keyes
2026-05-02 10:46:23 -04:00
committed by GitHub
parent 22f3b28367
commit d788dd2811
8 changed files with 33 additions and 39 deletions

View File

@@ -4,7 +4,6 @@ local t_lsp = require('test.functional.plugin.lsp.testutil')
local clear = n.clear
local eq = t.eq
local pcall_err = t.pcall_err
local exec_lua = n.exec_lua
local create_server_definition = t_lsp.create_server_definition