Comments on patch for paragraph-move-down to move sub-items as well

Jean-Marc Lasgouttes lasgouttes at lyx.org
Sat Feb 1 19:43:15 UTC 2020


Le 01/02/2020 à 18:40, Scott Kostyshak a écrit :
> I've been working on a patch for LFUN_PARAGRAPH_MOVE_DOWN move subitems
> of an item along with the item. For example, consider the following
> situation:
> 
>    1. One item <cur>
>       a. "subitem"
>    2. Another item
> 
> Currently (i.e., without the patch), if the cursor is at positiion <cur>
> and the user executes a paragraph-move-down, we get the following:
> 
>    1. "subitem"
>    2. One item <cur>
>    3. Another item
> 
> With the patch, the user would get the following:
> 
>    1. Another item
>    2. One item <cur>
>       a. "subitem"
> 
> I believe this functionality would be consistent with the current
> behavior of outline-down (which has the same keybinding as
> paragraph-move-down), e.g., subsections are moved with sections.

Hi Scott,

I cannot really comment on the patch, but it looks like a very good idea.

JMarc

> 
> Does anyone have comments on the patch, either the desired functionality
> or the actual code?
> 
> Can you think of any strange cases that I can test this code on?
> 
> If no one is against this approach, I will continue working on it and
> commit. I still need to do the following:
> 
>    - Update the documentation of the LFUN and release notes.
> 
>    - Implement consistent behavior for paragraph-move-up.
> 
>    - Factor out code into methods (this will make it easy to
>      implement paragraph-move-up).
> 
>    - The algorithm for swapping the paragraphs in this patch is
>      inefficient (i.e., the end result could be achieved with fewer
>      swaps). I can work on a more efficient algorithm.
> 
> Scott
> 
> 



More information about the lyx-devel mailing list