formulahendry / vscode-auto-close-tag

Auto Close Tag for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=formulahendry.auto-close-tag
MIT License
179 stars 53 forks source link

Don't auto close tag if cursor doesn't have whitespace following #164

Open imliam opened 5 years ago

imliam commented 5 years ago

Assuming | is the cursor, if I try to open a paragraph tag by typing <p> at the beginning of the following line:

|Lorem ipsum dolor sit amet

I will end up with this:

<p>|</p>Lorem ipsum dolor sit amet

This is not what I want to happen, and it is a frequent occurrence that I end up with something like this when editing HTML. Ideally, if the cursor has no whitespace following it, there would be two options.

  1. Don't add an ending tag
Lorem<p>| ipsum dolor sit amet
  1. If the cursor was originally at the beginning of the line, add an ending tag at the end of the line
<p>|Lorem ipsum dolor sit amet</p>