neovim icon indicating copy to clipboard operation
neovim copied to clipboard

feat: disable press_enter messages when cmdheight = 0

Open Shougo opened this issue 3 years ago • 8 comments

Fix #20380

It improves cmdheight=0 behavior. The command line redraw is executed when no messages.

NOTE: It is not perfect solution. The echoed text will be overwritten by redraw. I think it is trade off.

Shougo avatar Oct 09 '22 04:10 Shougo

I have improved echo behavior when cmdheight=0. I think it is better.

@bfredl What do you think?

Shougo avatar Oct 09 '22 04:10 Shougo

I just tried it, it looks really good. Thank you!

arsham avatar Oct 09 '22 11:10 arsham

I tried this and it's really weird, but sometimes it won't echo for me. I guess there is something to do with the redrawing and clearing of the text. I am not able to persistently recreate it as it seems to happen randomly. I'll attach a video showing what I mean:

https://user-images.githubusercontent.com/5160701/195175360-37dcafd5-39cf-45ee-8af7-8dbbefd34997.mov

If there is anything else I can try to do to figure out what may be happening, please let me know and I can try!

seblyng avatar Oct 11 '22 18:10 seblyng

I tried this and it's really weird, but sometimes it won't echo for me. I guess there is something to do with the redrawing and clearing of the text.

It seems the text will be overwritten by statusline. I think the redraw is executed. You need to know it is not perfect solution. The echoed text will be overwritten easily.

Note: I cannot reproduce your problem though, if the message is really needed, echomsg is better.

Shougo avatar Oct 12 '22 02:10 Shougo

I have updated the PR. Users need to press keys. I don't like the behavior but better.

It prevents the redraw problem.

Shougo avatar Oct 18 '22 05:10 Shougo

Which behavior is better?

  • No press-enter, but the messages are not displayed sometimes
  • Press-enter, all messages are displayed

Shougo avatar Oct 20 '22 00:10 Shougo

@Shougo I don't know how neovim works internally, but is it possible to make the default behavior customizable with global-options? Personally, I think it's better to show all messages with 'press enter' by default, and to allow the user to manually turn off that option and change the way the messages are displayed with a plugin like noice.nvim.

boltlessengineer avatar Oct 20 '22 07:10 boltlessengineer

It is possible.

But I don't like adding options. It is the last resort.

I think the command line redraw will be improved by @bfredl .

Shougo avatar Oct 20 '22 10:10 Shougo