Vi Press Enter or Type Command to Continue

arbitrary-dev

unread,

Jun 16, 2020, 3:18:50 AM 6/16/20

to vim/vim, Subscribed

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):

  • Vim version: 8.1.1486
  • OS: Gentoo
  • Terminal: urxvt


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

lacygoill

unread,

Jun 16, 2020, 3:58:34 AM 6/16/20

to vim/vim, Subscribed

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.

arbitrary-dev

unread,

Jun 16, 2020, 6:35:05 PM 6/16/20

to vim/vim, Subscribed

Yep, it's the ruler. And the issue is not reproducible with :set noruler.

lacygoill

unread,

Jun 16, 2020, 6:40:59 PM 6/16/20

to vim/vim, Subscribed

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.

lacygoill

unread,

Jun 16, 2020, 6:43:19 PM 6/16/20

to vim/vim, Subscribed

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.

lacygoill

unread,

Jun 16, 2020, 7:03:50 PM 6/16/20

to vim/vim, Subscribed

Vim version: 8.1.1486

8.1.1486 is one year old. Can you reproduce on master?

arbitrary-dev

unread,

Jun 16, 2020, 7:40:55 PM 6/16/20

to vim/vim, Subscribed

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.

lacygoill

unread,

Jun 16, 2020, 8:00:12 PM 6/16/20

to vim/vim, Subscribed

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:

  • echom a:msgs[0]
  • echohl Error | echom output | echohl None

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.

arbitrary-dev

unread,

Jun 16, 2020, 8:14:28 PM 6/16/20

to vim/vim, Subscribed

I did it without the plugin, just plain:

              :set ruler :echom "[tsserver 6133] [I] 'addressForm' is declared but <varying num of chars>..."                          

lacygoill

unread,

Jun 16, 2020, 8:26:07 PM 6/16/20

to vim/vim, Subscribed

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.

arbitrary-dev

unread,

Jun 16, 2020, 8:58:07 PM 6/16/20

to vim/vim, Subscribed

Let's have only this for now:

the issue is the hit-enter prompt, and the ruler which should be ignored

Bram Moolenaar

unread,

Jun 17, 2020, 4:33:40 AM 6/17/20

to vim/vim, Subscribed

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.

Bram Moolenaar

unread,

Jun 17, 2020, 4:33:43 AM 6/17/20

to vim/vim, Subscribed

arbitrary-dev

unread,

Jun 17, 2020, 2:22:16 PM 6/17/20

to vim/vim, Subscribed

because we can't show two things at the same time.

It wasn't what I proposed.

萧沛

unread,

Mar 7, 2022, 8:32:47 PM Mar 7

to vim/vim, Subscribed

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. Message ID: <vim/vim/issues/6268/1060691258 @ github . com>

davisevisold.blogspot.com

Source: https://groups.google.com/g/vim_dev/c/nRWk22r5qEM

0 Response to "Vi Press Enter or Type Command to Continue"

Mag-post ng isang Komento

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel