atom / bracket-matcher

Jump to brackets
MIT License
142 stars 98 forks source link

Matching wrong elements with similar names #378

Closed chescos closed 5 years ago

chescos commented 5 years ago

Prerequisites

Description

The bracket matcher seems to match the wrong element if a child element contains the name of the parent.

Steps to Reproduce

  1. Copy the code below into an .html file
  2. Move your cursor to the first line (<v-element>) and see which element gets matched

Code:

<v-element>
    <v-element-sub></v-element-sub>
</v-element>

Expected behavior: Match <v-element>with </v-element>

Actual behavior: Match <v-element> with </v-element-sub>

Reproduces how often: 100%

Versions

Atom: 1.34.0
Electron: 2.0.16
Chrome: 61.0.3163.100
Node: 8.9.3
OS: Ubuntu 18.04

Additional Information

Screenshot:

selection_433

rsese commented 5 years ago

Thanks for contributing! I can reproduce with 1.34.0 on macOS 10.12.6 but this looks close enough to https://github.com/atom/bracket-matcher/issues/353 that we'll close as a duplicate for now (e.g. if I remove the - from the element name, the matching works). You can subscribe to that issue if you'd like and if this ends up being a different issue, we can always reopen.


Because we treat our issues list as the Atom team's backlog, we close duplicates to focus our work and not have to touch the same chunk of code for the same reason multiple times. This is also why we may mark something as duplicate that isn't an exact duplicate but is closely related.

For information on how to use GitHub's search feature to find out if something is a duplicate before filing, see the How Can I Contribute? section of the Atom CONTRIBUTING guide.