atom / snippets

Atom snippets package
MIT License
205 stars 100 forks source link

Starting the Second Line of a Snippet with a Tab Stop Includes Preceding Whitespace #234

Closed trslater closed 7 years ago

trslater commented 7 years ago

Prerequisites

Description

When creating a snippet with the following two conditions:

When the snippet is expanded, the tab stop selects the indenting before it.

Things that I've tried:

Here is the code I was trying to create:

'.source.js':
  'Extends':
    'prefix': 'ext'
    'body': """
      ${1:ChildClass}.prototype             = Object.create(${2:ParentClass}.prototype);
      ${1:ChildClass}.prototype.constructor = ${1:ChildClass};$0
    """

Here is what is produced:

screenshot 2017-02-19 15 42 38

Here is what I would like to see (and I think makes more sense):

screenshot 2017-02-19 15 45 18

Steps to Reproduce

  1. Create a new snippet with anything on the first line
  2. Start a second line of the snippet at the same indent level as the first line
  3. Create a tab stop as the first text on the second line
  4. Expand the snippet in the appropriate source file (again, only tried JavaScript)

Expected behavior: Only the tab stop should be selected

Actual behavior: Tab stop and whitespace preceding it is selected

Reproduces how often: Every time

Versions

Atom : 1.14.3 Electron: 1.3.13 Chrome : 52.0.2743.82 Node : 6.5.0

macOS Sierra (Version 10.12.3)

Additional Information

I can't think of anything.

50Wliu commented 7 years ago

Thanks for taking the time to contribute!

We noticed that this is a duplicate of #140. You may want to subscribe there for updates.

Because we treat our issues list as the Atom team's backlog, we close duplicates to focus our work and not have to touch the same chunk of code for the same reason multiple times. This is also why we may mark something as duplicate that isn't an exact duplicate but is closely related.

For information on how to use GitHub's search feature to find out if something is a duplicate before filing, see the How Can I Contribute? section of the Atom CONTRIBUTING guide.

trslater commented 7 years ago

Searched high and low and couldn't find this! Sorry for not catching this.