ziontee113 / SelectEase

SelectEase selects matching nodes near the cursor using Treesitter queries with Vim's Select Mode.
80 stars 4 forks source link

support for queries by filetype #1

Closed stickperson closed 1 year ago

stickperson commented 1 year ago

Currently, select_node only supports a single query which is not ideal when queries are language-dependent. For example, the query in the README is not compatible with python.

This is a simple change that allows passing in a table mapping a filetype to a query to use for that filetype: select_ease.select_node({ queries = { python = query }, direction = "next" }). This is a non-breaking change as query will be used if queries is not passed in. If this PR looks good, I can go ahead and update the README before merging.

ziontee113 commented 1 year ago

Hi @stickperson , thank you for the PR. I didn't had the chance to try out different filetypes when I was developing the plugin. Thank you very much :+1: