vim-prettier
vim-prettier copied to clipboard
PrettierPartial formats the entire buffer in visual mode
Do you want to request a feature or report a bug? This is possibly a bug... But it is likely I am not doing things correctly
What is the current/expected behavior?
When I do :PrettierPartial in visual mode, the entire buffer gets formatted (both the selected text and the unselected text), but when I do :Prettier or :PrettierAsync in visual mode, only the selected text is formatted. Is this the expected behavior? It seems to me their names suggest the reverse... Am I doing something wrong? I am happy to provide extra config info if this is an unexpected behavior.
What version of vim-prettier are you using - (output of :PrettierVersion) ?
:PrettierVersion
1.0.0-alpha
What version of prettier are you using - (output of :PrettierCliVersion) ?
:PrettierVersion
1.19.1
What is your prettier executable path - (output of :PrettierCliPath) ?
:PrettierCliPath
$HOME/.vim/bundle/vim-prettier/node_modules/.bin/prettier
Did this work in previous versions of vim-prettier and/or prettier ? Haven't tried
:PartialFormat is meant to be used with visual selection. I try to see if I can reproduce it locally
I am experiencing the same. Working with typescript files.
" With this mapping, if I select some code and execute the mapping, the entire buffer is formatted.
xmap <localleader>p :PrettierPartial<CR>
:PrettierVersion
1.0.0-beta
:PrettierCliVerson
1.19.1
:PrettierCliPath
/home/my_user/Documents/some_project/node_modules/.bin/prettier
i was having the same issue. it took forever, but this ended up working for me: https://github.com/sdodson99/.dotfiles/commit/1ac954ddb09b832c152e8ebf14778bd6c63bbd4e
this reddit comment in particular was helpful: https://www.reddit.com/r/neovim/comments/y2h8ps/comment/is2zoxx/?utm_source=share&utm_medium=web2x&context=3