nvim-treesitter-textobjects
nvim-treesitter-textobjects copied to clipboard
Keep mapping <buffer> although the module of language has not supported textobject
Describe the bug It will over map my fallback textobject keymap.
Expected behavior If the module has not supported textobject, stop mapping.
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?