Skip to content

Feature Request: Support selecting commented lines #10

@theSprog

Description

@theSprog

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😀.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions