Describe the bug
When coc.nvim tries to output some one-line notification I get only this instead:
Press ENTER or type command to continue 4,11 All
On the other hand, when I do :set cmdheight=2
, notification is shown correctly:
[tsserver 6133] [I] 'addressForm' is declared but its value is never ...
4,11 All
Full notice is:
[tsserver 6133] [I] 'addressForm' is declared but its value is never read.
4,11 All
Expected behavior
I expect for "Press ENTER or type command to continue" to not be shown for such small notifications, or at least to be like this instead:
[tsserver 6133] [I] 'addressForm' is declared but its value is never ...
Press ENTER or type command to continue 4,11 All
…or maybe replace all bottom line where4,11 All
part is with the notice itself in case of :set cmdheight=1
.
Environment (please complete the following information):
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
Assuming the issue is in Vim and not in coc.nvim, it's going to be hard to fix it without a minimal working example.
I tried to reproduce with this shell command:
vim -Nu NONE +'echom "[tsserver 6133] [I] ''addressForm'' is declared but its value is never read."'
inside an xterm with a default geometry (80 column x 24 lines), but the message was correctly and fully displayed.
If I reduce the width of the terminal to 70 columns, then I get a hit-enter prompt, but the message is – again – fully displayed.
There is one thing which I find curious:
Press ENTER or type command to continue 4,11 All
^^^^^^^^^^^^^^^^^
The underlined part looks like the ruler, but I don't think it should be visible when we're at the hit-enter prompt.
If the issue is in coc.nvim, then there is one way for its author to avoid the hit-enter prompt without temporarily resetting 'cmdheight'
. They can truncate the message so that it fits on a single line, inspecting v:echospace
to compute how much space is available. FWIW, I use it in one of my plugins like this.
Yep, it's the ruler. And the issue is not reproducible with :set noruler
.
Ok, now I can reproduce with:
vim -Nu NONE +'set ruler columns=80 | echom repeat("x", 62)'
The issue disappears if the width of the message is reduced from 62 characters to 61.
Actually, I'm not sure the previous command entirely reproduces your issue; because the message is still correctly displayed. The only thing which may be unexpected is the hit-enter prompt, but I'm not sure as I never set the ruler.
Reproducible with :set ruler
on:
$ vim/src/vim --version
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Jun 16 2020 15:29:25)
Included patches: 1-987
Happens when echom
's text is large enough to overlap with the ruler.
I'd propose to rather temporary hide ruler and show notice in full, without prompt.
To get a MWE, you'll need to bisect the plugin. The first thing I would do is grep for :echom
in the project, and look for all the lines which could output the message you provided in the OP.
I may have missed some but I only found two of them:
All the other :echom
include some literal text which is absent from your message.
Try to temporarily comment one of them and see whether the message is no longer displayed. If you find the line which is responsible for the message, have a look at the function which runs the command and how it's invoked. Try to reproduce with a minimum amount of code.
I did it without the plugin, just plain:
:set ruler
:echom "[tsserver 6133] [I] 'addressForm' is declared but <varying num of chars>..."
Is the hit-enter prompt the issue? Or is it the fact that the message is not displayed?
When I read the OP, I understood the issue as being the fact that the message was not displayed at all:
When coc.nvim tries to output some one-line notification I get only this instead:
Press ENTER or type command to continue 4,11 All
But it is for me:
I don't just get the hit-enter prompt; I also get the message.
If the issue is the hit-enter prompt, and the ruler which should be ignored, then I agree, I think it should, since it's erased anyway. I'll try to bisect later to check whether it's a regression or it has always been like this.
Let's have only this for now:
the issue is the hit-enter prompt, and the ruler which should be ignored
—
You can set 'cmdheight' to 2 or 'statusline' to 2 to avoid the hit-enter prompt.
Or make sure the message fits.
Overwriting the ruler (or the 'showcmd' output) is not really an option, because we can't show two things at the same time. You may prefer to see the messages, others may want to see the ruler.
This is not a bug or something we can fix, therefore closing.
Closed #6268.
because we can't show two things at the same time.
It wasn't what I proposed.
Yes, I think we should have an variable to control hide ruler or cut messages.
I want all the infos show in the same bottom line...
It seems waste sapce when no message is echoed.
—
Reply to this email directly, view it on GitHub.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.