From 9f598e57656fe072114b9f1e73d3051423e13234 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 8 Apr 2018 13:06:26 +0200 Subject: serverstop(): return FALSE for invalid address --- runtime/doc/eval.txt | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) (limited to 'runtime') diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 767fc133d8..084936e9d2 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1789,8 +1789,10 @@ v:scrollstart String describing the script or function that caused the *v:servername* *servername-variable* *$NVIM_LISTEN_ADDRESS* -v:servername Default Nvim server address. Equivalent to - |$NVIM_LISTEN_ADDRESS| on startup. |serverstop()| +v:servername Primary listen address of the current Nvim instance, the first + item returned by |serverlist()|. Can be set by + |--listen| or |$NVIM_LISTEN_ADDRESS| on startup. + See also |serverstart()| and |serverstop()|. Read-only. @@ -6638,15 +6640,11 @@ server2client({clientid}, {string}) *server2client()* :echo server2client(expand(""), "HELLO") < serverlist() *serverlist()* - Returns a list of available server names in a list. - When there are no servers an empty string is returned. + Returns a list of server addresses, or empty if all servers + were stopped. |serverstart()| |serverstop()| Example: > :echo serverlist() -< {Nvim} *--serverlist* - The Vim command-line option `--serverlist` was removed from - Nvim, but it can be imitated: > - nvim --cmd "echo serverlist()" --cmd "q" -< + serverstart([{address}]) *serverstart()* Opens a socket or named pipe at {address} and listens for |RPC| messages. Clients can send |API| commands to the address @@ -6674,13 +6672,9 @@ serverstart([{address}]) *serverstart()* < |$NVIM_LISTEN_ADDRESS| is set to {address} if not already set. - *--servername* - The Vim command-line option `--servername` can be imitated: > - nvim --cmd "let g:server_addr = serverstart('foo')" -< serverstop({address}) *serverstop()* - Closes the pipe or socket at {address}. Does nothing if - {address} is empty or invalid. + Closes the pipe or socket at {address}. + Returns TRUE if {address} is valid, else FALSE. If |$NVIM_LISTEN_ADDRESS| is stopped it is unset. If |v:servername| is stopped it is set to the next available address returned by |serverlist()|. -- cgit From 507bda1c95cdac2886f64e59aa6bbf85c3fac389 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 8 Apr 2018 17:20:25 +0200 Subject: server: introduce --listen, deprecate $NVIM_LISTEN_ADDRESS --- runtime/doc/deprecated.txt | 4 ++++ runtime/doc/eval.txt | 8 +++----- runtime/doc/msgpack_rpc.txt | 5 ++--- runtime/doc/starting.txt | 4 ++++ 4 files changed, 13 insertions(+), 8 deletions(-) (limited to 'runtime') diff --git a/runtime/doc/deprecated.txt b/runtime/doc/deprecated.txt index ea61e847c7..03699b3dfb 100644 --- a/runtime/doc/deprecated.txt +++ b/runtime/doc/deprecated.txt @@ -22,6 +22,10 @@ Commands ~ *:wv* *:wviminfo* Deprecated alias to |:wshada| command. +Environment Variables ~ +*$NVIM_LISTEN_ADDRESS* Deprecated in favor of |--listen|. If both are given, + $NVIM_LISTEN_ADDRESS is ignored. + Events ~ *EncodingChanged* Never fired; 'encoding' is always "utf-8". *FileEncoding* Never fired; equivalent to |EncodingChanged|. diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 084936e9d2..11c4b62403 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1788,11 +1788,9 @@ v:scrollstart String describing the script or function that caused the hit-enter prompt. *v:servername* *servername-variable* - *$NVIM_LISTEN_ADDRESS* -v:servername Primary listen address of the current Nvim instance, the first - item returned by |serverlist()|. Can be set by - |--listen| or |$NVIM_LISTEN_ADDRESS| on startup. - See also |serverstart()| and |serverstop()|. +v:servername Primary listen-address of the current Nvim instance, the first + item returned by |serverlist()|. Can be set by |--listen| or + |$NVIM_LISTEN_ADDRESS| at startup. |serverstart()| |serverstop()| Read-only. diff --git a/runtime/doc/msgpack_rpc.txt b/runtime/doc/msgpack_rpc.txt index 11fad105b5..01d4e10cea 100644 --- a/runtime/doc/msgpack_rpc.txt +++ b/runtime/doc/msgpack_rpc.txt @@ -70,9 +70,8 @@ An rpc socket is automatically created with each instance. The socket location is stored in |v:servername|. By default this is a named pipe with an automatically generated address. See |XXX|. -To make Nvim listen on a TCP/IP socket instead, set the - |$NVIM_LISTEN_ADDRESS| environment variable before starting Nvim: > - NVIM_LISTEN_ADDRESS=127.0.0.1:6666 nvim +To make Nvim listen on a TCP/IP socket instead, specify |--listen|: > + nvim --listen 127.0.0.1:6666