Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Snippets do not behave as expected when expanding within another snippet #152

Open
@rnorris7756

Description

@rnorris7756

Hi,

There is a really nice feature in some editors with snippets where you can expand a snippet at a tab stop inside another snippet, and continue walking through the outer snippet's tab stops after all tab stops in the inner snippet have been visited. I've tried this in Atom, but it doesn't seem to work, and I can't find any issues describing this as a bug or intentional behavior. Here is an image of the expected behavior in the Gummi editor:

test

Although the quality of the gif is not that great, you can see that several inner snippets are being expanded and completed at various points while filling in the tab stops of the outer snippet. In Atom, activating a snippet within another snippet deletes all of the remaining tab stops in the outer snippet once the inner snippet is expanded. It would be great to have the option of chaining snippets together in this way.

Activity

idleberg

idleberg commented on Jul 12, 2015

@idleberg

I was about to post the same. Here's how you can reproduce this:

  • Create an empty HTML document
  • type html and hit Tab to complete to a HTML skeleton

You can now use Tab to jump between <title> and <body>, but let's continue the steps above with the following:

  • With the cursor between the <title> tags, type img and hit Tab to complete this (stupid thing to do, but this is for demonstration purposes only!)
  • Hit Tab to complete again to jump between src and alt
  • Hit Tab again and Atom will indent </title> rather than jumping inside the <body>

Hope this helps understanding the problem.

linked a pull request that will close this issue on Feb 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Participants

      @mnquintana@rnorris7756@idleberg

      Issue actions

        Snippets do not behave as expected when expanding within another snippet · Issue #152 · atom/snippets