I have a couple of functions chained together to verbose messages in my status line in MacVim. I have noticed that in one particular occasion a line is blank and is not delivering the message it is supposed to deliver:[24_NOV_2015 13:59:03.544470] <devLogger.LogStreamOut> (DEBUG) Cycle: [0], Retry state for current cycle: [FALSE](Blank line)[24_NOV_2015 13:59:03.554405] <devLogger.LogStreamOut> (DEBUG) Reached last cycle of [0] cycle(s).However, when I type :messages I can clearly see the missing line:[24_NOV_2015 13:59:03.544470] <devLogger.LogStreamOut> (DEBUG) Cycle: [0], Retry state for current cycle: [FALSE][24_NOV_2015 13:59:03.552491] <devLogger.LogStreamOut> (DEBUG) Success, stream sent to file.[24_NOV_2015 13:59:03.554405] <devLogger.LogStreamOut> (DEBUG) Reached last cycle of [0] cycle(s).If I use a blank echom '' at the end of my message functions, all 3 lines come through fine, but I get a blank line at the end of the message stream.Is there a more elegant way to make sure that every message appears in the status line in Vim?My core echom wrapper looks like this:execute 'echohl' errorfor l:line in split('My message.', '\\n')  echomsg l:lineendforechohl NONE--- CORRECTION ---After further investigation, I now know that the echomsg wrapper that I use to send messages to the messaging facility of vim is not the problem. The problem was a function wrapper that sends the echomsg to a file in parallel. So this is where something goes wrong and my echomsg on the status line is messed up (sometimes).The function looks like this:try    echon \r    execute 'redir >> ' . l:file    silent echomsg l:msgString    silent echo \n    silent! redir ENDcatch /E190:/    throw s:myException('Cannot write to file: %s', l:file)endtrySo the right question would probably be: What would be the best way of handling echomsg both on the file out and the message sides.Thanks.
How to make sure every 'echo[msg]' command is visible?
vimscript;macvim
I have asked this question in a wrong way. The problem was not related to the echomsg command alone but more about writing the messages to a file. I will be posting a more specific question regarding this issue of: How to append a string to a file in vim script?