SUSTech-data / wildfire.nvim

wildfire burns treesitter
274 stars 17 forks source link

Feature Request: Support selecting commented lines #10

Open theSprog opened 5 months ago

theSprog commented 5 months ago

First of all, I want to express my gratitude for the fantastic plugin. When I use the incremental selection that comes with treesitter its selection strategy is always too aggressive ('a' instead of 'i'). it often annoys me, until I find the plugin you wrote. It is what I've been looking for !

However, I would like to propose an additional feature that I believe would further improve the usability of the plugin:

I suggest adding support for continuous commented lines. . For example, consider the following code:

surrounds = {
  { "(", ")" },
  -- { "{", "}" },
  -- { "<", ">" },
  -- { "[", "]" },
}

When incrementally selecting the content, it would be helpful if the plugin could select the commented lines:

    -- { "{", "}" },
    -- { "<", ">" },
    -- { "[", "]" },

And then, upon further incremental selection, expand the selection to include the surrounding {} block:

  { "(", ")" },
  -- { "{", "}" },
  -- { "<", ">" },
  -- { "[", "]" },

This feature would provide a more intuitive and granular selection process, allowing users to easily select and manipulate commented sections of their code.

I know this may be a big change to your code. so if you don’t want this, it’s just ok😀.