debug=msg,throw in my .vimrc.
When trying to debug a foldexpr function, the
echom statements I use to print are ignored and are not accessible by
:messages. Any way to make them work?
Vi and Vim Stack Exchange is a question and answer site for people using the vi and Vim families of text editors. It only takes a minute to sign up.Sign up to join this community
Sorry I don't have a clear answer to your problem, but a few tricks that you could use instead. Typically, you could add the messages into a
|List| and display them (the list) on demand.
In my (complex) folding plugin for C&C++, I've used various techniques:
Unfortunately, when there is an error, the only thing that permits to see the error is something like
:echo map(range(1, line('$')), 'the_fold_function(v:val)')
This last trick should also permit to display the messages you have produced.