tyru / caw.vim

Vim comment plugin: supported operator/non-operator mappings, repeatable by dot-command, 300+ filetypes
379 stars 48 forks source link

Fix uncommentout error in treesitter #184

Closed yuki-yano closed 1 year ago

yuki-yano commented 1 year ago

When uncommenting while applying treesitter, an error occurred when vim.treesitter.highlighter.hl_map was nil. Fixed it so that if it is nil, it is judged to be in a comment and processed.

tyru commented 1 year ago

Duplicate #171

Thanks for report. And sorry for late reply.

Ttayu commented 1 year ago

@tyru The following errors continue to occur with #171

[Vim(if):E5108: Error executing lua ...ka/.cache/dein/repos/github.com/tyru/caw.vim/lua/caw.lua:26: attempt to index field 'hl_map' (a nil value)^@stack traceback:^@^I...ka/.cache/dein/repos/github.com/tyru/c
aw.vim/lua/caw.lua:26: in function 'has_syntax'^@^I[string "luaeval()"]:1: in main chunk]::[function caw#keymapping_stub[78]..37[3]..42[2]..39[2]..29[4]..40, line 9]

but, no error occurs in this PR.

mpg-kyosuke-takayama commented 1 year ago

same here