vim-prettier icon indicating copy to clipboard operation
vim-prettier copied to clipboard

PrettierPartial formats the entire buffer in visual mode

Open PROgram52bc opened this issue 5 years ago • 3 comments
trafficstars

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

PROgram52bc avatar Aug 05 '20 17:08 PROgram52bc

:PartialFormat is meant to be used with visual selection. I try to see if I can reproduce it locally

mitermayer avatar Sep 07 '20 23:09 mitermayer

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

nicolaiskogheim avatar Oct 07 '20 08:10 nicolaiskogheim

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

SingletonSean avatar Dec 29 '23 05:12 SingletonSean