emmetio / emmet-atom

Emmet support for Atom
MIT License
764 stars 179 forks source link

Indent problem #485

Open monsieurm opened 7 years ago

monsieurm commented 7 years ago

Hi

I'm new on Atom, I love it but I have a problem with the Emmet indent.

Here a video with the issue, I expend with Emmet, but with or without the problem is here.

https://www.dropbox.com/playlist/sharing/indent.mp4?_subject_uid=19348716

Before Atom I used Coda and Emmet worked fine.

Have you an idea ?

Thanks

sergeche commented 7 years ago

Can’t see video, seems like insufficient rights

monsieurm commented 7 years ago

Sorry about that https://www.youtube.com/watch?v=ifBSlBak2Ag

sergeche commented 7 years ago

Make sure you have Format Line Breaks option enabled in Emmet preferences

monsieurm commented 7 years ago

Yes I have :(

sergeche commented 7 years ago

Try to enable Packages > Keybinding Resolver and check which action is invoked when you hit Tab between opening and closing tags

monsieurm commented 7 years ago

I have modified the shortcut for Emmet, I'm using 'ctrl-e'. This is the same thing when I set 'tab' for Emmet.

https://www.youtube.com/watch?v=Ex3ASWxQBA0

monsieurm commented 7 years ago

Thanks for your support

sergeche commented 7 years ago

Seems like you didn’t set document syntax to HTML. Formatted line breaks works for HTML/XML syntax only

monsieurm commented 7 years ago

In the example of the video, at the bottom of the window is indicated HTML.

screen shot 2016-12-02 at 00 01 46

Otherwise I also use PHP documents formatted in PHP.

screen shot 2016-12-02 at 00 01 57

It never worked on Atom, but it worked perfectly on Coda. https://www.youtube.com/watch?v=ZCp6AfoGERQ

I really do not understand why :(

sergeche commented 7 years ago

According to keymap, in order to have formatted line break to work, you must have HTML syntax and autocomplete popup not visible.

If it still doesn’t work, please create a new video for file with HTML syntax and enabled Kybindings resolver

monsieurm commented 7 years ago

Ok.

Atom from scratch and just Emmet (with HTML syntax), works fine.

It's not possible to use autocomplete popup and Emmet ?

Thanks for your support

rrapstine commented 7 years ago

@monsieurm Not sure if you ended up solving the issue, but I struggled with this for quite a while before figuring it out. When you disable keybindings for Emmet (which I did to unmap Tab) you also end up disabling the keybinding for inserting a formatted new line (Enter by default). To reenable the behavior, just copy the keybinding into your keymap.cson file and you'll be good to go! This will not work while the autocomplete popup is showing on screen, but I personally have yet to find an instance where it is after expanding an Emmet abbreviation.

For your reference, here is the specific keybinding to copy...

'atom-pane atom-text-editor[data-grammar~="html"]:not([mini]):not(.autocomplete-active), atom-pane atom-text-editor[data-grammar~="xml"]:not([mini]):not(.autocomplete-active)':
  'enter': 'emmet:insert-formatted-line-break-only'

In hindsight, I kinda wish this consequence was documented somewhere, as it would have saved me literally weeks of searching.

monsieurm commented 7 years ago

@rrapstine Yeah ! This is the solution ! Now I will unlearn the way I did :)

Thank you so much !