Open morenoh149 opened 7 years ago
It is also a problem with this code snippet:
if (a < b) {
a->foo(b);
}
It can match from the parentheses on the left of (a < b)
, but it then fails to jump back. Similarly, the last }
brace can match back to the opening brace, but not the other way around. The problem seems to be with the <
and >
characters interfering with the matching.
In the snippet from @morenoh149, the matching between <Box ...>
and </Box>
appears to be interfering with the inner {}
matchings. That is, if you rename Box
or /Box
so that they should no longer match, the {}
matchings work fine.
Sorry for late response.
Instead it jumps to the matching jsx tag . Perhaps this is a precedence issue? Yes, I'll check to tune this.
@gittyupagain
For the <
, >
matching issue.
I want to just remove <
, >
matching from %
motion.
This is problematic, frequently unwanted matching, even pure Vim don't include <>
matching, I noticed.. Why I included this in the first place???
class MoveToPair extends Motion
@extend()
inclusive: true
jump: true
# new
member: ['Parenthesis', 'CurlyBracket', 'SquareBracket']
# old
# member: ['Parenthesis', 'CurlyBracket', 'SquareBracket', 'AngleBracket']
@t9md In Vim you may enable angle bracket matching (:set matchpairs+=<:>
). It should be allowed here too (even if it isn't the default). I use it for matching <
and >
when using templates in C++. I added some tests to verify the behavior matches Vim. I've been using this fix for a couple of months now, and finally got around to making a PR, allowing others to use it too.
for some jsx like
if the cursor is on the first
{
character I would expect the cursor to jump near the end of the same line. Instead it jumps to the matching jsx tag</Box>
. Perhaps this is a precedence issue?Check list
atom --version
) Atom : 1.15.0 Electron: 1.3.13 Chrome : 52.0.2743.82 Node : 6.5.0