Giter Site home page Giter Site logo

autoclose-html's Introduction

Auto Close HTML package for Atom Text Editor

Will automatically add closing tags when you complete the opening tag.

Installation

Install using

apm install autoclose-html

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. You can use Force Inline and Force Block preferences to override this.

Bug Reports and Contributing

If you find a bug, please feel free to file an issue. Please understand however that I have very little time to work on this anymore, so most feature requests will not be implemented.

Better than an issue, however, would be to try and fix it yourself and submit a PR.

If you are interested in helping maintain this library, please contact me. As I mentioned, I have very little time to devote to this anymore, so if someone has interest in helping to keep it maintained, I'm open to considering it.

Options

Force Inline

Elements in this comma delimited list will render their closing tags on the same line, even if they are block by default. You can set this to "*" to force all closing tags to render inline.

Force Block

Elements in this comma delimited list will render their closing tags after a tabbed line, even if they are inline by default. A value of "*" for Force Inline overrides all values in Force Block.

Never Close

Elements in this comma delimited list should not render a closing tag

Make Never Close Elements Self Closing

Will convert elements in Never Close list from <br> to <br />

Legacy/International Mode

Enables the old style of completion detection using buffer events rather than keybindings. Atom doesn't work well currently with non-US/non-QUERTY keyboards and will not correctly fire events when '>' is pressed and/or fire events for entirely different keys. Please note that this mode is buggy (ie can complete after undo) and may not be compatible with new features and bug fixes in future releases, post-0.22.0 If/when the core issues behind keybindings not reporting correctly on international keyboards is solved this option will be removed.

Changelog

