-
-
Notifications
You must be signed in to change notification settings - Fork 2
feat: add util function include_surrounding_empty_lines()
#4
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
Conversation
It was quite awkward to make this an option/parameter due to how it only works with outer-linewise mode specifically. |
Thanks for your contribution with clean documentation and implementation! Do you think it's better to put it in another directory, called I'm down with |
Well I only put it in But before we talk about naming a separate module, I'm curious about why you decided to expose the core functionality through Plugins typically tend to expose all the major APIs at the top level main module by re-exporting important bits from the nested submodules. Usually the nested modules are "accessible, but private by convention" - direct access is only done to gain more control and hack the plugin but at the risk of being prone to announced internal breaking changes. So I would personally prefer having all the end user APIs re-exported at the top. As for the actual location |
By the time I wrote it I had no idea, but even now I'm not so sure! Do plugins actually expose main functions on the top level? I think I just thought that putting it in a module |
It's just a tendency I found while inspecting plugins I use(d). |
Let's use the name |
:) |
Thank you! This is truly amazing and I also put it in my config. |
Fixes #3.
After an embarrassing amount of off-by-one errors, I have created a more robust version of selection expansion.
It can expand the selection upwards as well as downwards when it makes sense to do so.
Here's an example of how
daI
would function after applying this.Downwards
Upwards
Trailing empty lines
Expands both way if there are no further contents after the empty lines below.
This behavior can be observed from the builtin
ap
as well. I never knew this until now.Expand upwards if cannot go down at all
I find this particularly useful. No other textobject can so precisely do what I want in this situation.