Richard Heck wrote:
Bo Peng wrote:
Because you are on this topic, can you also check when navigation -> list of listings and other entries are updated? When I add a listings insets with caption, I can see an empty entry but not the caption.
This is a similar issue. The update is done by this call:
       cbuf.tocBackend().update();
at line 705 of buffer_funcs.cp, in updateLabels(). So if you create a new paragraph, again, you get no update and the menu is wrong, but if you then backspace, you do get an update and it's right. The question is thus why this isn't being called for LFUN_CAPTION_INSERT. I'll try to look at that later, or you can do it.
This is wrong. updateLabels() IS called from LFUN_CAPTION_INSERT. But it is NOT called after the caption itself is edited. So you get the same problem if you change an existing caption and then view the navigation menu or, for that matter, the TOC.

The way to solve this might be to put some appropriate code into InsetCaption::notifyCursorLeaves(). I tried this but don't have anything that works. (Mostly, I cause crashes.) In fact, however, this won't quite work anyway, because notifyCursorLeaves() doesn't seem to be called if the cursor leaves the inset via keyboard navigation, though it is called if you move the cursor out with the mouse. That seems wrong, i.e., it seems like a bug.

Now, my sense from the comment in Inset.h is that notifyCursorLeaves() wasn't really intended as this kind of hook. But it is used this way in mathed/InsetMathHull.cpp, where it's used to call do the preview.

JMarc?

Richard

--
==================================================================
Richard G Heck, Jr
Professor of Philosophy
Brown University
http://frege.brown.edu/heck/
==================================================================
Get my public key from http://sks.keyserver.penguin.de
Hash: 0x1DE91F1E66FFBDEC
Learn how to sign your email using Thunderbird and GnuPG at:
http://dudu.dyn.2-h.org/nist/gpg-enigmail-howto

Reply via email to