You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to implement a text object that is separated by logical operators, f.e the && operator. See following example (^ = cursor position, . = text object range):
My idea was to use the argument source, as it has the exact same functionality, the only difference is the separator (which is , instead of &&). I tried to extend the targets mapping through the following way:
But this does not seem to be working. I think the problem is that the separator is expected to be exactly a single character long.
How can I implement such a feature? It would be great if there was something like this that we could use, it would open many doors to create custom text operators.
The text was updated successfully, but these errors were encountered:
I really wanted to implement logical statement text objects today, and this is holding me back. I was told in my topic #254 that these are regexes but I suspect they are not, so it's very strange that they're referred to as regexes. Let's look at the code to see what would need to change to make this work. I want logical statement text objects REAL bad right now.
OK from the code e.g. implementation of argument text object we can see that some simple regexes are built and used for matching, but the mechanism seems to be that of moving the cursor around (?) and testing that against these simple regexes.
It looks like following the template for plugins would be more suitable for something that requires multi character separators. But I worry about ending up having to test a ton of edgecases, and there are a ton of targets features that I wouldn't know how to begin properly testing. Hmm.
Hi. Thank you for your support.
I tried to implement a text object that is separated by logical operators, f.e the
&&
operator. See following example (^
= cursor position,.
= text object range):My idea was to use the argument source, as it has the exact same functionality, the only difference is the separator (which is
,
instead of&&
). I tried to extend the targets mapping through the following way:But this does not seem to be working. I think the problem is that the separator is expected to be exactly a single character long.
How can I implement such a feature? It would be great if there was something like this that we could use, it would open many doors to create custom text operators.
The text was updated successfully, but these errors were encountered: