Do you want to request a feature or report a bug?
bug
What is the current/expected behavior?
vim-prettier should properly format markdown files. Currently it puts the entire file on a single line. For example, with this input:
# Whatever
This is a document that contains general whatever information as well as details about events.
## List
- Thing 1
- Thing 2
vim-prettier currently transforms to this:
# Whatever This is a document that contains general whatever information as well
as details about events. ## List - Thing 1 - Thing 2
If I run prettier via the command line, things work as expected & my output is:
# Whatever
This is a document that contains general whatever information as well as details about events.
## List
- Thing 1
- Thing 2
What version of vim-prettier are you using - (output of :PrettierVersion) ?
0.2.7
What version of prettier are you using - (output of :PrettierCliVersion) ?
1.15.2
What is your prettier executable path - (output of :PrettierCliPath) ?
prettier
Did this work in previous versions of vim-prettier and/or prettier ?
yes, I'm pretty sure this worked with prettier v1.12.x I thought this may have something to do with a change I made to my vim config but I've set up a very minimal config (see below) & still see this issue:
" plugins
" -------------------------------------
call plug#begin('~/.vim/plugged')
Plug 'tpope/vim-sensible'
Plug 'prettier/vim-prettier', { 'do': 'npm install' }
call plug#end()
Thanks for reporting this issue, will look into it asap
So I have no idea why it's happening, but the reason for this is that ftplugin/html.vim is running. If I comment out lines 1-3 of ftplugin/html.vim, b:prettier_ft_default_args.parser does not get overwritten to 'html' and instead remains 'markdown' and the whole thing works properly. Quite bizarre, though.
Got it. PR incoming.
Merged on https://github.com/prettier/vim-prettier/pull/169 thanks everyone for this! Sorry I have been away from here for the last few months.
Most helpful comment
Got it. PR incoming.