diff --git a/README.md b/README.md index cb14f54..7f6cc6f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # Auto Close HTML package for Atom Text Editor Will automatically add closing tags when you complete the opening tag. +Updated to correct extra indentation of closing tags on block elements. # Installation @@ -8,6 +9,18 @@ Install using `apm install autoclose-html` +Until merge of this fork, install using temporary installation process as follows: + +1. Uninstall autoclose-html 0.24.0 +2. open a terminal and ... +3. > cd ~/.atom/packages +4. > git clone https://github.com/Ordinal-Data-Inc/autoclose-html.git +5. > cd autoclose-html +6. > npm install +7. > restart Atom +8. Check that Atom > preferences > packages shows autoclose-html 0.24.1 +9. (Optional) Have a sip of coffee + # Usage Under normal circumstances ending tags will be inserted on the same line for inline elements and with `\n\t\n` in between for block elements. This is determined by attaching an element of the given type to the window and checking it's calculated `display` value. @@ -71,3 +84,6 @@ be removed. #### 0.24.0 - Stopped self closing tags from auto closing + +#### 0.24.1 +- Fixes extra indentation on block close tags. Presumes the use of autoindent. diff --git a/lib/autoclose-html.coffee b/lib/autoclose-html.coffee index 955ae22..017b37d 100644 --- a/lib/autoclose-html.coffee +++ b/lib/autoclose-html.coffee @@ -116,6 +116,7 @@ module.exports = if not isInline editor.insertNewline() + editor.backspace() # corrects extra indentation on block close editor.insertNewline() editor.insertText('') if isInline diff --git a/package.json b/package.json index b97bc10..95b4a0b 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "name": "Matt Berkowitz" }, "main": "./lib/autoclose-html", - "version": "0.24.0", + "version": "0.24.1", "private": true, "description": "Automates closing of HTML Tags", "repository": {