diff options
| author | Siddhant Agarwal <68201519+siddhantdev@users.noreply.github.com> | 2025-07-28 10:10:04 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-27 21:40:04 -0700 |
| commit | 5151f635ca299dcb7aeb7e34d7c01fba07108b88 (patch) | |
| tree | 231664f3793b6c3cdc46948778736eb2fb8fd371 /runtime/lua/vim/_meta/vimfn.lua | |
| parent | d08b265111548a40924acdbc2dcb2e4cbd901188 (diff) | |
| download | rneovim-5151f635ca299dcb7aeb7e34d7c01fba07108b88.tar.gz rneovim-5151f635ca299dcb7aeb7e34d7c01fba07108b88.tar.bz2 rneovim-5151f635ca299dcb7aeb7e34d7c01fba07108b88.zip | |
feat: serverlist({peer=true}) returns peer addresses #34806
Problem:
serverlist() only lists servers that were started by the current Nvim.
Solution:
Look for other Nvim servers in stdpath("run").
Diffstat (limited to 'runtime/lua/vim/_meta/vimfn.lua')
| -rw-r--r-- | runtime/lua/vim/_meta/vimfn.lua | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/runtime/lua/vim/_meta/vimfn.lua b/runtime/lua/vim/_meta/vimfn.lua index 76bc5e8410..ff800d7d87 100644 --- a/runtime/lua/vim/_meta/vimfn.lua +++ b/runtime/lua/vim/_meta/vimfn.lua @@ -7964,12 +7964,20 @@ function vim.fn.searchpos(pattern, flags, stopline, timeout, skip) end --- Returns a list of server addresses, or empty if all servers --- were stopped. |serverstart()| |serverstop()| +--- +--- The optional argument {opts} is a Dict and supports the following items: +--- +--- peer : If |TRUE|, servers not started by |serverstart()| +--- will also be returned. (default: |FALSE|) +--- Not supported on Windows yet. +--- --- Example: >vim --- echo serverlist() --- < --- +--- @param opts? table --- @return string[] -function vim.fn.serverlist() end +function vim.fn.serverlist(opts) end --- Opens a socket or named pipe at {address} and listens for --- |RPC| messages. Clients can send |API| commands to the |