-
Notifications
You must be signed in to change notification settings - Fork 52
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
Argument Text Object Count Unappreciated #105
Comments
I see, it works nested as with pairs. I guess the behaviour I'm looking for is more in line with vim's |
I see, this would break nested arguments such as
There should be a method for specifying both depth and breadth. |
There are two approaches, both involve adding the FirstThe problem with target's [count] is it encodes both depth and breadth. So when specifying a non-adjacent offset (such as:
The default [depth] for shifted objects ([breadth != 1) is the innermost level, for the current object it is the current level. [breadth] starts at 1 and increments outwards. Examples:
This illustrates a problem with Perhaps most sensible (and simplest) is to ignore [depth] for
However I find this approach limiting. The most strightfoward approach to solving this selection problem is to add a second (optional) depth specification:
SecondTack on Examples:
Once again, this particular selection isn't possible additional changes:
|
(This is just a reordering of the first proposal: same concept, different text-object.) Perhaps an even better alternative:
Easier to type, remember, and reason with. It just looks more complicated, but most components are optional, or discarded spacers/delimiters. Also more flexible: negative depths can have arbitrary alternative meanings, such as relative-to-current-depth, or outwards->inwards (preferred, I think). number priorities: 1: source-depth-count |
OK, this could be awesome. |
Unfortunately plugins can't handle counts themselves, so there's no real way to expand it in the way you proposed. Vim is taking care of counts and plugins can access those. Personally I would like to have So I'm afraid what you suggest is impossible to build. We could however consider a different text object like As for your initial request, to delete all arguments I just do
That should not be the case, please try again with the latest version of targets.vim |
Hmm, didn't know that. And there are subtitle differences between operators, ie d->v.
What exactly do you mean? Having vim take care of counts just implies custom [count]s can't be used around the operator itself. They can still be used anywhere within the text object specification - just use getchar() to read them:
I agree, having [count] surround the operator is very intuitive. That said, if you're willing to shift the [count]s into the text-object itself, you can still get this behaviour - though I think first you should consider my alternative counting schemes. They can still be accomplished.
Hmm, that is very handy, though I wish it would work for other operators like
|
The problem with
I'm not sure I fully understand. Could you give me a couple of examples to illustrate how they would be used? |
You're right, yield on return isn't high enough. |
Given
call foo("bar", "baz", "bla", "robot")
and any argument text input with counts such asv2aa
,c3ia
, the cursor is repositioned to the start-of-line and no object is modified by the operator.The text was updated successfully, but these errors were encountered: