On Wed, March 13, 2013 11:55, Bram Moolenaar wrote:
>
> Christian Brabandt wrote:
>> I think, this happens, because after the error, did_emsg isn't reset yet
>> when calling the foldtext() function. I am not sure, if it is safe to
>> reset did_emsg in main_loop() earlier, but at the very least, we
>> can guard updatescreen(0) by temporarily resetting did_emsg, like the
>> attached patch does.
>
> Where does the value of did_emsg get used then? It's not obvious,
> get_foldtext() doesn't check it.
Well get_foldtext() walks up the entire eval() stack again. And in eval7()
you have in line 5163
/* Invoke the function */
ret = get_func_tv(...)
Here ret gets OK from the function call, and then a couple of lines
later:
if (aborting())
{
if (re == OK)
clear_tv(rettv);
ret = FAIL;
}
ret will be set to FAIL because aborting() I think checks the old
did_emsg variable.
Since the evaluation fails, it returns NULL to text in get_foldtext()
and so in get_foldtext() text will be set to NULL and it runs into
this statement:
if (text == NULL)
#endif
{ sprintf((char *)buf, _("+--%3ld lines folded "), [...]
and so the foldtext() function returns the wrong text.
regards,
Christian
--
--
You received this message from the "vim_dev" 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_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.