Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature requests: toggle to select only the beginning and end lines of the brackets or only lines of their content #593

Open
rogeriodec opened this issue Aug 28, 2021 · 1 comment
Labels
C: plugins Related to plugins. P: maybe Pending approval of low priority request. T: feature Feature.

Comments

@rogeriodec
Copy link

There is an example with an if / end in Lua:

image

The inner instructions (print) have 2 tabs ident, I want to fix them to only 1 tab. So I press ctrl+alt+super+s (Select text between brackets):

image

In this case, it's selecting also the first line (if), but I need only lines 2 and 3 (print):
image

In a reverse case, I would like to select only the start and end lines (if / end), for example, to get rid of them and leave only the inner lines (print):

image

@gir-bot gir-bot added the S: triage Issue needs triage. label Aug 28, 2021
@facelessuser
Copy link
Owner

These types of things are usually implemented with BracketHighlighter plugins.

One of the reasons these types of things are done with BH plugins is to allow people to create whatever functionality they need without having to touch the core BH code, and without having to wait for me to specifically implement and/or accept such functionality officially into the project. They can immediately get one up and running by simply creating a BH plugin file in a subfolder under User and manage their own custom use cases.

My intent is to not necessarily support every possible selection and augmentation functionality a user may desire, but provide some basics and enable people to create their own custom ones if desired. Also, by creating hooks for things like selections via BH plugins, the intent is to also encourage pull requests.


TLDR; In short, if the intent is for me to add this into the core, it is probably a maybe from me with a low priority unless there was a lot of interest for such functionality. With that said, I am more than happy to provide guidance if someone were interested to attempt to write a local custom plugin (I would maybe be open to a pull request as well). I would use the select BH plugin as a guide. There is a bit of complexity there for various selection behaviors, so maybe using it as a guide, but creating a separate line selection plugin is the best route. I fear without some refactoring in the selection plugin, yet another use case would just make things even more complicated there.

@gir-bot remove S: triage
@gir-bot add T: feature, P: maybe, C: plugins

@gir-bot gir-bot added C: plugins Related to plugins. P: maybe Pending approval of low priority request. T: feature Feature. and removed S: triage Issue needs triage. labels Aug 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: plugins Related to plugins. P: maybe Pending approval of low priority request. T: feature Feature.
Projects
None yet
Development

No branches or pull requests

3 participants