atom / snippets

Atom snippets package
MIT License
204 stars 102 forks source link

Only last snippet working #160

Closed zenopopovici closed 9 years ago

zenopopovici commented 9 years ago

Only last snippet activates:

#
# Wordpress
#
'.text.html.php':
  'WP Start Loop':
    'prefix': 'wppl'
    'body': """
        <?php if (have_posts()) while (have_posts()): the_post(); ?>
        $1
    """
'.text.html.php':
  'WP Edit Link':
    'prefix': 'we'
    'body': """
        <?php edit_post_link('','<div class="adm-edit"><div class="icon-adm-edit">', '</div></div>'); ?>
        $1
    """
'.text.html.php':
  'WP Title':
    'prefix': 'wt'
    'body': """
        <?php the_title(); ?>$1
    """
'.text.html.php':
  'WP Title':
    'prefix': 'wgt'
    'body': """
        <?php echo get_the_title($post->ID); ?>$1
    """
'.text.html.php':
  'WP Content':
    'prefix': 'wc'
    'body': """
        <?php the_content(); ?>
        $1
    """
izuzak commented 9 years ago

Yeah, that's expected -- you're overriding values each time. You need to group values under the same key instead of re-defining the key every time. Check my comment here: https://github.com/atom/atom/pull/7562/files#r33752061

zenopopovici commented 9 years ago

My bad. Thanks!