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

Tag matching self closing tag issue #1668

Closed
vilisper opened this issue May 8, 2017 · 3 comments · Fixed by #1702
Closed

Tag matching self closing tag issue #1668

vilisper opened this issue May 8, 2017 · 3 comments · Fixed by #1702
Labels

Comments

@vilisper
Copy link

vilisper commented May 8, 2017

  • Click thumbs-up 👍 on this issue if you want it!
  • Click confused 😕 on this issue if not having it makes VSCodeVim unusable.

The VSCodeVim team prioritizes issues based on reaction count.


Is this a BUG REPORT or FEATURE REQUEST? (choose one):BUG REPORT

Environment:

  • VSCode Version:1.12.1
  • VsCodeVim Version: 0.7
  • OS:

What happened:
can not match match self closing tag.

What did you expect to happen:

How to reproduce it:
In editor text like:

<div>
<div a=1/>
{{cursor here}}
</div>

and then use cit command.

Maybe solution:
in tagMatcher.ts
TAG_REGEX may always not match TAG_REGEX CLOSE_FORWARD_SLASH
change to:
static TAG_REGEX = /<(/)?([^\>\<\s]+)[^\>\<]*?(/?)>/g;

and in
if (match[TagMatcher.CLOSE_FORWARD_SLASH]) {
match = TagMatcher.TAG_REGEX.exec(corpus); //<- add this line maybe
continue;
}

@Chillee
Copy link
Member

Chillee commented May 8, 2017

Neovim doesn't appear to handle self closing tags on my computer.

@vilisper
Copy link
Author

vilisper commented May 9, 2017

I edit the comment.

<div>
<div a=1/>
{{cursor here}}
</div>

my vim8 handle it. And the code seems to want to handle it too. the regexp match CLOSE_FORWARD_SLASH

@Chillee
Copy link
Member

Chillee commented May 9, 2017

I see. So we should be ignoring self closing tags. I think your solution looks pretty good to me, I'll try it.

@jpoon jpoon added the kind/bug label May 10, 2017
xconverge added a commit that referenced this issue May 17, 2017
Fixes #1668: Self closing tags not properly handled.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants