Multi line snippets inserting only last line


#1

I tried:

'.text.html.ruby':
  '.erb_pry':
    'prefix': 'pry'
    'body': """
      require \'pry\'
      binding.pry
      """
'.text.html.ruby':
  '.erb_pry':
    'prefix': 'pry'
    'body': """
      require 'pry'
      binding.pry
      """
'.text.html.ruby':
  '.erb_pry':
    'prefix': 'pry'
    'body': """
      require \\'pry\\'
      binding.pry
      """
'.text.html.ruby':
  'erb_pry':
    'prefix': 'pry'
    'body': """
      require \'pry\'
      binding.pry
      """

And nothing works. Only the last line is inserted when I run the snippet shortcut. What can it be?


#2

This snippet worked ok for me:

'.text.html.ruby':
  'erb_pry':
    'prefix': 'pry'
    'body': """
      require 'pry'
      binding.pry
      """

I just had to make sure to choose the correct language (HTML (Rails)):

If I incorrectly set the language as Ruby, I see the same behavior as you:

This was because the language scope didn’t match yours and Ruby has its own pry snippet that expands to binding.pry (which confused me at first).

Does that explain what you’re seeing?


#3

Explain even more.
I was trying to use the snippets (declared in HTML(Rails)) in Ruby files. Thanks.