On Sat, Nov 29, 2025 at 01:28:34PM +0100, Jean-Marc Lasgouttes wrote: > Le 28 novembre 2025 23:12:47 GMT+01:00, Scott Kostyshak <[email protected]> a > écrit : > > > >Don't we need to do the same thing when deleting a character without > >selection? i.e., might some further operation need updated label > >information? Or for some reason it's specific to selection? > > > >If it is specific to selection, would it be reasonable to consider an > >optimization for the case when cutting only text? > > > >Should I step into that code and figure out what part of the > >updateBuffer() is slow? > > > >Scott > > I would hunt for the commit that introduced this code and find out what it > intended to fix.
The commit is: 25fb104d, but the message is basically the same as the comment in the code, so not much new information. > What is #7071 about? When cut/pasting a label, LyX reported that the label already existed. Georg's diagnosis of the issue seems helpful, which I paste here: The problem is that cutSelection() does not remove the delted labels from the ref cache. Therefore the buffer thinks that the label already exists when it is pasted again. The attached patch fixes that. Instead of the patxch one could also simply call cur.buffer()->clearReferenceCache() in cutSelection(). Since this has side effects (it removes all labels, and Buffer::insetLabel() expects that the cache is filled) I don't think that it can be used. It would be nice if someboy who knows how the ref_cache works could take over. I confirm that the fix is still needed. If I open the attached .lyx file and go to Insert > Float > Figure, if I revert the commit, I indeed get the error (that the label already exists). Further, even if I revert the commit, I can still reproduce the slowness, so this might not be the right rabbit hole to jump into. > Concerning potential slowness of updateBuffer, only a profiler can tell you > what is going on. OK I'll dig further and report back. Scott
simple-doc-with-label.23.lyx
Description: application/lyx
signature.asc
Description: PGP signature
-- lyx-devel mailing list [email protected] https://lists.lyx.org/mailman/listinfo/lyx-devel
