atom / snippets

Atom snippets package
MIT License
205 stars 101 forks source link

Replace snippet starting with backslash does not work #282

Closed ghost closed 5 years ago

ghost commented 5 years ago

Description

I want to replace a snippet which starts with a backslash in the language markdown:
\alpha shall be replaced by the unicode symbol U+03B1: α

Steps to Reproduce

  1. Start Atom
  2. Menu-Bar > Edit > Snippets
  3. Add following lines of code:
    # Language: Markdown (.gfm == .md)
    '.source.gfm':
    'U+03B1 alpha: α':
    'prefix': '\\\\alpha'
    'body': 'α'

    Expected behavior:
    \alpha will be replaced by α.

Actual behavior:
Atom does not recognize the snippet.
I.e. by typing \alpha atom does not even suggests a snippet.

Reproduces how often:
Always.

Versions

Atom:

user@computer ~ $ atom --version
Atom    : 1.26.0
Electron: 1.7.11
Chrome  : 58.0.3029.110
Node    : 7.9.0

apm:

user@computer ~ $ apm --version
apm  1.19.0
npm  3.10.10
node 6.9.5 x64
atom 1.26.0
python 2.7.12
git 2.7.4

OS:

user@computer ~ $ lsb_release -a
No LSB modules are available.
Distributor ID: LinuxMint
Description:    Linux Mint 18.2 Sonya
Release:    18.2
Codename:   sonya
user@computer ~ $ 

Additional Information

It does not matter if i use one, two, three or even four (double escape) backslashes before the term "alpha": 'prefix': '\\\\alpha'

Aerijo commented 5 years ago

The prefix only requires \\ for a single backslash. \\alpha should work.

ghost commented 5 years ago

@Aerijo I already tried it with 1 to 4 backslashes. Unfortunately it does not make any difference. Atom still does not suggest the snippet.

Aerijo commented 5 years ago

@Alexander-Erlacher Hmmm, I could have sworn something about that issue was fixed. But I could reproduce it right now too. I believe setting \ as a word character should fix it, but I wasn't able to get that working. I'll look into it soon.

FYI the snippet itself should work fine, but it won't appear in the autocomplete menu. The issue is with autocomplete-snippets, which is the one that's supposed to make it appear. There's an open issue for it, so you will want to subscribe there for updates.

With that, I'll close this issue. If the snippet itself doesn't work (write out \alpha and press tab), please reopen.