nvim-treesitter-textobjects icon indicating copy to clipboard operation
nvim-treesitter-textobjects copied to clipboard

Keep mapping <buffer> although the module of language has not supported textobject

Open kevinhwang91 opened this issue 5 years ago • 1 comments

Describe the bug It will over map my fallback textobject keymap.

Expected behavior If the module has not supported textobject, stop mapping.

kevinhwang91 avatar Dec 01 '20 08:12 kevinhwang91

The reason why I haven't implemented this is that we don't have a convincing story for feature detection with injected languages. It's easy to detect the available textobjects for the root language. But injected languages can be added to the document that have not been there when the document was created.

A solution could be to detect the languages that are available at attach and then add new mapping on injections. But it could be that we set a mapping even though only a small region of the document has the textdocument available. Maybe allow a fallback when no textobject is found for whatever reason?

theHamsta avatar Apr 23 '21 21:04 theHamsta