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 /src/nvim/eval.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 'src/nvim/eval.lua')
| -rw-r--r-- | src/nvim/eval.lua | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua index 8619f54935..aba1f9aa9a 100644 --- a/src/nvim/eval.lua +++ b/src/nvim/eval.lua @@ -9655,17 +9655,25 @@ M.funcs = { signature = 'searchpos({pattern} [, {flags} [, {stopline} [, {timeout} [, {skip}]]]])', }, serverlist = { + args = { 0, 1 }, desc = [=[ 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() < ]=], name = 'serverlist', - params = {}, + params = { { 'opts', 'table' } }, returns = 'string[]', - signature = 'serverlist()', + signature = 'serverlist([{opts}])', }, serverstart = { args = { 0, 1 }, |