Open rogeriodec opened 3 years ago
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
There is an example with an if / end in Lua:
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):In this case, it's selecting also the first line (if), but I need only lines 2 and 3 (print):
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):