Open blueyed opened 6 years ago
I'm not sure why the first case "waits". That seems like an accident, doesn't it?
Agreed. I've thought that it might be intentional, but I also think that it should not wait. The main issue is that the second case even triggers the hit-enter prompt though.
I don't understand why it's a problem for an error message to trigger hit-enter? Isn't that normal?
The trick that deoplete uses is to first use echom
for additional info (traceback), then redraw
and then echom
for the main msg.
This way you have it in :messages
, but are not bothered with the full blob initially.
I've noticed that this does not work as expected when using vim.err_write
.
Try nvim_call_atomic or server-side VimL/Lua ?
@justinmk
Please elaborate.
Do you mean to do this from deoplete's error_tb
(Python)? (https://github.com/Shougo/deoplete.nvim/blob/57d3f0c3cdfcfc1d91901a6d59d08f9008abd166/rplugin/python3/deoplete/util.py#L94-L101)
deoplete uses rpcnotify
to trigger the Python code.
The following will not trigger a hit-enter prompt:
It displays the lines 0-9, then waits for a short time, and displays "last". This is good/useful when wanting to add a traceback/more info for
:messages
, but have the actual error in the end (without a large red blob).But for some reason similar code in deoplete will not (when adding a
redraw
command before the last line) - it displays all of it at once, causing a hit-enter prompt: https://github.com/Shougo/deoplete.nvim/blob/57d3f0c3cdfcfc1d91901a6d59d08f9008abd166/rplugin/python3/deoplete/util.py#L94-L101This might be related to how deoplete integrates with neovim-python-client (https://github.com/Shougo/deoplete.nvim/blob/master/rplugin/python3/deoplete/parent.py#L96-L102).