sublimehq / sublime_text

Issue tracker for Sublime Text
https://www.sublimetext.com
812 stars 40 forks source link

close_tag command closes self-closing tags in JSX syntax #3981

Open ihabunek opened 3 years ago

ihabunek commented 3 years ago

Description

The close_tag command, when invoked after a self-closing tag, closes that tag instead of the previous open tag.

Steps to reproduce

  1. Open new file, set syntax to JSX
  2. Enter: <foo><bar />
  3. Press Alt+. to execute the close_tag command.

Expected behavior

The foo tag is closed, resulting in: <foo><bar /></foo>

Actual behavior

The bar tag is closed, resulting in: <foo><bar /></bar>

Environment

ihabunek commented 3 years ago

It's also indicative that entering <foo><bar/></ and pressing Ctrl+Space to get completion provides both foo and bar.