diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2018-09-22 10:20:23 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-22 10:20:23 +0200 |
commit | c236e80cf3dfae6df5c43ecfb19c7629c9884f7b (patch) | |
tree | 426eb0f7525621d9760bb2cbf394d5c42b691775 /runtime | |
parent | 7f990741f7018b5e52833f2da6913b97c6d2d5ee (diff) | |
parent | 4da5cb38d396d76d8072815d150725f7c9a85078 (diff) | |
download | rneovim-c236e80cf3dfae6df5c43ecfb19c7629c9884f7b.tar.gz rneovim-c236e80cf3dfae6df5c43ecfb19c7629c9884f7b.tar.bz2 rneovim-c236e80cf3dfae6df5c43ecfb19c7629c9884f7b.zip |
Merge pull request #9024 from bfredl/embed_ui2
always wait for UI with --embed, unless --headless is supplied
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/starting.txt | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt index 275b08b5dd..dd9f9ad0f3 100644 --- a/runtime/doc/starting.txt +++ b/runtime/doc/starting.txt @@ -348,30 +348,35 @@ argument. *--embed* --embed Use stdin/stdout as a msgpack-RPC channel, so applications can - embed and control Nvim via the |rpc-api|. Implies |--headless|. - - Nvim will wait for a single request before sourcing startup - files and reading buffers. This is mainly so that UIs can call - `nvim_ui_attach` so that the UI can show startup messages - and possible swap file dialog for the first loaded file. In - addition, a `nvim_get_api_info` call before the `nvim_ui_attach` - call is also allowed, so that UI features can be safely - detected by the UI. - - To avoid this behavior, this alterative could be used instead: > + embed and control Nvim via the |rpc-api|. + + By default nvim will wait for the embedding process to call + `nvim_ui_attach` before sourcing startup files and reading + buffers. This is so that UI can show startup messages and + possible swap file dialog for the first loaded file. The + process can do requests before the `nvim_ui_attach`, for + instance a `nvim_get_api_info` call so that UI features can be + safely detected by the UI before attaching. + + To embed nvim without using the UI protocol, `--headless` should + be supplied together with `--embed`. Then initialization is + performed without waiting for an UI. This is also equivalent + to the following alternative: > nvim --headless --cmd "call stdioopen({'rpc': v:true})" < See also |channel-stdio|. *--headless* ---headless Do not start the default UI, so stdio can be used as an - arbitrary communication channel. |channel-stdio| +--headless Start nvim without an UI. The TUI is not used, so stdio + can be used as an arbitrary communication channel. + |channel-stdio| When used together with `--embed`, do not wait + for the embedder to attach an UI. Also useful for scripting (tests) to see messages that would not be printed by |-es|. To detect if a UI is available, check if |nvim_list_uis()| is - empty after |VimEnter|. + empty in or after |VimEnter|. To read stdin as text, "-" must be given explicitly: --headless cannot assume that stdin is just text. > |