Argument text object: escaped brackets mismatch
Escaped brackets \[ inside an argument interfere with the matching of parenthesis and give wrong argument selection.
Examples: ( cursor: + , selected: +--------+ , cmd: via )
+
foobar(a, \[123] )
+-----+
+
foobar(a, \[123] )
+----+
@ivomac: Thank you! I can reproduce what you describe. Will look into it 👍
@ivomac: I found why it doesn't work. It's because of how targets.vim uses the built in % command to match pairs in order to skip them when finding arguments. Turns out that the build in % ignores the [ in your example because it's escaped. From :help %:
When 'cpoptions' contains "M" |cpo-M| backslashes
before parens and braces are ignored. Without "M" the
number of backslashes matters: an even number doesn't
match with an odd number. Thus in "( \) )" and "\( (
\)" the first and last parenthesis match.
So if you're working in an environment where the \[ and ] from your example should be considered a match, you should probably add that flag (for example put this into your vimrc):
set cpoptions+=M
I tested it again with that option and now it works as you expected.
@wellle That definitely works! Thanks.