kevinoid/vim-jsonc

commentstring and comments not set with vim-polyglot

Opened this issue · 5 comments

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.

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

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

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?

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

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!