Use correct marker from previous list level
commita64809759a51f47bac1a7686969c877c5857e6b2
authorJason Blevins <jrblevin@sdf.org>
Sat, 19 Dec 2015 04:45:03 +0000 (18 23:45 -0500)
committerJason Blevins <jrblevin@sdf.org>
Sat, 19 Dec 2015 04:57:36 +0000 (18 23:57 -0500)
treef89afd7884fabf29f6827ebdc909568c73e1b8f6
parentacf7c5e6f65feccb851a611d46baabd749e46423
Use correct marker from previous list level

Putting the point after "AAA" in the following sample and pressing `C-u`
`M-RET` should insert "*" (properly dedented) instead of "1.".

```
1. A
    * AA
        1. AAA
```

It should produce:

```
1. A
    * AA
        1. AAA
    *
```

Previously, it produced this instead:

```
1. A
    * AA
        1. AAA
    1.
```

This commit changes the behavior of `(markdown-prev-list-item level)`.
It now stops at list items with (non-list-marker) indentation at or
*below* `level`. In the example above, the (non-list-marker) indentation
of "AAA" is 11. Subtracting 4 gives 7, but the corresponding indentation
of the previous item "AA" is only 6. So, when mixing list types it does
not suffice to simply subtract 4 and look for equal indentation.
Instead, we subtract 1 and find the previous item with *lesser than or
equal* indentation.

Closes https://github.com/jrblevin/markdown-mode/issues/4
markdown-mode.el
tests/markdown-test.el