New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rewrapping a bullet point inserts new bullet points #232
Comments
Strange. I tried it again after first wrapping the text without vim-markdown; in this case, vim-markdown correctly formatted it and did not add any new bullet points. |
I played around with this some more; it seems like when rewrapping text that is already multi-line, it does the correct thing. However, if the text you want to wrap is currently a single long line, it turns each new line into a bullet point. |
Please provide a minimal example on the issue description so we an understand it faster ;-) |
I'm not sure how to be clearer than I was. Make a long line starting with a bullet point:
Wrap it with vim-markdown installed:
Now you have two bullet points. |
Just ran into this; it only gets triggered when |
When |
After a lot of trial and error, I was able to fix this by adding the following to my .vimrc.
Explanation:
Disclaimer: I'm still relatively new to Vim. Just wanted to share this in case I'm not the only who one found this default something of a deal-breaker. |
lemontheme's solution does not seem to work for me; in fact, even just having
This is in vim 8.0...maybe something has changed in the new version to cause this to no longer work? |
I think the |
Turns out this issue was even noted on the buggy commit itself... The basic problem is that the /* asdf
* some text
* some more text
*/ but it's being misused for bulleted lists, which look something like this: - foo bar
- some extreeeeeeeeeeeeeemely long text that
is so long that it wraps
- some more text Note that, in the code comment, every line starts with |
@shirosaki This is still a problem! (Both the indenting problem in @andmatand 's comment and the auto inserting of bullet points) (see @anowlcalledjosh 's link) Will this get fixed anytime? This problem is very annoying! |
plasticboy/vim-markdown `formatoptions`, `comments`, and `indentexpr` lead to incorrect indentation and hard wrapping behavior as per: * preservim/vim-markdown#232 + Rewrapping a bullet point inserts new bullet points * preservim/vim-markdown#390 + gq wrapping is still broken tpope/vim-markdown has the correct behavior. Compare the two implementations: * https://github.com/preservim/vim-markdown/blob/50d42082819cfa91745b6eff6e28ad5cbc8b27fa/indent/markdown.vim#L4 * https://github.com/tpope/vim-markdown/blob/891dff54a92b04cda36da7fbc6634831c3389d29/ftplugin/markdown.vim#L12 See also `formatlistpat` and explanations at: * https://vimways.org/2018/formatting-lists-with-vim * https://blog.siddharthkannan.in/2019/11/02/format-list-pat-and-vim While I'm at it, introduce dkarter/bullets.vim to take my list game to the next level. Pro Tip: When switching back and forth between plasticboy/vim-markdown and tpope/vim-markdown, use the following to keep vim-plug happy: Plug 'tpope/vim-markdown', {'as': 'tpope-markdown'}
I had a very long line starting with a bullet point. Without
vim-markdown
, selecting the text and rewrapping it viagq
(to fit in 80 columns) causes the text to be wrapped mostly as expected (with some slight formatting glitches).With
vim-markdown
installed, each of these new lines was preceded with an asterisk, causing each wrapped line to be an individual bullet point.The text was updated successfully, but these errors were encountered: