gabrielelana / vim-markdown

Markdown for Vim: a complete environment to create Markdown files with a syntax highlight that doesn't suck!
MIT License
741 stars 58 forks source link

Fix formatlistpat not work for ordered list #46

Closed ngnmhieu closed 8 years ago

ngnmhieu commented 8 years ago
  1. Fix formatlistpat to work with ordered list. Before formatting with gq command:

    List Header:
     1. Consectetur ipsa dolore nesciunt id ipsam sed ullam? In ut cumque hic consequatur veritatis. Nihil consequuntur tenetur aliquid illo non!
     2. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent aliquet metus sed metus vulputate efficitur!

    After formatting with gq command:

    List Header:
     1. Consectetur ipsa dolore nesciunt id ipsam sed ullam? In ut cumque hic
        consequatur veritatis. Nihil consequuntur tenetur aliquid illo non!
     2. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent aliquet
        metus sed metus vulputate efficitur!
  2. Long list item is broken into 2 items when the list is formated with gq: Before formating with gq command:

    List Header:
     * Consectetur ipsa dolore nesciunt id ipsam sed ullam? In ut cumque hic consequatur veritatis. Nihil consequuntur tenetur aliquid illo non!
     * Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent aliquet metus sed metus vulputate efficitur!

    After formating with gq command:

    List Header:
     * Consectetur ipsa dolore nesciunt id ipsam sed ullam? In ut cumque hic
       consequatur veritatis. Nihil consequuntur tenetur aliquid illo non!
     * Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent
       aliquet metus sed metus vulputate efficitur!
  3. [Fix] Horizontal rules are not joined with the header anymore:

    Big Header
    *****************

    If the text above is formatted with gq, the ********** line will be joined with the line above:

    Big Header *****************

    This commit fixes this error.

  4. [Fix] Similarly to 3., if gq is executed on a codeblock, it would join the starting with the first line in the code block and the last line with the ending:

    ` ` `Code block line 1
    Code block line 2` ` `

    The fix will leave it intact after executing gq on the codeblock.

gabrielelana commented 8 years ago

I guess this pull requests overrides the #45? I will review this tomorrow. Thanks 😉

ngnmhieu commented 8 years ago

Yes, the two commits somehow ended up in both branches.

gabrielelana commented 8 years ago

Thanks, good job 👍