atom / snippets

Atom snippets package
MIT License
205 stars 100 forks source link

HTML creates an element on 'tab', rather than using snippet #178

Closed jeffersonlam closed 8 years ago

jeffersonlam commented 8 years ago

I have a snippet like this:

'.text.html':
  'HTML5 Skeleton':
    'prefix': 'html'
    'body': '
<!DOCTYPE html>\n
<html>\n
\t<head>\n
\t\t<meta charset="utf-8">\n
\t\t<title></title>\n
\t\t<meta name="description" content="">\n
\t\t<meta name="author" content="">\n
\t\t<meta name="viewport" content="width=device-width, initial-scale=1">\n
\t\t<link rel="stylesheet" type="text/css" href="">\n
\t</head>\n
\t<body>\n
\t\t<h1>h1</h1>\n
\t<script type="text/javascript" src=""></script>\n
\t</body>\n
</html>'

But when I type html and then hit tab, what it does is it creates an HTML element: <html></html>. I can still manually activate this snippet by typing a bit, waiting for the little menu to pop up, and then hitting enter on the snippet, but this is a much slower workflow.

snippet

I suspect there might be conflicts with the autocomplete-html package. Any ideas?

thedaniel commented 8 years ago

Can you reproduce this in atom's safe mode? html-> in an html file with a totally stock atom should expand to the snippet included in language-html, not just a plain tag. Maybe you have a package installed that's added another snippet for html?

jeffersonlam commented 8 years ago

Looks like the problem went away in safe mode. And you're right, taking away my custom snippet, html-> brings up the default snippet. How should I resolve this; should I reinstall Atom?

thedaniel commented 8 years ago

@jeffersonlam you don't need to reinstall - the most likely issue is that one of the community packages you have installed is responsible for the behavior.

jeffersonlam commented 8 years ago

Aha, it was the the emmet community package I had installed. Looks like some folks have already noticed this same problem and created an additional package emmet-snippets-compatibility which gives the snippets function priority over emmet. Thanks!