JoosepAlviste / nvim-ts-context-commentstring

Neovim treesitter plugin for setting the commentstring based on the cursor location in a file.
MIT License
1.18k stars 35 forks source link

OptionSet autocmd not called by update_commentstring #34

Closed and3rson closed 2 years ago

and3rson commented 2 years ago

I'm not sure if this is a bug in neovim or this plugin, but the following behavior is observed:

:au OptionSet commentstring :echo "Commentstring changed"
:lua vim.api.nvim_buf_set_option(0, 'commentstring', '-- %s')
" Outputs "Commentstring changed"
:lua require('ts_context_commentstring.internal').update_commentstring()
" Does not output nothing
JoosepAlviste commented 2 years ago

Hey @and3rson! I copied your exact steps and couldn't reproduce the issue in my configuration. Do you have a minimal config for reproducing this?

https://user-images.githubusercontent.com/9450943/146988767-fc7ec4dd-5661-4f68-8649-d06594aa3e2d.mov

JoosepAlviste commented 2 years ago

I'll close this due to inactivity, let me know if it is still an issue!