0.20.0

  • HTML (Jinja Templates), Ember HTMLBars, JavaScript with JSX added to default grammars, per user requests
  • Dispose events on deactivate (should prevent double closing after an upgrade in the future, although I don't think it will help for this release)
  • Added ability to use "*" for Force Inline Options
  • Some Readme cleanup

0.21.0

  • Fixed double closing after changing grammar

0.22.0

  • Better way of handling events, solves rebinding problems and having to define grammars to apply to

0.23.0

  • Added legacy mode for users having problems with event handling introduced in 0.22.0

0.24.0

  • Stopped self closing tags from auto closing

autoclose-html's People

Contributors

amayer5125 avatar evanhahn avatar gsmetal avatar jacobmischka avatar lncg avatar matsilva avatar mattberkowitz avatar rschiang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

autoclose-html's Issues

PHP support

Would be nice if this would be enabled in php files.

Problem with Never Close Elements

On closing never close elements I get a error:
Uncaught TypeError: Property 'makeNeverCloseSelfClosing' of object # is not a function

I get this error when the option to self-close these elements is enabled or disabled...
Only way to continue writing HTML documents is disabling autoclose...

Add support based on file extension, rather than file type.

This plugin would probably be a bit more useful if it could be used in multiple file types. I'm sure theres a number of people who write HTML within PHP files, or one of the various template systems available, and could use the auto-complete feature. I personally use Handlebars templates and could make use of it if it was available.

I think adding an option to the config to allow any file extension to be handled would be useful.

It doesn't auto close

I created a new html file. I type "< div >" and expect it to create a "< /div >" but it didn't do anything. I go to the next line and type "< h1 >", hit enter.. nothing happens. now I see:
"< div >
< h1 >"

Atom.Object.defineProperty.get is deprecated.

atom.workspaceView is no longer available.
In most cases you will not need the view. See the Workspace docs for
alternatives: https://atom.io/docs/api/latest/Workspace.
If you do need the view, please use atom.views.getView(atom.workspace),
which returns an HTMLElement.

Atom.Object.defineProperty.get (/Applications/Atom.app/Contents/Resources/app/src/atom.js:55:11)
Object._events (/Users/max/.atom/packages/autoclose-html/lib/autoclose-html.coffee:108:13)

Atom.Object.defineProperty.get is deprecated.

atom.workspaceView is no longer available.
In most cases you will not need the view. See the Workspace docs for
alternatives: https://atom.io/docs/api/latest/Workspace.
If you do need the view, please use atom.views.getView(atom.workspace),
which returns an HTMLElement.

Atom.Object.defineProperty.get (/Applications/Atom.app/Contents/Resources/app/src/atom.js:55:11)
Object._events (/Users/liuzhongyi/.atom/packages/autoclose-html/lib/autoclose-html.coffee:108:13)

Doesn't work for PHP files

Most (if not all) of my non-conceptual HTML is in PHP files rather than HTML but this plugin doesn't seem to work for PHP files. :(

key binding conflict between php-beautifier, your autoclose-html & 3 other packages, causes Dev Tools console to come up when invoking Settings

hello,

i have found a key binding conflict between your php-beautifier package, your autoclose-html, and three other atom editor (ver. 0.94.0) packages, all sharing the same ctrl-alt-o (ctrl-option-o on Mac OS X) key binding.

your autoclose-html package doesn't conflict with anything else when run without php-beautifier enabled. however, when php-beautifier is then enabled, it causes, when bringing up the Settings view tab/pane (cmd-,) in the atom editor, the Dev Tools console (usually invoked with cmd-alt-i) in the lower third of the atom editor window, when you haven't requested the Dev Tools console to come up.

when i turned php-beautifier from disabled to enabled and restarted Atom, i was able to reproduce the problem of bring up the Atom Dev Tools console when simply trying to open the Settings view tab/pane.

the reason this is happening, i believe, is because it shares the same key binding, ctrl-option-o, or ctrl-alt-o on non-Apple-Mac keyboards, as the following four packages i'm also running —

atom-git-show (https://github.com/fundon/atom-git-show)
atom-javascript-snippets (https://github.com/zenorocha/atom-javascript-snippets)
deprecation-cop (https://github.com/atom/deprecation-cop)
php-beautifier (https://github.com/sdwood/php-beautifier/)

your package and all these, along with php-beautifier, share the same ctrl-alt-o key binding. yours with the other three co-exist just fine with that same binding (save the fact that the key binding doesn't work because of the conflict, you have to invoke your package by the Command Palette, cmd-shift-p), but the moment you enable php-beautifier and restart Atom 0.94.0, then try and bring up the Settings tab/pane, you get, suddenly, the Dev Tools console coming up in the bottom third of the Atom Editor window when you never asked for it.

i found this, after seeing php-beautifier was causing the issue, by using the keybinding-resolver package, which showed me all the packages sharing the same ctrl-alt-o key binding.

i thought you would want to know about this, contact the other package developers, and try and resolve this, perhaps by one or more of you choosing another key binding to invoke your autoclose-html package.

i am also filing issues with these other developers and have also notified atom core support of this issue.

best,

— faddah wolf
portland, oregon, u.s.a.

improving the autocomplete

While working with Bootstrap3 we need to add a lot of divs with a lot of classes so it would be great if a this would be an option, div.hello would be expanded to <div class="hello"></div>, would save a lot of time

Add Additional Grammer Setting

Would be nice to have a settings input that lets you specify additional grammers, vs ignoring grammers.
Basically just duplicating your Force block logic.

I hardcoded this locally and it works nicely

grammerNames = ['HTML', 'Web Form/Control (C#)']
if grammar.name?.length > 0 and (@ignoreGrammar or grammar.name in grammerNames)

Atom.Object.defineProperty.get is deprecated.

I've been getting a error about atom.workspaceView is no longer available. On line 108 in lib/autoclose-html.coffee is where it takes me to. I'd fix it myself if I was certain enough how to without breaking stuff.

See the Workspace docs for alternatives: https://atom.io/docs/api/latest/Workspace.
If you do need the view, please use atom.views.getView(atom.workspace),
which returns an HTMLElement.

Atom.Object.defineProperty.get (c:\Users\Jim\AppData\Local\atom\app-0.174.0\resources\app\src\atom.js:55:11)
Object._events (c:\Users\Jim\.atom\packages\autoclose-html\lib\autoclose-html.coffee:108:13)

Doesn't work at all

I never managed to have it work.

I am on Mac Os, Atom 0.129.0.

When I open up Atom I have these errors (I don't know whether they can also influence your plugin's functioning):

TypeError: Cannot read property 'getBufferPosition' of undefined at Editor.module.exports.Editor.getCursorBufferPosition (/Applications/Atom.app/Contents/Resources/app/src/editor.js:1646:34) at CursorPositionView.module.exports.CursorPositionView.updateCursorPositionText (/Applications/Atom.app/Contents/Resources/app/node_modules/status-bar/lib/cursor-position-view.js:46:46) at HTMLDivElement.<anonymous> (/Applications/Atom.app/Contents/Resources/app/node_modules/status-bar/lib/cursor-position-view.js:3:61) at HTMLDivElement.jQuery.event.dispatch (/Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:4676:9) at HTMLDivElement.elemData.handle (/Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:4360:46) at Object.jQuery.event.trigger (/Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:4594:12) at HTMLDivElement.<anonymous> (/Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:5119:17) at Function.jQuery.extend.each (/Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:590:23) at StatusBarView.jQuery.fn.jQuery.each (/Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:237:17) at StatusBarView.jQuery.fn.extend.trigger (/Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:5118:15) at HTMLDivElement.<anonymous> (/Applications/Atom.app/Contents/Resources/app/node_modules/status-bar/lib/status-bar-view.js:50:24) at HTMLDivElement.jQuery.event.dispatch (/Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:4676:9) at HTMLDivElement.elemData.handle (/Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:4360:46) at Object.jQuery.event.trigger (/Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:4594:12) at HTMLDivElement.<anonymous> (/Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:5119:17) at Function.jQuery.extend.each (/Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:590:23) at PaneContainerView.jQuery.fn.jQuery.each (/Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:237:17) at PaneContainerView.jQuery.fn.extend.trigger (/Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:5118:15) at PaneContainerView.module.exports.PaneContainerView.onActivePaneItemChanged (/Applications/Atom.app/Contents/Resources/app/src/pane-container-view.js:90:19) at /Applications/Atom.app/Contents/Resources/app/src/pane-container-view.js:3:61 at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app/node_modules/event-kit/lib/emitter.js:71:11) at /Applications/Atom.app/Contents/Resources/app/src/pane-container.js:269:34 at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app/node_modules/event-kit/lib/emitter.js:71:11) at Pane.module.exports.Pane.setActiveItem (/Applications/Atom.app/Contents/Resources/app/src/pane.js:250:22) at Pane.module.exports.Pane.activateItem (/Applications/Atom.app/Contents/Resources/app/src/pane.js:296:21) at /Applications/Atom.app/Contents/Resources/app/src/workspace.js:351:16 at _fulfilled (/Applications/Atom.app/Contents/Resources/app/node_modules/q/q.js:787:54) at self.promiseDispatch.done (/Applications/Atom.app/Contents/Resources/app/node_modules/q/q.js:816:30) at Promise.promise.promiseDispatch (/Applications/Atom.app/Contents/Resources/app/node_modules/q/q.js:749:13) at /Applications/Atom.app/Contents/Resources/app/node_modules/q/q.js:557:44 at flush (/Applications/Atom.app/Contents/Resources/app/node_modules/q/q.js:108:17) at process._tickCallback (node.js:349:11) at Ipc.sendSync (/Applications/Atom.app/Contents/Resources/atom/renderer/api/lib/ipc.js:37:29) at Ipc.sendChannelSync (/Applications/Atom.app/Contents/Resources/atom/renderer/api/lib/ipc.js:45:28) at BrowserWindow.RemoteMemberFunction [as getPosition] (/Applications/Atom.app/Contents/Resources/atom/renderer/api/lib/remote.js:108:29) at Atom.module.exports.Atom.getWindowDimensions (/Applications/Atom.app/Contents/Resources/app/src/atom.js:256:28) at saveDimensions (/Users/niccolomineo/.atom/packages/remember-session/lib/remember-session.coffee:24:32) at /Users/niccolomineo/.atom/packages/remember-session/lib/remember-session.coffee:19:29 at jQuery.event.dispatch (/Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:4676:9) at elemData.handle (/Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:4360:46) /Applications/Atom.app/Contents/Resources/app/src/workspace.js:367(anonymous function) /Applications/Atom.app/Contents/Resources/app/src/workspace.js:367 4

This is my config:

'exception-reporting': 'userId': 'a0be488d-d2cd-c789-0904-76c65452f195' 'welcome': 'showOnStartup': false 'metrics': 'userId': '7332eae71104446970390dac057b538d0addfa94' 'editor': 'fontFamily': 'Inconsolata' 'fontSize': 15 'invisibles': {} 'core': 'themes': [ 'yosemite-unity-ui' 'tomorrow-night-eighties' ] 'disabledPackages': [ 'feedback' ] 'highlight-line': 'backgroundRgbColor': '70,70,70' 'remember-session': 'x': 504 'y': 23 'width': 773 'height': 724 'path': '' 'tabs': '' 'selectedTab': '' 'tree-view': 'showOnRightSide': true 'csslint': 'validateOnSave': false 'hideOnNoErrors': true 'autoclose-html': 'closeOnEndOfOpeningTag': true

Atom.Object.defineProperty.get is deprecated.

atom.workspaceView is no longer available.
In most cases you will not need the view. See the Workspace docs for
alternatives: https://atom.io/docs/api/latest/Workspace.
If you do need the view, please use atom.views.getView(atom.workspace),
which returns an HTMLElement.

Atom.Object.defineProperty.get (/Applications/Atom.app/Contents/Resources/app/src/atom.js:54:11)
Object._events (/Users/Mo/.atom/packages/autoclose-html/lib/autoclose-html.coffee:108:13)

Uncaught TypeError: Cannot read property 'name' of undefined

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 0.165.0
System: Mac OS X 10.10.3
Thrown From: autoclose-html package, v0.15.0

Stack Trace

Uncaught TypeError: Cannot read property 'name' of undefined

At /Users/INALOW/.atom/packages/autoclose-html/lib/autoclose-html.coffee:108

TypeError: Cannot read property 'name' of undefined
  at /Users/INALOW/.atom/packages/autoclose-html/lib/autoclose-html.coffee:108:17
  at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app/node_modules/event-kit/lib/emitter.js:82:11)
  at TextEditor.module.exports.TextEditor.handleGrammarChange (/Applications/Atom.app/Contents/Resources/app/src/text-editor.js:2736:27)
  at /Applications/Atom.app/Contents/Resources/app/src/text-editor.js:196:24
  at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app/node_modules/event-kit/lib/emitter.js:82:11)
  at TokenizedBuffer.module.exports.TokenizedBuffer.setGrammar (/Applications/Atom.app/Contents/Resources/app/src/tokenized-buffer.js:164:27)
  at DisplayBuffer.module.exports.DisplayBuffer.setGrammar (/Applications/Atom.app/Contents/Resources/app/src/display-buffer.js:1042:35)
  at TextEditor.module.exports.TextEditor.setGrammar (/Applications/Atom.app/Contents/Resources/app/src/text-editor.js:2357:33)
  at GrammarListView.module.exports.GrammarListView.confirmed (/Applications/Atom.app/Contents/Resources/app/node_modules/grammar-selector/lib/grammar-list-view.js:60:21)
  at GrammarListView.module.exports.SelectListView.confirmSelection (/Applications/Atom.app/Contents/Resources/app/node_modules/autocomplete/node_modules/atom-space-pen-views/lib/select-list-view.js:335:21)
  at HTMLLIElement.<anonymous> (/Applications/Atom.app/Contents/Resources/app/node_modules/autocomplete/node_modules/atom-space-pen-views/lib/select-list-view.js:139:19)
  at HTMLOListElement.jQuery.event.dispatch (/Applications/Atom.app/Contents/Resources/app/node_modules/archive-view/node_modules/atom-space-pen-views/node_modules/space-pen/vendor/jquery.js:4676:9)
  at HTMLOListElement.elemData.handle (/Applications/Atom.app/Contents/Resources/app/node_modules/archive-view/node_modules/atom-space-pen-views/node_modules/space-pen/vendor/jquery.js:4360:46)

Commands

     -0:00.0 grammar-selector:show (atom-text-editor.editor.editor-colors)

Config

{
  "core": {
    "themes": [
      "seti-ui",
      "seti-syntax"
    ]
  },
  "autoclose-html": {}
}

Installed Packages

# User
Stylus, v0.5.3
autoclose-html, v0.15.0
color-picker, v1.4.4
emmet, v2.3.3
language-stylus, v0.1.0
language-swift, v0.3.0
processing-language, v0.1.0
project-manager, v1.15.5
script, v2.16.0
seti-syntax, v0.2.1
seti-ui, v0.6.3
tag, v0.2.3

# Dev
No dev packages

/cc @atom/core

Uncaught InvalidCharacterError: Failed to execute 'createElement' on 'Document': The tag name provided ('class="schedule-map-left"') is not a valid name.

Uncaught InvalidCharacterError: Failed to execute 'createElement' on 'Document': The tag name provided ('class="schedule-map-left"') is not a valid name.

Atom Version: 0.158.0
System: Mac OS X 10.10.1
Thrown From: autoclose-html package, v0.12.0

Steps To Reproduce

  1. Open some HTML file
  2. type <class="bla" (which is obviously wrong because of the missing element name, e.g., div.)
  3. type > to close the element => Exception is thrown

I understand that the written HTML is not valid, but Atom shouldn't throw an exception because of that. An alert that I wrote completely wrong code would be fine however.

Stack Trace

At /Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/history.js:121

Error: Failed to execute 'createElement' on 'Document': The tag name provided ('class="schedule-map-left"') is not a valid name.
  at Error (native)
  at Object.module.exports.isInline (/Users/ph/.atom/packages/autoclose-html/lib/autoclose-html.coffee:53:24)
  at Object.module.exports.execAutoclose (/Users/ph/.atom/packages/autoclose-html/lib/autoclose-html.coffee:89:25)
  at /Users/ph/.atom/packages/autoclose-html/lib/autoclose-html.coffee:106:18
  at TextBuffer.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app/node_modules/emissary/lib/emitter.js:118:15)
  at TextBuffer.module.exports.TextBuffer.applyPatch (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/text-buffer.js:591:12)
  at TextBuffer.module.exports.TextBuffer.setTextInRange (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/text-buffer.js:503:12)
  at Selection.module.exports.Selection.insertText (/Applications/Atom.app/Contents/Resources/app/src/selection.js:446:43)
  at /Applications/Atom.app/Contents/Resources/app/src/text-editor.js:738:31
  at /Applications/Atom.app/Contents/Resources/app/src/text-editor.js:777:27
  at History.module.exports.History.transact (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/history.js:112:18)
  at TextBuffer.module.exports.TextBuffer.transact (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/text-buffer.js:683:27)
  at TextEditor.module.exports.TextEditor.transact (/Applications/Atom.app/Contents/Resources/app/src/text-editor.js:1146:26)
  at TextEditor.module.exports.TextEditor.mutateSelectedText (/Applications/Atom.app/Contents/Resources/app/src/text-editor.js:770:19)
  at TextEditor.module.exports.TextEditor.insertText (/Applications/Atom.app/Contents/Resources/app/src/text-editor.js:735:21)
  at TextEditor.object.(anonymous function) [as insertText] (/Applications/Atom.app/Contents/Resources/app/node_modules/underscore-plus/lib/underscore-plus.js:73:27)
  at /Applications/Atom.app/Contents/Resources/app/src/text-editor-component.js:653:23
  at History.module.exports.History.transact (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/history.js:112:18)
  at TextBuffer.module.exports.TextBuffer.transact (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/text-buffer.js:683:27)
  at TextEditor.module.exports.TextEditor.transact (/Applications/Atom.app/Contents/Resources/app/src/text-editor.js:1146:26)
  at [object Object].module.exports.React.createClass.onTextInput (/Applications/Atom.app/Contents/Resources/app/src/text-editor-component.js:652:30)
  at HTMLDivElement.boundMethod (/Applications/Atom.app/Contents/Resources/app/node_modules/react-atom-fork/lib/ReactCompositeComponent.js:1295:21)

/cc @atom/core

Random tags getting closed!

Installed this to test, and it doesn't seem to be particularly reliable.

For example, created an empty document and added

The plugin generated:

Bug

I found a bug where if the plugin is disabled and reenabled, the closing tag is added however many times it was disabled.

Atom.Object.defineProperty.get is deprecated.

atom.workspaceView is no longer available.
In most cases you will not need the view. See the Workspace docs for
alternatives: https://atom.io/docs/api/latest/Workspace.
If you do need the view, please use atom.views.getView(atom.workspace),
which returns an HTMLElement.

Atom.Object.defineProperty.get (/Applications/Atom.app/Contents/Resources/app/src/atom.js:55:11)
Object._events (/Users/vaeum/.atom/packages/autoclose-html/lib/autoclose-html.coffee:108:13)

Doesn't close anything

Hi,

I just updated to version 0.9.0 but I regret it: it doesn't close anything!
The "Additionnal Grammars" option is set to "*" but, even in a HTML file, tags are not closed automatically.

Version 0.8 worked perfectly, so am I doing somehting wrong? Please don't hesitate if I can help you with additionnal information.

Cannot read property getBufferPosition of undefined

This issue is resolved in fact but I wanted to keep a trace on the repo because I lost few minutes to find a solution and it was pretty simple.

When I updated the autoclose-html package, I was got everytime the following error.

Error

I had an error when I'm finishing to write an opening HTML tag.
I mean I write <div, it's ok but when I type > the error is occurring.
But the tag is closed.

autoclose-html-error

Solution

Close then restart Atom does nothing.
Indeed, you have to disable and re-enable the package autoclose-html.
That's all.

Option to disable autoclose when using multiple cursors

Hi, first of all, thanks for this package. One annoyance I've found is that when editing with multiple cursors and I create then opening tag it will automatically add as many closing tags as I have cursors, put each on a new line with an additional blank line and go back to a single cursor.

It would be nice if there was a setting to have autoclose disabled when using multiple cursors as this is usually meant to be a precise edit to existing content and it would be ok to manually make the closing tag where I want.

Thanks for the consideration!

Atom.Object.defineProperty.get is deprecated.

atom.workspaceView is no longer available.
In most cases you will not need the view. See the Workspace docs for
alternatives: https://atom.io/docs/api/latest/Workspace.
If you do need the view, please use atom.views.getView(atom.workspace),
which returns an HTMLElement.

Atom.Object.defineProperty.get (/Applications/Atom.app/Contents/Resources/app/src/atom.js:55:11)
Object._events (/Users/femmebot/.atom/packages/autoclose-html/lib/autoclose-html.coffee:108:13)

Bugreport: Problems with closing php closing ?>

Hi,
if I wrote ?> for closing PHP code the Developer Tools Window will open and is printing an error in the console.

Uncaught InvalidCharacterError: The string contains invalid characters. /Applications/Webentwicklung/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/history.js:99

I'm using Atomversion 0.110.0 (0.110.0).

Close all tags inline

The package doesn't have an opportunity to set that all tags close inline. Type all tags for that is very boring.

Autoclose only available in HTML files

Browsing your package, it appears you only allow auto close on HTML files. Is there a specific reason you have this locked down? I'm a PHP developer and use a framework that forces me to use .php files for my templates. I'd love if I could be able to add extensions to a config that would extend it's functionality. I know rails developers will also note that .erb files wouldn't work as well. I'd be willing to help out in extending this plugin I just want to know if you have any reasons as to why it's locked down.

Doesn't work

I installed this and it doesn't seem to do anything.

Steps to replicate:

  1. Install autococlose-html
apm install autoclose-html Installing autoclose-html to /Users/flynsarmy/.atom/packages ✓
1. Restart atom 2. In the blank file that exists when opening atom, set grammar to HTML 3. Type ``

No closing tag. Also tried <body> and <div>. Even tried </ afterwards but still nothing. I'm on Atom 0.69.0 and no errors are showing in console.

Shuts off upon close of Atom

The title pretty much sums it up. It has to be disabled and reenabled after starting Atom back up, but then it duplicates the closing tags, so it has to be disabled, shut off, and reenabled.

Atom.Object.defineProperty.get is deprecated.

atom.workspaceView is no longer available.
In most cases you will not need the view. See the Workspace docs for
alternatives: https://atom.io/docs/api/latest/Workspace.
If you do need the view, please use atom.views.getView(atom.workspace),
which returns an HTMLElement.

Atom.Object.defineProperty.get (/usr/share/atom/resources/app/src/atom.js:55:11)
Object._events (/home/bryan/.atom/packages/autoclose-html/lib/autoclose-html.coffee:108:13)

Repeated Closing Tags

When I hit backspace one too many and accidentally remove the > in the opening tag, typing it creates another closing tag, even if there's an existing one. I guess this requires parsing the entire document also.

Closing ERb tags

I wanted to customize the tool to autoclose my ERb HTML tags. Is there a way to make it do this?: as soon as I enter "<%" the tool closes it with " %>" putting a space in between and leaving the cursor right behind the first "%" sign so I can add "=" if need be. I'm pretty sure this is an easy fix for an experienced programer, but I don't know how to do it.

Loses multiple cursors when typing ENTER

So one pattern I do a lot is given a HTML tag such as:

<input type="text" name="name" size="20">

I'll put multiple cursors on each of the spaces so I can hit ENTER to put them onto their own line and end up with:

<input
  type="text"
  name="name"
  size="20">

It seems when this package is enabled, my multiple cursors are lost when I hit ENTER.

For reference here's the original issue I filed in atom support before tracking the issue down to this package.

Autoclosing tag when enter > char beetween curly brackets

When I try to use Laravel Blade and try to enter variable inside opened tag then it close automatically. Example:
When try to write something like this:

I get:

When try to write:

{{{ $some->varialbe }}}

I get:

{{{ $user->

}}}

Because every time when i pressed ">" char then program looks for first occurrence of open tag to the left and if it finds it then it inserts closing tag even if it actually exists.

Uncaught TypeError: Cannot read property 'tokenAtBufferColumn' of undefined

[Enter steps to reproduce below:]

  1. I'm working with a .js file and this error occurs as soon as I complete the a
    tag and it auto-completes the closing tag for me. The closing tag is created but then the error shortly follows. Early today I had an issue with the bracket-matching package throwing a similar error, so I installed this package.

packages installed: vim-mode, sublime-style-column-selection, autoclose.html

Atom Version: 0.176.0
System: Mac OS X 10.10.1
Thrown From: autoclose-html package, v0.14.0

Stack Trace

Uncaught TypeError: Cannot read property 'tokenAtBufferColumn' of undefined

At /Applications/Atom.app/Contents/Resources/app/src/tokenized-buffer.js:503

TypeError: Cannot read property 'tokenAtBufferColumn' of undefined
  at TokenizedBuffer.module.exports.TokenizedBuffer.tokenForPosition (/Applications/Atom.app/Contents/Resources/app/src/tokenized-buffer.js:503:38)
  at TokenizedBuffer.module.exports.TokenizedBuffer.scopeDescriptorForPosition (/Applications/Atom.app/Contents/Resources/app/src/tokenized-buffer.js:496:22)
  at DisplayBuffer.module.exports.DisplayBuffer.scopeDescriptorForBufferPosition (/Applications/Atom.app/Contents/Resources/app/src/display-buffer.js:1044:35)
  at TextEditor.module.exports.TextEditor.scopeDescriptorForBufferPosition (/Applications/Atom.app/Contents/Resources/app/src/text-editor.js:2413:33)
  at LanguageMode.module.exports.LanguageMode.suggestedIndentForBufferRow (/Applications/Atom.app/Contents/Resources/app/src/language-mode.js:315:37)
  at LanguageMode.module.exports.LanguageMode.autoIndentBufferRow (/Applications/Atom.app/Contents/Resources/app/src/language-mode.js:374:26)
  at TextEditor._results.push._this.(anonymous function) [as autoIndentBufferRow] (/Applications/Atom.app/Contents/Resources/app/node_modules/delegato/lib/delegator.js:67:61)
  at /Users/xajin/.atom/packages/autoclose-html/lib/autoclose-html.coffee:98:28

Commands

     -0:26.1 vim-mode:activate-command-mode (atom-text-editor.editor.vim-mode.is-focused.insert-mode)
     -0:25.2 vim-mode:insert-after-end-of-line (atom-text-editor.editor.vim-mode.is-focused.insert-mode)
     -0:23.4 core:backspace (atom-text-editor.editor.vim-mode.is-focused.insert-mode)
  3x -0:20.6 core:move-left (atom-text-editor.editor.vim-mode.is-focused.insert-mode)
     -0:18.8 core:backspace (atom-text-editor.editor.vim-mode.is-focused.insert-mode)
     -0:16.9 core:save (atom-text-editor.editor.vim-mode.is-focused.insert-mode)
     -0:16.5 core:move-up (atom-text-editor.editor.vim-mode.is-focused.insert-mode)
     -0:12.8 editor:newline (atom-text-editor.editor.vim-mode.is-focused.insert-mode)
     -0:11.9 core:move-up (atom-text-editor.editor.vim-mode.is-focused.insert-mode)
     -0:11.0 snippets:next-tab-stop (atom-text-editor.editor.vim-mode.is-focused.insert-mode)
     -0:11.0 snippets:expand (atom-text-editor.editor.vim-mode.is-focused.insert-mode)
     -0:11.0 editor:indent (atom-text-editor.editor.vim-mode.is-focused.insert-mode)
     -0:10.7 snippets:next-tab-stop (atom-text-editor.editor.vim-mode.is-focused.insert-mode)
     -0:10.7 snippets:expand (atom-text-editor.editor.vim-mode.is-focused.insert-mode)
     -0:10.7 editor:indent (atom-text-editor.editor.vim-mode.is-focused.insert-mode)
     -0:09.9 core:backspace (atom-text-editor.editor.vim-mode.is-focused.insert-mode)

Config

{
  "core": {
    "disabledPackages": [
      "bracket-matcher"
    ]
  },
  "autoclose-html": {
    "forceInline": "p, h1, h2, h3"
  }
}

Installed Packages

# User
Sublime-Style-Column-Selection, v1.2.3
atom-beautify, v0.21.2
autoclose-html, v0.14.0
compare-files, v0.3.1
vim-mode, v0.30.0

# Dev
No dev packages

/cc @atom/core

Auto tab when pressing enter on inline elements

Say I have the following in my editor <p></p> with my cursor in the center. When pressing new line, I'd like the cursor to appear in the same way it does when autoclosing non inline elements - a blank line is inserted and the cursor is tabbed in one level. Like so:

<p>
    |
</p>

Atom.Object.defineProperty.get is deprecated.

atom.workspaceView is no longer available.
In most cases you will not need the view. See the Workspace docs for
alternatives: https://atom.io/docs/api/latest/Workspace.
If you do need the view, please use atom.views.getView(atom.workspace),
which returns an HTMLElement.

Atom.Object.defineProperty.get (/usr/share/atom/resources/app/src/atom.js:55:11)
Object._events (/home/mubix/.atom/packages/autoclose-html/lib/autoclose-html.coffee:108:13)

Doesn't close any tags

I can't seem to get this plugin to work at all. I've tried it on plain html files and html.erb files, and it doesn't close any tags. I've checked the console for any errors but it's all clean.
I'm using:

  • OS X 10.9.5
  • Atom 0.136.0
  • Autoclose Html 0.12.0

I have Close on End of Opening Tag checked as well as Make Never Close Elements Self Closing. Everything else is default.

elements don't get removed from the body

after inspection, I saw the elements that get created by this package do not get removed from the body again. so after writing some html structures, there's a lot of empty elements appended to the body.

Unused Menu - 'toggle'

You have a menu Packages - autoclose-html - toggle that doesn't appear to do anything.

Atom.Object.defineProperty.get is deprecated.

atom.workspaceView is no longer available.
In most cases you will not need the view. See the Workspace docs for
alternatives: https://atom.io/docs/api/latest/Workspace.
If you do need the view, please use atom.views.getView(atom.workspace),
which returns an HTMLElement.

Atom.Object.defineProperty.get (/Applications/Atom.app/Contents/Resources/app/src/atom.js:55:11)
Object._events (/Users/pete.hudgins/.atom/packages/autoclose-html/lib/autoclose-html.coffee:108:13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.