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

Snippet not working without space. #301

Open
vvasuki opened this issue Feb 25, 2020 · 1 comment
Open

Snippet not working without space. #301

vvasuki opened this issue Feb 25, 2020 · 1 comment

Comments

@vvasuki
Copy link

vvasuki commented Feb 25, 2020

Prerequisites

Description

My snippet works when preceded by a space, but not otherwise.

Steps to Reproduce

Illustrated here:
atom-snippet-without-space

Snippet code:

  'Sanskrit doc emphasis comment':
    'prefix': 'ccc'
    'body': '+++($1)+++'

Versions

Atom 1.44.0

Arch Linux

Additional Information

I have seen #272 as well as #151 . Seems non-duplicate.

@levipmartin
Copy link

I have the same problem. I believe this is intentional but problematic for postfix snippets, where you have alternating words preceded by a common postfix. Now I want to shorten the postfix as a snippet to complete it. This is not possible since I have to insert a space to trigger the snippet first.

Possible solution 1:
Add regex support for snippets,
'Sanskrit doc emphasis comment': 'prefix': '.*ccc' 'body': '+++($1)+++'
Something like this, maybe it has to be escaped.

Alternatively I wouldn't mind pressing the space to trigger my snippet, if I can delete the space when inserting the snippet, but I have not found a way to do so yet.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants