"zz" vs ":echo"

classic Classic list List threaded Threaded
3 messages Options
ds
Reply | Threaded
Open this post in threaded view
|

"zz" vs ":echo"

ds
Hi!

I noticed quite a strange situation when centering text somehow suppresses the echo output.

Since it all sounds rather weird, I created a reproducible example here: https://pastebin.com/F08V77Av – you can download the file, open it with vim -u NONE, source it then, go to line number 13, and start pressing the j key, – and as soon as you'll reach the middle of your screen, and the text will actually start scrolling, the echom output will be suppressed.

Why is that? And is there any workaround?

Thanks!

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: "zz" vs ":echo"

Jason Felice

zz centers the cursor in the window *vertically* by scrolling the window.  This is why the window is scrolling.  When the cursor is above the 1/2 the screen height, zz doesn't scroll because there's no more file to display.  Once below that point, it will keep the cursor in the middle row.

There is a note on :help :echom about redraws.  If you put a redraw before the echom, the message does not disappear.  This is because echom writes the output but it is immediately cleared by the screen redraw when the normal commands cause the screen to scroll.

On Tue, Apr 10, 2018 at 9:23 AM, ds <[hidden email]> wrote:
Hi!

I noticed quite a strange situation when centering text somehow suppresses the echo output.

Since it all sounds rather weird, I created a reproducible example here: https://pastebin.com/F08V77Av – you can download the file, open it with vim -u NONE, source it then, go to line number 13, and start pressing the j key, – and as soon as you'll reach the middle of your screen, and the text will actually start scrolling, the echom output will be suppressed.

Why is that? And is there any workaround?

Thanks!

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
ds
Reply | Threaded
Open this post in threaded view
|

Re: "zz" vs ":echo"

ds
Thanks a lot, Jason!

On Tuesday, April 10, 2018 at 4:05:55 PM UTC+1, Jason Felice wrote:
> zz centers the cursor in the window *vertically* by scrolling the window.  This is why the window is scrolling.  When the cursor is above the 1/2 the screen height, zz doesn't scroll because there's no more file to display.  Once below that point, it will keep the cursor in the middle row.
>
>
> There is a note on :help :echom about redraws.  If you put a redraw before the echom, the message does not disappear.  This is because echom writes the output but it is immediately cleared by the screen redraw when the normal commands cause the screen to scroll.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.