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

[mini.ai] Implementation of builtin text objects w, W, p #261

Closed
2 tasks done
Gazareth opened this issue Mar 9, 2023 · 2 comments
Closed
2 tasks done

[mini.ai] Implementation of builtin text objects w, W, p #261

Gazareth opened this issue Mar 9, 2023 · 2 comments
Labels
feature-request Request for a feature to existing module mini.ai

Comments

@Gazareth
Copy link

Gazareth commented Mar 9, 2023

Contributing guidelines

Module(s)

mini.ai

Description

Hi there, thanks for the amazing plugins! I've recently been looking into using mini.ai's textobject search to automatically generate targets for leap-spooky. However I've noticed that some text objects I was expecting to be there do not exist.

Here is the full list of 'builtin' ones according to the source I have:
image

I was just wondering what the reason is for the ommission of w (word), W (WORD) and p (paragraph)? And if it makes sense to add them in?

@Gazareth Gazareth added the feature-request Request for a feature to existing module label Mar 9, 2023
@echasnovski
Copy link
Owner

Hi!

Well, mostly because they are pretty good in their built-in implementation. That said, I miss sometimes the possibility to change the next word with cinw.

Implementing iW and aW should be pretty straightforward as there are %S and %s in Lua patterns for non-blank and blank characters.

Implementing iw and aw seems to be many times harder as Lua patterns recognize alphanumeric only for Latin alphabet. There is also an issue of respecting user settings like 'iskeyword'.

Making ip and ap is also possible, but not with Lua patterns.

I'll consider it, but don't think it will be added in 'mini.ai' builtin textobjects.

@Gazareth
Copy link
Author

Gazareth commented Mar 9, 2023

I see. Thanks for the info and quick response. I'll try and implement them as custom text objects on my side for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for a feature to existing module mini.ai
Projects
None yet
Development

No branches or pull requests

2 participants