Skip to content
This repository has been archived by the owner on Mar 21, 2022. It is now read-only.

commentstring and comments not set with vim-polyglot #5

Open
ghost opened this issue Jul 31, 2020 · 5 comments
Open

commentstring and comments not set with vim-polyglot #5

ghost opened this issue Jul 31, 2020 · 5 comments

Comments

@ghost
Copy link

ghost commented Jul 31, 2020

vim-json does not set commentstring and comments properly for coc-settings.json (they are blank) on NVIM v0.4.3. vim-json installed with vim-plug and gets listed by scriptnames.

@kevinoid
Copy link
Owner

Can you confirm whether you are using vim-json or vim-jsonc? With coc-settings.json open, what does :set ft? print?

@ghost
Copy link
Author

ghost commented Jul 31, 2020

I am using both vim-json (via vim-polyglot) and vim-jsonc. ft is set to jsonc on coc-settings.json buffer.

@kevinoid
Copy link
Owner

Can you confirm which version of vim-jsonc you are using? Perhaps by running git -C ~/.config/nvim/plugged/vim-jsonc rev-parse --short HEAD or git -C ~/.vim/plugged/vim-jsonc rev-parse --short HEAD or similar. If it is not 8bd0939, could you try updating to that revision?

I'm unable to reproduce the issue using the following steps (Warning: Overwrites ~/.config/nvim/init.vim):

curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \
       https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
printf "call plug#begin()\nPlug 'kevinoid/vim-jsonc'\ncall plug#end()\n" > "${XDG_CONFIG_HOME:-$HOME/.config}"/nvim/init.vim
nvim -c 'PlugInstall | qa'
nvim -c 'echo &comments' coc-settings.json

Which prints sO:* -,mO:* ,exO:*/,s1:/*,mb:*,ex:*/,:// on the status line. Can you work out a more minimal reproduction or host your ~/.config/nvim or ~/.vim directory somewhere?

@ghost
Copy link
Author

ghost commented Jul 31, 2020

I was able to get vim-jsonc work as expected by disabling vim-polyglot temporarily, so there must be a conflict between the two.

@ghost
Copy link
Author

ghost commented Jul 31, 2020

Yes, I am on 8bd0939.
Simply adding Plug 'sheerun/vim-polyglot' to your printf breaks vim-jsonc. Thanks for looking into it and the plugin!

@kevinoid kevinoid changed the title commentstring and comments not set for coc configuration file commentstring and comments not set with vim-polyglot Sep 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant