Feature Request: Automatic Ordered List Numbers

Paul Solt's Avatar

Paul Solt

27 Nov, 2018 02:09 PM

When changing indentation the numbers don't automatically update, which makes it hard to keep track of my numbered lists.

I really like the automatic ordered lists in Typora: https://typora.io

Can you do something similar? It's really frustrating when I'm editing a big outline that the numbers don't match up.

Workaround: convert list type for each list will renumber ... can there be an automatic option so I don't have to toggle every list in my outline or book?

  1. 1 Posted by Paul Solt on 27 Nov, 2018 02:13 PM

    Paul Solt's Avatar

    The cleanup feature doesn't renumber starting with 1.

    That would be a requirement of this feature.

    Sites like GitHub don't like it when the ordered list starts with a non-1 digit, which messes up formating if I copy/paste from Multimarkdown Composer

  2. Support Staff 2 Posted by Fletcher on 29 Nov, 2018 05:43 PM

    Fletcher's Avatar

    Paul,

    My concern with this is two fold:

    1. While typing, there is sometimes a "transition" phase where
    something that should be a list isn't, or something that should not be a
    list is. I worry that modifying numbering without being asked could
    cause trouble during these transitions.

    2. The list clean up routine is relatively complex, and I worry about
    undiscovered bugs (you may have even been the one to report the last
    list related bug??) I believe there has only been one such bug in the
    last 6-9 months (??), but that does not guarantee the absence of any
    other bugs. Applying the list cleanup for every change in a list could
    expose users to these bugs much more frequently, if they exist.

    3. (I know I said there were only two... ;) -- I'm not convinced that
    forcing consistent numbering on everyone is the right thing to do. Some
    Markdown processors do allow custom numbering, which would break if I
    forced consistency. And yes, I could make this optional, but I hate
    adding preferences unless truly necessary.

    As it currently stands:

    1. As you note, if you modify an enumerated list such that numbering
    becomes inconsistent, you can toggle to a bulleted list and back, and
    the number is fixed. When you append items to the list, they
    automatically start with the proper numbering.

    2. If you're not sure whether you have any inaccurate lists in your
    document, you can always select all and Clean up Selected Lists. This
    will reapply consistent numbering to all lists in your document.

    I'm not saying this will never become an automatic feature, but I worry
    about doing it prematurely.

    F-

  3. 3 Posted by Paul Solt on 29 Nov, 2018 05:49 PM

    Paul Solt's Avatar

    Ok, so the toggle list type is the easiest way to do this from a hotkey, so I don't need to dig into menus. That's going to be my workaround. Toggling the list type works great, and it gets the sublists to renumber too.

    The cleanup list/all has corrupted my documents before ... so I don't trust it.

    Smart Number Indenting

    It's just annoying that when I indent, it doesn't reset the number to 1. I don't need you to auto renumber all the time, but I would like "smart number" indenting.

    Feature Request: Can you make indent right make the number go back to 1?

    Then if the automatic numbering keeps incrementing that will make me happy.

    Right now, it just keeps counting up when I indent, throwing off all the numbering in the entire document. I'd like it to at least number things sequentially based on level of indentation.

    Unindent should revert to the next number in the list (if there is a list).
    Indent should restart list item at 1.

    Would that work?

  4. Support Staff 4 Posted by Fletcher on 29 Nov, 2018 06:08 PM

    Fletcher's Avatar

    > Ok, so the toggle list type is the easiest way to do this from a hotkey,
    > so I don't need to dig into menus. That's going to be my workaround.
    > Toggling the list type works great, and it gets the sublists to renumber
    > too.
    >
    > The cleanup list/all has corrupted my documents before ... so I don't
    > trust it.

    That's what you were asking me to do with every keystroke, and why I
    didn't want to do it. ;) (The renumbering algorithm is part of the
    list clean up algorithm, which is also called when toggling list types.)

    That said, the cleanup list feature has no existing *known* bugs, so it
    should be usable now. Certainly if you find any troublesome edge cases,
    I want to know.

    But I'm not ready to force it on everyone while they edit lists.

    > Smart Number Indenting
    >
    > It's just annoying that when I indent, it doesn't reset the number to 1.
    > I don't need you to auto renumber all the time, but I would like "smart
    > number" indenting.
    >
    > Feature Request: Can you make indent right make the number go back to 1?
    >
    > Then if the automatic numbering keeps incrementing that will make me
    happy.
    >
    > Right now, it just keeps counting up when I indent, throwing off all the
    > numbering in the entire document. I'd like it to at least number things
    > sequentially based on level of indentation.
    >
    > Unindent should revert to the next number in the list (if there is a
    list).
    > Indent should restart list item at 1.
    >
    > Would that work?
    >

    This would still require using the clean list algorithm, exposing you to
    the risk of undiscovered bugs, as above.

    To summarize:

    1. All the options you discuss end in the same clean up code ("all
    roads lead to Rome")

    2. After latest edge-case bug fix, I have not had any further reports
    of issues in the algorithm (but absence of evidence is not evidence of
    absence, sadly).

    3. I trust the code enough to use it when called, but I am hesitant to
    force it with every keystroke.

    4. At some point in the future, I am open to reconsidering this, though
    my concern then will be performance (is the code fast enough to run with
    each keystroke?) That will be easy enough to test.

    F-

  5. 5 Posted by Paul Solt on 29 Nov, 2018 06:10 PM

    Paul Solt's Avatar

    Does the change list type use the cleanup code?

    I'll keep using that feature, since it's the easiest and has a shortcut.
    The other doesn't.

    -Paul

  6. 6 Posted by Paul Solt on 29 Nov, 2018 06:12 PM

    Paul Solt's Avatar

    Have you setup any unit tests to verify different inputs?

    I think that'd be the best way to establish confidence.

    Create a test for any new bug/fix you do to the output.

    Be able to "change text", insert the cursor, or select elements in the test
    to see what the actual algorithms do.

    -Paul

  7. Support Staff 7 Posted by Fletcher on 29 Nov, 2018 06:15 PM

    Fletcher's Avatar

    Yes -- the list modification commands trigger the list clean-up as the
    last step. For example, toggling a list type only changes the first
    item in the list, and then it relies on clean-up to change the remaining
    items.

    F-

  8. Support Staff 8 Posted by Fletcher on 29 Nov, 2018 06:20 PM

    Fletcher's Avatar

    Already done. But this only covers bugs in situations I know about, not
    in situations that don't fit my expectations.... Which is the problem.

    If only all you users would use the program in the exact same way I do,
    there would be so much less difficulty..... ;)

    MMD itself has a large and growing suite of integration tests (included
    in the Github repo.) The text engine I use in Composer has a large
    number of unit tests embedded. But the range of things people try is so
    much larger than I can imagine -- things that work fine in English break
    in CJK languages. People writing using different styles and formatting
    conventions stumble across weird edge cases that I would not think of in
    a million years.

    All I can do is keep refining and collecting instances that break to
    avoid repeating the same mistakes in the future.

    At least it's interesting.... ;)

    F-

  9. 9 Posted by Paul Solt on 29 Nov, 2018 06:22 PM

    Paul Solt's Avatar

    Awesome. =)

    -Paul

  10. Fletcher closed this discussion on 09 Dec, 2018 09:38 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac