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.

Tab stops at the start of an indented line select all leading whitespace #140

@nathanbuchar

Description

@nathanbuchar

This is a pretty specific bug, hopefully I explain it well!

If you have a snippet with a tab stop that starts at the beginning of a line, it will also select all space to the left of the tab stop. Therefore, if you're attempting to place the snippet within an indented area, the tab stop will also select all the empty space to the left.

However, this appears to only happen when the snippet is preceded by a multi-line comment.

Below, you'll see two identical snippets, however the first one has a preceding multi-line comment. When tabbing to the class_name tab stop, you'll see that it selects too much space, but this is not the case for the second example (the built-in proto snippet).

It should be noted that the multi-line comment must be defined as part of the snippet. Writing a multi-line comment, then invoking the proto snippet will not cause this bug to occur.

screen shot 2015-05-20 at 10 40 37 am

screen shot 2015-05-20 at 10 41 45 am

My snippet definition:

'.source.js'
  'Prototypal method':
    'prefix': 'method'
    'body': """
      /**
       * @method ${1:method_name}
       * @description ${2:description}
       */
      ${3:class_name}.prototype.${1:method_name} = function (${4:first_argument}) {
        ${5:// body...}
      };
    """

Here, ${3:class_name} follows a multi-line comment, and also is also at the start of a line.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions