gabrielelana / vim-markdown

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

add > to s:IsAnEmptyListItem regex #12

Closed wilmoore closed 10 years ago

wilmoore commented 10 years ago

Adding > to the s:IsAnEmptyListItem regular expression character list seems to fix the issue where hitting enter on an empty > previously did not auto-end the quote.

Here is a demo with the new optional setting (g:markdown_drop_empty_blockquotes):

gabrielelana commented 10 years ago

I’m not sure about that, an empty list item it’s useless so an <Enter> on an empty list item will remove it instead of leave the list item empty and create another one below

In this case you are quoting some text and an empty line it’s perfectly fine. How would you insert something like

A line of text

A line of text

? What do you think?

wilmoore commented 10 years ago

quoting some text and an empty line it’s perfectly fine...

Hmmm...you do have a point. I think perhaps it would be nice to make it configurable, that way, for people like me, there is an option to set a good personal default. In fact, if I wanted to write the above example text with the empty line in between, since it isn't my default way of writing, I'd be OK writing it as shown in the below demo (press o or to make the empty line).

wilmoore commented 10 years ago

FYI, I've added a new commit (and squashed) which adds an option.

gabrielelana commented 10 years ago

I propose a slightly different implementation you can review in #14, let me know what do you think. With this you don’t have to duplicate regular expressions and the code is more truthful (isEmptyListItem is only for list items and isEmptyQuote is only for quotes)

wilmoore commented 10 years ago

I propose a slightly different implementation you can review in #14

Yes, I like your implementation better. I pulled down the code from the PR and tested. Everything looks good.

Thanks.