Weird extra line in messages after first leaving insert mode

55 views
Skip to first unread message

David Barnett

unread,
Aug 5, 2014, 2:07:03 AM8/5/14
to vim...@googlegroups.com
I noticed a vim quirk where there's an extra blank line in the :messages output after first entering and leaving insert mode. The next :echomsg after that overwrites the blank line so there's no longer a blank line.

For example:
vim
:messages
Messages maintainer: Bram Moolenaar <Br...@vim.org>
i<Esc>
:messages
Messages maintainer: Bram Moolenaar <Br...@vim.org>

:echomsg 'Hello'
Hello
:messages
Messages maintainer: Bram Moolenaar <Br...@vim.org>
Hello

It's a small quirk, but is there any explanation why it's there, and any way to fix it? I noticed it when using a script that scrapes the output of :messages after each command and gets very confused by the fact that messages are randomly added and then removed retrospectively.

David

David Barnett

unread,
Aug 5, 2014, 2:25:45 AM8/5/14
to vim...@googlegroups.com
Also discovered it only happens in nocompatible mode.

David



--
--
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 a topic in the Google Groups "vim_use" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vim_use/AcGW6UMCbeY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vim_use+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

David Barnett

unread,
Aug 5, 2014, 3:28:40 AM8/5/14
to vim...@googlegroups.com
On further experimentation, I've found that vim apparently always overwrites a blank message:
  :echomsg ''
  :echomsg 'Foo'
  :messages
  Foo

So the overwriting is at least predictable even if it's surprising. But the issue of having a blank message written in the first place when you enter and leave insert mode is annoying.

David
Reply all
Reply to author
Forward
0 new messages