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

Scott Kostyshak skostysh at
Sat Feb 1 17:40:09 UTC 2020

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

  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.

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.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-paragraph-move-down-now-moves-sub-items-as-well.patch
Type: text/x-diff
Size: 3199 bytes
Desc: not available
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <>

More information about the lyx-devel mailing list