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: , Retry state for current cycle: [FALSE] (Blank line) [24_NOV_2015 13:59:03.554405] <devLogger.LogStreamOut> (DEBUG) Reached last cycle of  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: , 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  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?
echom wrapper looks like this:
execute 'echohl' error for l:line in split('My message.', '\\n') echomsg l:line endfor echohl 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 END catch /E190:/ throw s:myException('Cannot write to file: %s', l:file) endtry
So the right question would probably be: What would be the best way of handling
echomsg both on the
file out and the