diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2026-08-09 17:33:53 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-08-09 17:33:53 -0400 |
| commit | abc271d8f3db2d6f7c792cdb6868cbb0cc80c3a1 (patch) | |
| tree | 2737e4c648a57c40633fef6b514d292fffb29082 /src/gen/gen_api_dispatch.lua | |
| parent | 04f802a2f6387028e3389334e6e04abc28d92587 (diff) | |
| download | rneovim-abc271d8f3db2d6f7c792cdb6868cbb0cc80c3a1.tar.gz rneovim-abc271d8f3db2d6f7c792cdb6868cbb0cc80c3a1.tar.bz2 rneovim-abc271d8f3db2d6f7c792cdb6868cbb0cc80c3a1.zip | |
fix(logging): vimscript API calls #41253
Problem:
":call nvim_get_mode()" logs a nonsense channel-id:
RPC: ch 9223372036854775808: invoke nvim_get_mode
Solution:
Check `is_internal_call`.
Also, skip this logging for RPC calls, because it's redundant with
`log_request`/`log_notify`.
API: vim -> nvim_get_mode
Diffstat (limited to 'src/gen/gen_api_dispatch.lua')
| -rw-r--r-- | src/gen/gen_api_dispatch.lua | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gen/gen_api_dispatch.lua b/src/gen/gen_api_dispatch.lua index b15afd2b08..6f08665910 100644 --- a/src/gen/gen_api_dispatch.lua +++ b/src/gen/gen_api_dispatch.lua @@ -425,7 +425,11 @@ for i = 1, #functions do ) output:write('\n{') output:write('\n#ifdef NVIM_LOG_DEBUG') - output:write('\n DLOG("RPC: ch %" PRIu64 ": invoke ' .. fn.name .. '", channel_id);') + -- Log only internal calls: an RPC caller is logged by log_request()/log_notify(). + -- An internal call is always Vimscript (api_wrapper()); vim.api binds to nvim_foo() directly. + output:write( + ('\n if (is_internal_call(channel_id)) {\n DLOG("API: vim -> %s");\n }'):format(fn.name) + ) output:write('\n#endif') output:write('\n Object ret = NIL;') -- Declare/initialize variables that will hold converted arguments |