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

fixes #1327 #1331

Merged
merged 3 commits into from
Feb 26, 2017
Merged

fixes #1327 #1331

merged 3 commits into from
Feb 26, 2017

Conversation

xconverge
Copy link
Member

@xconverge xconverge commented Feb 25, 2017

@rufusroflpunch this isn't the cleanest way to fix the problem but I think it is fine, what do you think?

The problem is we use nextPairedCharacter in the matcher in a few other places, and if it is not in the pairings, then it returns instantly. However, when we added quotes, this meant nextPairedCharacter would now iterate the document looking for a forward or backward matching char, this could probably be made to work correctly since in these cases quotes are typically pairs, but this solution seemed easier to me for now...

@@ -17,11 +17,6 @@ export class PairMatcher {
// useful for text objects.
"<" : { match: ">", nextMatchIsForward: true },
">" : { match: "<", nextMatchIsForward: false },
// These are useful for deleting closing and opening quotes, but don't seem to negatively
// affect how text objects such as `ci"` work, which was my worry.
'"' : { match: '"', nextMatchIsForward: false },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you leave these inside PairMatcher? Because we use PairMatcher's pairings in other places, like surround.

Can you just give them an attribute like directionless: true? which you check for down below instead?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, but you shouldn't be using quotes in the pairmatcher for surround...there is no open or close, so how is doing a surround with " different than a surround with any other normal character?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually you're right, I just duplicated that code in surround.vim. Yeahhhhhh.

I still would like it to be here for completeness though. :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed :)

@johnfn johnfn merged commit c5fdcf8 into VSCodeVim:master Feb 26, 2017
@johnfn
Copy link
Member

johnfn commented Feb 26, 2017

Perfect, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants