How to not convert layout when pasting?

Scott Kostyshak skostysh at lyx.org
Fri Apr 9 14:58:46 UTC 2021


On Thu, Apr 08, 2021 at 07:29:47PM +0200, Jean-Marc Lasgouttes wrote:
> Le 08/04/2021 à 18:01, Scott Kostyshak a écrit :
> > Sometimes I want to copy something from an itemize environment and paste it into a new enumerate item. If I start a new enumerate item and just paste, LyX converts the layout to itemize. My workaround is to type "a" and then paste. This way, the enumerate is preserved. Then I delete the "a". I forget why I developed this habit rather than just pasting, let LyX convert to itemize, then simply convert back to enumerate. Perhaps the nesting was not fixed when I do this instead? In any case, that's not ideal either.
> 
> 
> What is done in other situations is to differentiate on whether a full
> paragraph is pasted or just a fragment of a paragraph. This is the case when
> inserting an inset over a selection. Would that work for you here?

Just to make sure I understand, according to this copy-based mechanism,
suppose I have the following in an itemize paragraph:

  * This is a paragraph.

If I copy just "This is", then when I paste into the empty enumerate
item it would not be converted to itemize and enumerate would be
preserved. On the other hand if I copy the full "This is a paragraph."
then it would be converted. Do I understand correctly? This is
interesting and I haven't thought about this possibility. I would have
to pay more attention to when this issue comes up for me. I think it
would cover most of the cases.

Scott

> Otherwise the test for emptyness is explicit in the code, it is easy to
> remove. We could test whether the receiving layout is the default layout
> instead.
> 
> JMarc
> 
> -- 
> lyx-devel mailing list
> lyx-devel at lists.lyx.org
> http://lists.lyx.org/mailman/listinfo/lyx-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20210409/5c4f565e/attachment.asc>


More information about the lyx-devel mailing list