Apply i-textobject even if cursor is only covered by o-textobject #1593
-
Contributing guidelines
Module(s)mini.ai QuestionI have implemented a textobject Then hitting I could not find a way to achieve this by simply changing options of mini.ai. Hence, I assume that I would need to implement a custom search method to achieve the desired behavior. Is this assumption correct? If so, could you point me to a good starting place to implement this search method? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
This is indeed correct for custom textobjects with specification generated from In theory, it is possible to update My suggestions would be the following (from most to least advisable in my opinion):
Hope this helps. |
Beta Was this translation helpful? Give feedback.
This is indeed correct for custom textobjects with specification generated from
gen_spec.treesitter()and more generally for callable specification which returns single or multiple regions. Searching for the "best" region is then done internally by 'mini.ai' based on the current reference region, search method, etc. Asgen_spec.treesitter()returns an array of regions foritextobject and doesn't account foraduring querying for them, the behavior you describe is indeed expected.In theory, it is possible to update
gen_spec.treesitter()querying logic to something like "search regions for bothaanditextobjects, find the best (the smallest width) covering region fora, and then find th…